fix(ci): run post-tag release builds without job-output gating
Remove auto-tag job output dependencies and conditional gates so release build jobs always run after autotag completes, resolving skipped fan-out caused by output/if evaluation issues in Gitea Actions. Made-with: Cursor
This commit is contained in:
parent
a6b4ed789c
commit
b69c132a0a
@ -13,9 +13,6 @@ jobs:
|
||||
runs-on: linux-amd64
|
||||
container:
|
||||
image: alpine:latest
|
||||
outputs:
|
||||
release_tag: ${{ steps.bump.outputs.release_tag }}
|
||||
tag_created: ${{ steps.bump.outputs.tag_created }}
|
||||
steps:
|
||||
- name: Bump patch version and create tag
|
||||
id: bump
|
||||
@ -43,7 +40,6 @@ jobs:
|
||||
fi
|
||||
|
||||
echo "Latest tag: ${LATEST:-none} → Next: $NEXT"
|
||||
echo "release_tag=$NEXT" >> "$GITHUB_OUTPUT"
|
||||
|
||||
# Create and push the tag via git so the tag push event triggers release.yml.
|
||||
git init
|
||||
@ -55,19 +51,16 @@ jobs:
|
||||
|
||||
if git ls-remote --exit-code --tags origin "refs/tags/$NEXT" >/dev/null 2>&1; then
|
||||
echo "Tag $NEXT already exists; skipping."
|
||||
echo "tag_created=false" >> "$GITHUB_OUTPUT"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
git tag -a "$NEXT" -m "Release $NEXT"
|
||||
git push origin "refs/tags/$NEXT"
|
||||
echo "tag_created=true" >> "$GITHUB_OUTPUT"
|
||||
|
||||
echo "Tag $NEXT pushed successfully"
|
||||
|
||||
build-linux-amd64:
|
||||
needs: autotag
|
||||
if: needs.autotag.outputs.tag_created == 'true'
|
||||
runs-on: linux-amd64
|
||||
container:
|
||||
image: rust:1.88-slim
|
||||
@ -99,7 +92,14 @@ jobs:
|
||||
run: |
|
||||
set -eu
|
||||
API="http://172.0.0.29:3000/api/v1/repos/$GITHUB_REPOSITORY"
|
||||
TAG="${{ needs.autotag.outputs.release_tag }}"
|
||||
TAG=$(curl -s "$API/tags?limit=50" \
|
||||
-H "Authorization: token $RELEASE_TOKEN" | \
|
||||
jq -r '.[].name' | grep -E '^v[0-9]+\.[0-9]+\.[0-9]+$' | \
|
||||
sort -V | tail -1 || true)
|
||||
if [ -z "$TAG" ]; then
|
||||
echo "ERROR: Could not resolve release tag from repository tags."
|
||||
exit 1
|
||||
fi
|
||||
echo "Creating release for $TAG..."
|
||||
curl -sf -X POST "$API/releases" \
|
||||
-H "Authorization: token $RELEASE_TOKEN" \
|
||||
@ -150,7 +150,6 @@ PY
|
||||
|
||||
build-windows-amd64:
|
||||
needs: autotag
|
||||
if: needs.autotag.outputs.tag_created == 'true'
|
||||
runs-on: linux-amd64
|
||||
container:
|
||||
image: rust:1.88-slim
|
||||
@ -186,7 +185,14 @@ PY
|
||||
run: |
|
||||
set -eu
|
||||
API="http://172.0.0.29:3000/api/v1/repos/$GITHUB_REPOSITORY"
|
||||
TAG="${{ needs.autotag.outputs.release_tag }}"
|
||||
TAG=$(curl -s "$API/tags?limit=50" \
|
||||
-H "Authorization: token $RELEASE_TOKEN" | \
|
||||
jq -r '.[].name' | grep -E '^v[0-9]+\.[0-9]+\.[0-9]+$' | \
|
||||
sort -V | tail -1 || true)
|
||||
if [ -z "$TAG" ]; then
|
||||
echo "ERROR: Could not resolve release tag from repository tags."
|
||||
exit 1
|
||||
fi
|
||||
echo "Creating release for $TAG..."
|
||||
curl -sf -X POST "$API/releases" \
|
||||
-H "Authorization: token $RELEASE_TOKEN" \
|
||||
@ -237,7 +243,6 @@ PY
|
||||
|
||||
build-macos-arm64:
|
||||
needs: autotag
|
||||
if: needs.autotag.outputs.tag_created == 'true'
|
||||
runs-on: macos-arm64
|
||||
steps:
|
||||
- name: Checkout
|
||||
@ -270,7 +275,14 @@ PY
|
||||
run: |
|
||||
set -eu
|
||||
API="http://172.0.0.29:3000/api/v1/repos/$GITHUB_REPOSITORY"
|
||||
TAG="${{ needs.autotag.outputs.release_tag }}"
|
||||
TAG=$(curl -s "$API/tags?limit=50" \
|
||||
-H "Authorization: token $RELEASE_TOKEN" | \
|
||||
jq -r '.[].name' | grep -E '^v[0-9]+\.[0-9]+\.[0-9]+$' | \
|
||||
sort -V | tail -1 || true)
|
||||
if [ -z "$TAG" ]; then
|
||||
echo "ERROR: Could not resolve release tag from repository tags."
|
||||
exit 1
|
||||
fi
|
||||
echo "Creating release for $TAG..."
|
||||
curl -sf -X POST "$API/releases" \
|
||||
-H "Authorization: token $RELEASE_TOKEN" \
|
||||
@ -320,7 +332,6 @@ PY
|
||||
|
||||
build-linux-arm64:
|
||||
needs: autotag
|
||||
if: needs.autotag.outputs.tag_created == 'true'
|
||||
runs-on: linux-arm64
|
||||
container:
|
||||
image: rust:1.88-slim
|
||||
@ -351,7 +362,14 @@ PY
|
||||
run: |
|
||||
set -eu
|
||||
API="http://172.0.0.29:3000/api/v1/repos/$GITHUB_REPOSITORY"
|
||||
TAG="${{ needs.autotag.outputs.release_tag }}"
|
||||
TAG=$(curl -s "$API/tags?limit=50" \
|
||||
-H "Authorization: token $RELEASE_TOKEN" | \
|
||||
jq -r '.[].name' | grep -E '^v[0-9]+\.[0-9]+\.[0-9]+$' | \
|
||||
sort -V | tail -1 || true)
|
||||
if [ -z "$TAG" ]; then
|
||||
echo "ERROR: Could not resolve release tag from repository tags."
|
||||
exit 1
|
||||
fi
|
||||
echo "Creating release for $TAG..."
|
||||
curl -sf -X POST "$API/releases" \
|
||||
-H "Authorization: token $RELEASE_TOKEN" \
|
||||
|
||||
@ -23,7 +23,7 @@ describe("auto-tag workflow release triggering", () => {
|
||||
expect(workflow).toContain("build-macos-arm64:");
|
||||
expect(workflow).toContain("build-linux-arm64:");
|
||||
expect(workflow).toContain("needs: autotag");
|
||||
expect(workflow).toContain("needs.autotag.outputs.tag_created == 'true'");
|
||||
expect(workflow).toContain("TAG=\"${{ needs.autotag.outputs.release_tag }}\"");
|
||||
expect(workflow).toContain("TAG=$(curl -s \"$API/tags?limit=50\"");
|
||||
expect(workflow).toContain("ERROR: Could not resolve release tag from repository tags.");
|
||||
});
|
||||
});
|
||||
|
||||
Loading…
Reference in New Issue
Block a user