feat: add --tag-strategy flag to switch between github API and git CLI #5
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] | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| jobs: | |
| release: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Configure git | |
| run: | | |
| git config user.name "github-actions[bot]" | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| - uses: denoland/setup-deno@v2 | |
| with: | |
| deno-version: v2.x | |
| - name: Check if release commit | |
| id: check | |
| run: | | |
| if git log -1 --pretty=%B | grep -q "^chore: release v"; then | |
| echo "is_release=true" >> $GITHUB_OUTPUT | |
| else | |
| echo "is_release=false" >> $GITHUB_OUTPUT | |
| fi | |
| - name: Create release (on release commit) | |
| if: steps.check.outputs.is_release == 'true' | |
| run: deno run -A src/cli.ts --storage=github --execute | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Create/update release PR (on regular commit) | |
| if: steps.check.outputs.is_release == 'false' | |
| run: deno run -A src/cli.ts pr --execute | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |