release patch #7
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 & Publish | |
| run-name: "release ${{ inputs.bump }}" | |
| on: | |
| workflow_dispatch: | |
| inputs: | |
| bump: | |
| description: "Bump major, minor, or patch" | |
| required: true | |
| type: choice | |
| options: | |
| - patch | |
| - minor | |
| - major | |
| jobs: | |
| publish: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| id-token: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - uses: ./.github/actions/setup | |
| - name: Publish | |
| id: publish | |
| run: bun run script/publish.ts | |
| env: | |
| BUMP: ${{ inputs.bump }} | |
| NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Commit release version | |
| id: commit | |
| uses: stefanzweifel/git-auto-commit-action@v5 | |
| with: | |
| commit_message: "release: v${{ steps.publish.outputs.version }}" | |
| file_pattern: "package.json" | |
| - name: Create GitHub release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: "v${{ steps.publish.outputs.version }}" | |
| name: "v${{ steps.publish.outputs.version }}" | |
| generate_release_notes: true | |
| target_commitish: ${{ steps.commit.outputs.commit_hash }} | |
| outputs: | |
| version: ${{ steps.publish.outputs.version }} | |
| tag: ${{ steps.publish.outputs.tag }} |