chore(fix): code formatter #2
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: | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - src/** | |
| workflow_dispatch: | |
| inputs: | |
| version: | |
| description: 'Version bump' | |
| required: true | |
| default: 'patch' | |
| type: choice | |
| options: | |
| - prerelease | |
| - prepatch | |
| - preminor | |
| - premajor | |
| - patch | |
| - minor | |
| - major | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| concurrency: | |
| group: "release" | |
| cancel-in-progress: false | |
| jobs: | |
| release: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| - name: "Bump to new version" | |
| id: bump | |
| run: | | |
| _version=$(npm --no-git-tag-version version ${{ github.event.inputs.version || 'patch' }}) | |
| echo "new_version=$_version" >> $GITHUB_OUTPUT | |
| echo "New version: $_version" | |
| - name: "Create Pull Request" | |
| id: cpr | |
| uses: peter-evans/create-pull-request@v8 | |
| with: | |
| token: ${{ secrets.RELEASE_PAT }} | |
| title: "chore(release): bump version to ${{ env.NEW_VERSION }}" | |
| body: "chore(release): bump version to ${{ env.NEW_VERSION }}" | |
| commit-message: "chore(release): bump version to ${{ env.NEW_VERSION }}" | |
| env: | |
| NEW_VERSION: ${{ steps.bump.outputs.new_version }} | |
| - name: "Release" | |
| env: | |
| # https://docs.github.com/en/actions/how-tos/write-workflows/choose-when-workflows-run/trigger-a-workflow#triggering-a-workflow-from-a-workflow | |
| GITHUB_TOKEN: ${{ secrets.RELEASE_PAT }} | |
| NEW_VERSION: ${{ steps.bump.outputs.new_version }} | |
| run: | | |
| gh release create $NEW_VERSION \ | |
| -t $NEW_VERSION | |
| - name: "Auto-merge PR" | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| gh pr merge --squash --auto "${{ steps.cpr.outputs.pull-request-number }}" |