Automated Release (dry run) #3
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Automated Release (dry run) | |
on: | |
workflow_dispatch: | |
inputs: | |
releaseLevel: | |
description: 'Release Level' | |
required: true | |
default: 'patch' | |
type: choice | |
options: | |
- patch | |
- minor | |
jobs: | |
publish-npm-dry-run: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-node@v3 | |
with: | |
node-version: 18 | |
registry-url: https://registry.npmjs.org/ | |
- uses: pnpm/action-setup@v2 | |
with: | |
run_install: true | |
- name: Build a bundle | |
run: pnpm run build | |
working-directory: ./packages/tailwind-joy | |
- name: Bump a package version | |
run: npm version ${{ inputs.releaseLevel }} | |
working-directory: ./packages/tailwind-joy | |
- name: Publish package | |
run: npm publish --dry-run | |
working-directory: ./packages/tailwind-joy | |
env: | |
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
- name: Publish a release commit and tag | |
run: | | |
git config user.name "github-actions[bot]" | |
git config user.email "github-actions[bot]@users.noreply.github.com" | |
NEXT_VERSION=$(npm pkg get version | awk '{print substr($0, 2, length($0)-2)}') | |
git add package.json | |
echo $NEXT_VERSION | xargs -I {} git commit -m "chore: release {}" | |
echo $NEXT_VERSION | xargs -I {} git tag v{} | |
git log --graph -1 | |
working-directory: ./packages/tailwind-joy |