88 workflow_call :
99 inputs :
1010 tag :
11- description : " Tag to use for the release."
11+ description : " Tag to use for the release (<component>-v<version>)."
12+ type : string
13+ required : true
14+ default : " "
15+ version :
16+ description : " Version for the release."
1217 type : string
1318 required : true
1419 default : " "
2429 timeout-minutes : 30
2530 outputs :
2631 tag_name : ${{ steps.release_info.outputs.tag_name }}
32+ version_name : ${{ steps.release_info.outputs.version_name }}
2733 release_name : ${{ steps.release_info.outputs.release_name }}
2834 prerelease : ${{ steps.release_info.outputs.prerelease }}
2935 changelog : ${{ steps.build_changelog.outputs.changelog || '' }}
@@ -36,21 +42,37 @@ jobs:
3642 - name : Compute release name and tag
3743 id : release_info
3844 run : |
39- if [[ $IS_NIGHTLY ]]; then
40- echo "tag_name=nightly-${GITHUB_SHA}" >> $GITHUB_OUTPUT
45+ echo "nightly: $IS_NIGHTLY"
46+ if [ $IS_NIGHTLY == "true" ]; then
47+ TAG="${{ inputs.tag || format('nightly-{0}', github.sha) }}"
48+ VERSION="${{ inputs.version || 'nightly' }}"
49+
50+ echo "tag_name=${TAG}" >> $GITHUB_OUTPUT
51+ echo "version_name=${VERSION}" >> $GITHUB_OUTPUT
4152 echo "release_name=foundry-zksync Nightly ($(date '+%Y-%m-%d'))" >> $GITHUB_OUTPUT
4253 echo "prerelease=true" >> $GITHUB_OUTPUT
4354 else
44- echo "tag_name=${GITHUB_REF_NAME}" >> $GITHUB_OUTPUT
45- echo "release_name=foundry-zksync@${GITHUB_REF_NAME}" >> $GITHUB_OUTPUT
55+ TAG="${{ inputs.tag || format('stable-{0}', github.sha) }}"
56+ VERSION="${{ inputs.version || 'stable' }}"
57+
58+ echo "tag_name=${TAG}" >> $GITHUB_OUTPUT
59+ echo "version_name=v${VERSION}" >> $GITHUB_OUTPUT
60+ echo "release_name=foundry-zksync v${VERSION}" >> $GITHUB_OUTPUT
4661 echo "prerelease=false" >> $GITHUB_OUTPUT
4762 fi
63+
64+ - name : Print release info
65+ run : |
66+ echo tag_name: "${{ steps.release_info.outputs.tag_name }}"
67+ echo version_name: "${{ steps.release_info.outputs.version_name }}"
68+ echo release_name: "${{ steps.release_info.outputs.release_name }}"
69+ echo prerelease: "${{ steps.release_info.outputs.prerelease }}"
4870
4971 # Creates a `nightly-SHA` tag for this specific nightly
5072 # This tag is used for this specific nightly version's release
5173 # which allows users to roll back. It is also used to build
5274 # the changelog.
53- - name : Create build-specific nightly tag
75+ - name : Create build-specific tag (nightly)
5476 if : ${{ env.IS_NIGHTLY == 'true' }}
5577 uses : actions/github-script@v7
5678 env :
6082 const createTag = require('./.github/scripts/create-tag.js')
6183 await createTag({ github, context }, process.env.TAG_NAME)
6284
63- - name : Build changelog
85+ - name : Build changelog (nightly)
6486 if : ${{ env.IS_NIGHTLY == 'true' }}
6587 id : build_changelog
6688 uses : mikepenz/release-changelog-builder-action@v4
@@ -163,17 +185,17 @@ jobs:
163185 PLATFORM_NAME : ${{ matrix.platform }}
164186 TARGET : ${{ matrix.target }}
165187 ARCH : ${{ matrix.arch }}
166- VERSION_NAME : ${{ (env.IS_NIGHTLY && 'nightly') || needs.prepare.outputs.tag_name }}
188+ VERSION_NAME : ${{ needs.prepare.outputs.version_name }}
167189 shell : bash
168190 run : |
169191 if [ "$PLATFORM_NAME" == "linux" ]; then
170- tar -czvf "foundry_ ${VERSION_NAME}_${PLATFORM_NAME}_${ARCH}.tar.gz" -C ./target/${TARGET}/release forge cast
171- echo "file_name=foundry_ ${VERSION_NAME}_${PLATFORM_NAME}_${ARCH}.tar.gz" >> $GITHUB_OUTPUT
192+ tar -czvf "foundry_zksync_ ${VERSION_NAME}_${PLATFORM_NAME}_${ARCH}.tar.gz" -C ./target/${TARGET}/release forge cast
193+ echo "file_name=foundry_zksync_ ${VERSION_NAME}_${PLATFORM_NAME}_${ARCH}.tar.gz" >> $GITHUB_OUTPUT
172194 elif [ "$PLATFORM_NAME" == "darwin" ]; then
173195 # We need to use gtar here otherwise the archive is corrupt.
174196 # See: https://github.com/actions/virtual-environments/issues/2619
175- gtar -czvf "foundry_ ${VERSION_NAME}_${PLATFORM_NAME}_${ARCH}.tar.gz" -C ./target/${TARGET}/release forge cast
176- echo "file_name=foundry_ ${VERSION_NAME}_${PLATFORM_NAME}_${ARCH}.tar.gz" >> $GITHUB_OUTPUT
197+ gtar -czvf "foundry_zksync_ ${VERSION_NAME}_${PLATFORM_NAME}_${ARCH}.tar.gz" -C ./target/${TARGET}/release forge cast
198+ echo "file_name=foundry_zksync_ ${VERSION_NAME}_${PLATFORM_NAME}_${ARCH}.tar.gz" >> $GITHUB_OUTPUT
177199 fi
178200
179201 - name : Build man page
@@ -182,7 +204,7 @@ jobs:
182204 env :
183205 PLATFORM_NAME : ${{ matrix.platform }}
184206 TARGET : ${{ matrix.target }}
185- VERSION_NAME : ${{ (env.IS_NIGHTLY == 'true' && 'nightly') || needs.prepare.outputs.tag_name }}
207+ VERSION_NAME : ${{ needs.prepare.outputs.version_name }}
186208 shell : bash
187209 run : |
188210 sudo apt-get -y install help2man
0 commit comments