Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: trim tag name to obtain version #885

Merged
merged 12 commits into from
Jan 31, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .github/workflows/release-please.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,4 @@ jobs:
uses: ./.github/workflows/release.yml
with:
tag: ${{ needs.release-please.outputs.tag_name }}
version: ${{ (needs.release-please.outputs.tag_name && format('{0}.{1}.{2}', needs.release-please.outputs.major, needs.release-please.outputs.minor, needs.release-please.outputs.patch)) || ''}}
secrets: inherit
29 changes: 17 additions & 12 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,6 @@ on:
type: string
required: true
default: ""
version:
description: "Version for the release."
type: string
required: true
default: ""

env:
CARGO_TERM_COLOR: always
Expand All @@ -43,21 +38,31 @@ jobs:
id: release_info
run: |
echo "nightly: $IS_NIGHTLY"
if [ $IS_NIGHTLY == "true" ]; then
TAG="${{ inputs.tag || format('nightly-{0}', github.sha) }}"
VERSION="${{ inputs.version || 'nightly' }}"
if [ $IS_NIGHTLY == "true" ]; then
if [ "${{inputs.tag}}" ]; then
TAG="${{ inputs.tag }}"
VERSION="${TAG#foundry-zksync-}"
else
TAG="${{ format('nightly-{0}', github.sha) }}"
VERSION=nightly
fi

echo "tag_name=${TAG}" >> $GITHUB_OUTPUT
echo "version_name=${VERSION}" >> $GITHUB_OUTPUT
echo "release_name=foundry-zksync Nightly ($(date '+%Y-%m-%d'))" >> $GITHUB_OUTPUT
echo "prerelease=true" >> $GITHUB_OUTPUT
else
TAG="${{ inputs.tag || format('stable-{0}', github.sha) }}"
VERSION="${{ inputs.version || 'stable' }}"
if [ "${{inputs.tag}}" ]; then
TAG="${{ inputs.tag }}"
VERSION="${TAG#foundry-zksync-}"
else
TAG="${{ format('stable-{0}', github.sha) }}"
VERSION=stable
fi

echo "tag_name=${TAG}" >> $GITHUB_OUTPUT
echo "version_name=v${VERSION}" >> $GITHUB_OUTPUT
echo "release_name=foundry-zksync v${VERSION}" >> $GITHUB_OUTPUT
echo "version_name=${VERSION}" >> $GITHUB_OUTPUT
echo "release_name=foundry-zksync ${VERSION}" >> $GITHUB_OUTPUT
echo "prerelease=false" >> $GITHUB_OUTPUT
fi

Expand Down