Release #9
This file contains hidden or 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: Release | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| version_type: | |
| description: 'Version bump type' | |
| required: true | |
| type: choice | |
| options: | |
| - patch | |
| - minor | |
| - major | |
| jobs: | |
| release: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| id-token: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| - uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| registry-url: 'https://registry.npmjs.org' | |
| - name: Configure git | |
| run: | | |
| git config user.name "github-actions[bot]" | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| - name: Install dependencies | |
| run: npm ci --ignore-scripts | |
| - name: Bump version | |
| run: npm version ${{ inputs.version_type }} -m "Release %s" | |
| - name: Push commit and tag | |
| run: git push && git push --tags | |
| - name: Build | |
| run: npm run build | |
| - name: Publish to npm | |
| run: npm publish --ignore-scripts --provenance --access public | |
| env: | |
| NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} | |
| - name: Create GitHub Release | |
| run: | | |
| VERSION=$(node -p "require('./package.json').version") | |
| gh release create "v${VERSION}" --generate-notes --title "v${VERSION}" | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |