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
af4a07cffa
commit
0427d7808b
@ -13,9 +13,6 @@ jobs:
|
|||||||
runs-on: linux-amd64
|
runs-on: linux-amd64
|
||||||
container:
|
container:
|
||||||
image: alpine:latest
|
image: alpine:latest
|
||||||
outputs:
|
|
||||||
release_tag: ${{ steps.bump.outputs.release_tag }}
|
|
||||||
tag_created: ${{ steps.bump.outputs.tag_created }}
|
|
||||||
steps:
|
steps:
|
||||||
- name: Bump patch version and create tag
|
- name: Bump patch version and create tag
|
||||||
id: bump
|
id: bump
|
||||||
@ -43,7 +40,6 @@ jobs:
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Latest tag: ${LATEST:-none} → Next: $NEXT"
|
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.
|
# Create and push the tag via git so the tag push event triggers release.yml.
|
||||||
git init
|
git init
|
||||||
@ -55,19 +51,16 @@ jobs:
|
|||||||
|
|
||||||
if git ls-remote --exit-code --tags origin "refs/tags/$NEXT" >/dev/null 2>&1; then
|
if git ls-remote --exit-code --tags origin "refs/tags/$NEXT" >/dev/null 2>&1; then
|
||||||
echo "Tag $NEXT already exists; skipping."
|
echo "Tag $NEXT already exists; skipping."
|
||||||
echo "tag_created=false" >> "$GITHUB_OUTPUT"
|
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
git tag -a "$NEXT" -m "Release $NEXT"
|
git tag -a "$NEXT" -m "Release $NEXT"
|
||||||
git push origin "refs/tags/$NEXT"
|
git push origin "refs/tags/$NEXT"
|
||||||
echo "tag_created=true" >> "$GITHUB_OUTPUT"
|
|
||||||
|
|
||||||
echo "Tag $NEXT pushed successfully"
|
echo "Tag $NEXT pushed successfully"
|
||||||
|
|
||||||
build-linux-amd64:
|
build-linux-amd64:
|
||||||
needs: autotag
|
needs: autotag
|
||||||
if: needs.autotag.outputs.tag_created == 'true'
|
|
||||||
runs-on: linux-amd64
|
runs-on: linux-amd64
|
||||||
container:
|
container:
|
||||||
image: rust:1.88-slim
|
image: rust:1.88-slim
|
||||||
@ -99,7 +92,14 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
set -eu
|
set -eu
|
||||||
API="http://172.0.0.29:3000/api/v1/repos/$GITHUB_REPOSITORY"
|
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..."
|
echo "Creating release for $TAG..."
|
||||||
curl -sf -X POST "$API/releases" \
|
curl -sf -X POST "$API/releases" \
|
||||||
-H "Authorization: token $RELEASE_TOKEN" \
|
-H "Authorization: token $RELEASE_TOKEN" \
|
||||||
@ -150,7 +150,6 @@ PY
|
|||||||
|
|
||||||
build-windows-amd64:
|
build-windows-amd64:
|
||||||
needs: autotag
|
needs: autotag
|
||||||
if: needs.autotag.outputs.tag_created == 'true'
|
|
||||||
runs-on: linux-amd64
|
runs-on: linux-amd64
|
||||||
container:
|
container:
|
||||||
image: rust:1.88-slim
|
image: rust:1.88-slim
|
||||||
@ -186,7 +185,14 @@ PY
|
|||||||
run: |
|
run: |
|
||||||
set -eu
|
set -eu
|
||||||
API="http://172.0.0.29:3000/api/v1/repos/$GITHUB_REPOSITORY"
|
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..."
|
echo "Creating release for $TAG..."
|
||||||
curl -sf -X POST "$API/releases" \
|
curl -sf -X POST "$API/releases" \
|
||||||
-H "Authorization: token $RELEASE_TOKEN" \
|
-H "Authorization: token $RELEASE_TOKEN" \
|
||||||
@ -237,7 +243,6 @@ PY
|
|||||||
|
|
||||||
build-macos-arm64:
|
build-macos-arm64:
|
||||||
needs: autotag
|
needs: autotag
|
||||||
if: needs.autotag.outputs.tag_created == 'true'
|
|
||||||
runs-on: macos-arm64
|
runs-on: macos-arm64
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
@ -270,7 +275,14 @@ PY
|
|||||||
run: |
|
run: |
|
||||||
set -eu
|
set -eu
|
||||||
API="http://172.0.0.29:3000/api/v1/repos/$GITHUB_REPOSITORY"
|
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..."
|
echo "Creating release for $TAG..."
|
||||||
curl -sf -X POST "$API/releases" \
|
curl -sf -X POST "$API/releases" \
|
||||||
-H "Authorization: token $RELEASE_TOKEN" \
|
-H "Authorization: token $RELEASE_TOKEN" \
|
||||||
@ -320,7 +332,6 @@ PY
|
|||||||
|
|
||||||
build-linux-arm64:
|
build-linux-arm64:
|
||||||
needs: autotag
|
needs: autotag
|
||||||
if: needs.autotag.outputs.tag_created == 'true'
|
|
||||||
runs-on: linux-arm64
|
runs-on: linux-arm64
|
||||||
container:
|
container:
|
||||||
image: rust:1.88-slim
|
image: rust:1.88-slim
|
||||||
@ -351,7 +362,14 @@ PY
|
|||||||
run: |
|
run: |
|
||||||
set -eu
|
set -eu
|
||||||
API="http://172.0.0.29:3000/api/v1/repos/$GITHUB_REPOSITORY"
|
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..."
|
echo "Creating release for $TAG..."
|
||||||
curl -sf -X POST "$API/releases" \
|
curl -sf -X POST "$API/releases" \
|
||||||
-H "Authorization: token $RELEASE_TOKEN" \
|
-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-macos-arm64:");
|
||||||
expect(workflow).toContain("build-linux-arm64:");
|
expect(workflow).toContain("build-linux-arm64:");
|
||||||
expect(workflow).toContain("needs: autotag");
|
expect(workflow).toContain("needs: autotag");
|
||||||
expect(workflow).toContain("needs.autotag.outputs.tag_created == 'true'");
|
expect(workflow).toContain("TAG=$(curl -s \"$API/tags?limit=50\"");
|
||||||
expect(workflow).toContain("TAG=\"${{ needs.autotag.outputs.release_tag }}\"");
|
expect(workflow).toContain("ERROR: Could not resolve release tag from repository tags.");
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user