fix(ci): use stable auto-tag job outputs for release fanout
Rename the auto-tag job id to a non-hyphenated identifier and update needs/output references so dependent release jobs evaluate conditions correctly and reliably run after tagging. Made-with: Cursor
This commit is contained in:
parent
93ead1362f
commit
a6b4ed789c
@ -9,7 +9,7 @@ on:
|
|||||||
- master
|
- master
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
auto-tag:
|
autotag:
|
||||||
runs-on: linux-amd64
|
runs-on: linux-amd64
|
||||||
container:
|
container:
|
||||||
image: alpine:latest
|
image: alpine:latest
|
||||||
@ -66,8 +66,8 @@ jobs:
|
|||||||
echo "Tag $NEXT pushed successfully"
|
echo "Tag $NEXT pushed successfully"
|
||||||
|
|
||||||
build-linux-amd64:
|
build-linux-amd64:
|
||||||
needs: auto-tag
|
needs: autotag
|
||||||
if: needs.auto-tag.outputs.tag_created == 'true'
|
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 +99,7 @@ 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.auto-tag.outputs.release_tag }}"
|
TAG="${{ needs.autotag.outputs.release_tag }}"
|
||||||
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" \
|
||||||
@ -149,8 +149,8 @@ PY
|
|||||||
done
|
done
|
||||||
|
|
||||||
build-windows-amd64:
|
build-windows-amd64:
|
||||||
needs: auto-tag
|
needs: autotag
|
||||||
if: needs.auto-tag.outputs.tag_created == 'true'
|
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 +186,7 @@ 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.auto-tag.outputs.release_tag }}"
|
TAG="${{ needs.autotag.outputs.release_tag }}"
|
||||||
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" \
|
||||||
@ -236,8 +236,8 @@ PY
|
|||||||
done
|
done
|
||||||
|
|
||||||
build-macos-arm64:
|
build-macos-arm64:
|
||||||
needs: auto-tag
|
needs: autotag
|
||||||
if: needs.auto-tag.outputs.tag_created == 'true'
|
if: needs.autotag.outputs.tag_created == 'true'
|
||||||
runs-on: macos-arm64
|
runs-on: macos-arm64
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
@ -270,7 +270,7 @@ 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.auto-tag.outputs.release_tag }}"
|
TAG="${{ needs.autotag.outputs.release_tag }}"
|
||||||
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" \
|
||||||
@ -319,8 +319,8 @@ PY
|
|||||||
done
|
done
|
||||||
|
|
||||||
build-linux-arm64:
|
build-linux-arm64:
|
||||||
needs: auto-tag
|
needs: autotag
|
||||||
if: needs.auto-tag.outputs.tag_created == 'true'
|
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 +351,7 @@ 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.auto-tag.outputs.release_tag }}"
|
TAG="${{ needs.autotag.outputs.release_tag }}"
|
||||||
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" \
|
||||||
|
|||||||
@ -22,8 +22,8 @@ describe("auto-tag workflow release triggering", () => {
|
|||||||
expect(workflow).toContain("build-windows-amd64:");
|
expect(workflow).toContain("build-windows-amd64:");
|
||||||
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: auto-tag");
|
expect(workflow).toContain("needs: autotag");
|
||||||
expect(workflow).toContain("needs.auto-tag.outputs.tag_created == 'true'");
|
expect(workflow).toContain("needs.autotag.outputs.tag_created == 'true'");
|
||||||
expect(workflow).toContain("TAG=\"${{ needs.auto-tag.outputs.release_tag }}\"");
|
expect(workflow).toContain("TAG=\"${{ needs.autotag.outputs.release_tag }}\"");
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user