fix: separate workflows for release and GHA build + tags #5
Workflow file for this run
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 | |
| # Triggered by pushing a semver tag (e.g. v2.1.3, v2.1.3-beta.1). | |
| # Creates a GitHub Release with auto-generated notes. Marks it as prerelease | |
| # if the tag contains a hyphen. | |
| # | |
| # Publishing the release fires the "Build and Tag" workflow, | |
| # which builds dist/ and updates the version refs. | |
| on: | |
| push: | |
| tags: | |
| - 'v*.*.*' | |
| permissions: | |
| contents: write | |
| jobs: | |
| notify-start: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: kosli-dev/reusable-actions/slack-release-notify@main | |
| with: | |
| slack-bot-token: ${{ secrets.SLACK_BOT_TOKEN }} | |
| slack-channel-id: ${{ vars.SLACK_CHANNEL_ID }} | |
| stage: start | |
| release: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| - name: Create GitHub Release with auto-generated notes | |
| uses: softprops/action-gh-release@v3 | |
| with: | |
| generate_release_notes: true | |
| # Mark as prerelease if the tag contains a hyphen (e.g. v2.1.3-beta.1). | |
| prerelease: ${{ contains(github.ref_name, '-') }} | |
| notify-finish: | |
| needs: [notify-start, release] | |
| if: always() && needs.notify-start.result == 'success' | |
| runs-on: ubuntu-latest | |
| permissions: | |
| actions: read # ← needed to fetch run_started_at for duration | |
| contents: read # ← needed to read release notes via `gh release view` | |
| steps: | |
| - name: Determine status | |
| id: status | |
| run: | | |
| if [[ "${{ needs.release.result }}" == "success" ]]; then | |
| echo "value=success" >> "$GITHUB_OUTPUT" | |
| else | |
| echo "value=failure" >> "$GITHUB_OUTPUT" | |
| fi | |
| - uses: kosli-dev/reusable-actions/slack-release-notify@main | |
| with: | |
| slack-bot-token: ${{ secrets.SLACK_BOT_TOKEN }} | |
| slack-channel-id: ${{ vars.SLACK_CHANNEL_ID }} | |
| stage: finish | |
| status: ${{ steps.status.outputs.value }} |