Merge pull request #52 from algotyrnt/dev #18
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 | |
| jobs: | |
| release: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version: "22" | |
| - name: Configure Git | |
| run: | | |
| git config --global user.name 'github-actions[bot]' | |
| git config --global user.email 'github-actions[bot]@users.noreply.github.com' | |
| - name: Decide release version | |
| id: check_version | |
| run: | | |
| bash .github/scripts/decide-release-version.sh | |
| - name: Bump patch version | |
| if: steps.check_version.outputs.bump == 'true' | |
| id: version | |
| run: | | |
| npm version patch -m "Bump version to %s [skip ci]" | |
| echo "new_version=$(node -p "require('./package.json').version")" >> "$GITHUB_OUTPUT" | |
| - name: Push changes | |
| if: steps.check_version.outputs.bump == 'true' | |
| run: | | |
| git push --follow-tags | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Create GitHub Release | |
| if: steps.check_version.outputs.release == 'true' | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: v${{ steps.version.outputs.new_version || steps.check_version.outputs.new_version }} | |
| name: Release v${{ steps.version.outputs.new_version || steps.check_version.outputs.new_version }} | |
| generate_release_notes: true | |
| draft: false | |
| prerelease: false |