fix: trigger build workflow from release event instead of tag push
Tag pushes created by semantic-release via the GitHub API do not trigger push-based workflows. Switch to the release event which fires when semantic-release creates the draft GitHub release.
This commit is contained in:
@@ -1,16 +1,15 @@
|
|||||||
name: Build & Publish
|
name: Build & Publish
|
||||||
run-name: Build ${{ github.ref_name }}
|
run-name: Build ${{ github.event.release.tag_name }}
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
release:
|
||||||
tags:
|
types: [created]
|
||||||
- "v*"
|
|
||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
contents: write
|
contents: write
|
||||||
|
|
||||||
concurrency:
|
concurrency:
|
||||||
group: build-${{ github.ref_name }}
|
group: build-${{ github.event.release.tag_name }}
|
||||||
cancel-in-progress: false
|
cancel-in-progress: false
|
||||||
|
|
||||||
env:
|
env:
|
||||||
@@ -45,6 +44,7 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
|
ref: ${{ github.event.release.tag_name }}
|
||||||
submodules: recursive
|
submodules: recursive
|
||||||
|
|
||||||
- uses: actions/setup-go@v5
|
- uses: actions/setup-go@v5
|
||||||
@@ -77,7 +77,8 @@ jobs:
|
|||||||
id: version
|
id: version
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
VERSION="${GITHUB_REF_NAME#v}"
|
VERSION="${{ github.event.release.tag_name }}"
|
||||||
|
VERSION="${VERSION#v}"
|
||||||
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
|
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
|
||||||
echo "Building version: $VERSION"
|
echo "Building version: $VERSION"
|
||||||
|
|
||||||
@@ -161,7 +162,7 @@ jobs:
|
|||||||
# The release was already created as a draft by semantic-release.
|
# The release was already created as a draft by semantic-release.
|
||||||
# This step finds it by tag and attaches binaries, then publishes.
|
# This step finds it by tag and attaches binaries, then publishes.
|
||||||
draft: false
|
draft: false
|
||||||
tag_name: ${{ github.ref_name }}
|
tag_name: ${{ github.event.release.tag_name }}
|
||||||
fail_on_unmatched_files: true
|
fail_on_unmatched_files: true
|
||||||
files: |
|
files: |
|
||||||
artifacts/yellowjacket-linux-amd64
|
artifacts/yellowjacket-linux-amd64
|
||||||
|
|||||||
Reference in New Issue
Block a user