Fix lint #12
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 | ||
| outputs: | ||
| version: ${{ steps.publish.outputs.version }} | ||
| tag: ${{ steps.publish.outputs.tag }} | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| with: | ||
| fetch-depth: 0 | ||
| - uses: ./.github/actions/setup | ||
| - name: Publish to NPM | ||
| id: publish | ||
| run: bun run scripts/publish.ts | ||
| env: | ||
| BUMP: ${{ inputs.bump }} | ||
| NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
| - name: Commit version bump | ||
| id: commit | ||
| uses: stefanzweifel/git-auto-commit-action@v5 | ||
| with: | ||
| commit_message: "release: v${{ steps.publish.outputs.version }}" | ||
| file_pattern: "package.json" | ||
| - name: Save Commit Hash | ||
| id: save_hash | ||
| run: echo "hash=${{ steps.commit.outputs.commit_hash || github.sha }}" >> $GITHUB_OUTPUT | ||
| outputs: | ||
| version: ${{ steps.publish.outputs.version }} | ||
| tag: ${{ steps.publish.outputs.tag }} | ||
| commit_hash: ${{ steps.save_hash.outputs.hash }} | ||
| release: | ||
| needs: publish | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: write | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - name: Create GitHub release | ||
| uses: softprops/action-gh-release@v2 | ||
| with: | ||
| tag_name: ${{ needs.publish.outputs.tag }} | ||
| name: ${{ needs.publish.outputs.tag }} | ||
| generate_release_notes: true | ||
| target_commitish: ${{ needs.publish.outputs.commit_hash }} | ||