@@ -3,41 +3,31 @@ image: ubuntu-latest
33requires :
44 - release_build
55
6- steps :
7- - name : Checkout repository
8- uses : actions/checkout@v4
9- with :
10- fetch-depth : 0
11- fetch-tags : true
6+ checkout :
7+ fetch-depth : 0
8+ fetch-tags : true
129
10+ steps :
1311 - name : Download artifacts
1412 uses : actions/download-artifact@v4
1513 with :
1614 path : artifacts
1715
18- - id : version
19- name : Get version from Cargo.toml
16+ - name : Get version from Cargo.toml
2017 run : |
2118 VERSION=$(grep -E '^version = ' Cargo.toml | head -1 | sed 's/version = "\(.*\)"/\1/')
22- {
23- echo "version=$VERSION"
24- } >> "$GITHUB_OUTPUT"
25-
2619 if [ "${{ github.event_name }}" = "push" ]; then
2720 TAG="${GITHUB_REF#refs/tags/}"
2821 EXPECTED_TAG="v$VERSION"
2922 if [ "$TAG" != "$EXPECTED_TAG" ]; then
3023 echo "Error: Tag $TAG doesn't match expected $EXPECTED_TAG from Cargo.toml" >&2
3124 exit 1
3225 fi
33- {
34- echo "tag=$TAG"
35- } >> "$GITHUB_OUTPUT"
26+ echo "RELEASE_TAG=$TAG" >> "$GITHUB_ENV"
3627 else
37- {
38- echo "tag=v$VERSION"
39- } >> "$GITHUB_OUTPUT"
28+ echo "RELEASE_TAG=v$VERSION" >> "$GITHUB_ENV"
4029 fi
30+ echo "RELEASE_VERSION=$VERSION" >> "$GITHUB_ENV"
4131
4232 - run :
4333 name : Generate checksums
@@ -69,20 +59,20 @@ steps:
6959 curl -fsSL https://docspring.github.io/cigen/install.sh | sh
7060
7161 ### Direct downloads
72- - macOS (Intel): https://github.com/${{ github.repository }}/releases/download/${{ steps.version.outputs.tag }}/cigen-macos-amd64.tar.gz
73- - macOS (Apple Silicon): https://github.com/${{ github.repository }}/releases/download/${{ steps.version.outputs.tag }}/cigen-macos-arm64.tar.gz
74- - Linux (x86_64): https://github.com/${{ github.repository }}/releases/download/${{ steps.version.outputs.tag }}/cigen-linux-amd64.tar.gz
75- - Linux (ARM64): https://github.com/${{ github.repository }}/releases/download/${{ steps.version.outputs.tag }}/cigen-linux-arm64.tar.gz
62+ - macOS (Intel): https://github.com/${{ github.repository }}/releases/download/${{ env.RELEASE_TAG }}/cigen-macos-amd64.tar.gz
63+ - macOS (Apple Silicon): https://github.com/${{ github.repository }}/releases/download/${{ env.RELEASE_TAG }}/cigen-macos-arm64.tar.gz
64+ - Linux (x86_64): https://github.com/${{ github.repository }}/releases/download/${{ env.RELEASE_TAG }}/cigen-linux-amd64.tar.gz
65+ - Linux (ARM64): https://github.com/${{ github.repository }}/releases/download/${{ env.RELEASE_TAG }}/cigen-linux-arm64.tar.gz
7666 EOF
7767
7868 - name : Create GitHub Release
7969 uses : softprops/action-gh-release@v2
8070 with :
81- tag_name : ${{ steps.version.outputs.tag }}
82- name : CIGen v${{ steps.version.outputs.version }}
71+ tag_name : ${{ env.RELEASE_TAG }}
72+ name : CIGen v${{ env.RELEASE_VERSION }}
8373 body_path : changelog.md
8474 draft : false
85- prerelease : ${{ contains(steps.version.outputs.tag , '-') }}
75+ prerelease : ${{ contains(env.RELEASE_TAG , '-') }}
8676 files : |
8777 artifacts/**/*.tar.gz
8878 artifacts/**/*.sha256
0 commit comments