Skip to content

Commit 053edbf

Browse files
authored
Update release.yml
1 parent 53f6167 commit 053edbf

File tree

1 file changed

+35
-67
lines changed

1 file changed

+35
-67
lines changed

.github/workflows/release.yml

Lines changed: 35 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
1-
name: Release
1+
name: release
22

33
on:
4+
push:
5+
tags:
6+
- "stable"
7+
- "rc"
8+
- "v*.*.*"
49
workflow_dispatch:
510
inputs:
6-
isNightly:
11+
is_nightly:
712
description: "Is this a nightly version or a release - Y or N"
813
type: string
914
required: true
@@ -16,18 +21,17 @@ on:
1621

1722
env:
1823
CARGO_TERM_COLOR: always
19-
IS_NIGHTLY: ${{ inputs.isNightly == 'Y' }}
24+
IS_NIGHTLY: ${{ inputs.is_nightly == 'Y' }}
2025
PROFILE: maxperf
2126
STABLE_VERSION: ${{ inputs.version }}
22-
TAG_NAME: stable
2327

2428
jobs:
2529
prepare:
2630
name: Prepare release
2731
runs-on: ubuntu-latest
2832
timeout-minutes: 30
2933
outputs:
30-
tag_name: ${{ env.TAG_NAME }}
34+
tag_name: ${{ steps.release_info.outputs.tag_name }}
3135
release_name: ${{ steps.release_info.outputs.release_name }}
3236
changelog: ${{ steps.build_changelog.outputs.changelog }}
3337
steps:
@@ -42,8 +46,8 @@ jobs:
4246
echo "tag_name=nightly-${GITHUB_SHA}" >> $GITHUB_OUTPUT
4347
echo "release_name=Nightly ($(date '+%Y-%m-%d'))" >> $GITHUB_OUTPUT
4448
else
45-
echo "tag_name=${{ env.TAG_NAME }}" >> $GITHUB_OUTPUT
46-
echo "release_name=${{ env.TAG_NAME }}" >> $GITHUB_OUTPUT
49+
echo "tag_name=${GITHUB_REF_NAME}" >> $GITHUB_OUTPUT
50+
echo "release_name=${GITHUB_REF_NAME}" >> $GITHUB_OUTPUT
4751
fi
4852
4953
# Creates a `nightly-SHA` tag for this specific nightly
@@ -54,7 +58,7 @@ jobs:
5458
if: ${{ env.IS_NIGHTLY == 'true' }}
5559
uses: actions/github-script@v7
5660
env:
57-
TAG_NAME: ${{ env.TAG_NAME }}
61+
TAG_NAME: ${{ steps.release_info.outputs.tag_name }}
5862
with:
5963
script: |
6064
const createTag = require('./.github/scripts/create-tag.js')
@@ -66,7 +70,7 @@ jobs:
6670
with:
6771
configuration: "./.github/changelog.json"
6872
fromTag: ${{ env.IS_NIGHTLY == 'true' && 'nightly' || env.STABLE_VERSION }}
69-
toTag: ${{ env.TAG_NAME }}
73+
toTag: ${{ steps.release_info.outputs.tag_name }}
7074
env:
7175
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
7276

@@ -92,6 +96,21 @@ jobs:
9296
svm_target_platform: linux-amd64
9397
platform: linux
9498
arch: amd64
99+
- runner: macos-14
100+
target: x86_64-apple-darwin
101+
svm_target_platform: macosx-amd64
102+
platform: darwin
103+
arch: amd64
104+
- runner: macos-14
105+
target: aarch64-apple-darwin
106+
svm_target_platform: macosx-aarch64
107+
platform: darwin
108+
arch: arm64
109+
- runner: windows-2022
110+
target: x86_64-pc-windows-msvc
111+
svm_target_platform: windows-amd64
112+
platform: win32
113+
arch: amd64
95114
steps:
96115
- uses: actions/checkout@v4
97116
- uses: dtolnay/rust-toolchain@stable
@@ -125,17 +144,18 @@ jobs:
125144
shell: bash
126145
run: |
127146
set -eo pipefail
147+
flags=(--target $TARGET --profile $PROFILE --bins
148+
--no-default-features --features aws-kms,cli,asm-keccak)
128149
129-
ext=""
130-
[[ "$TARGET" == *windows* ]] && ext=".exe"
131-
132-
flags="--target $TARGET --profile $PROFILE --bins --no-default-features --features aws-kms,cli,asm-keccak"
150+
# `jemalloc` is not fully supported on MSVC or aarch64 Linux.
133151
if [[ "$TARGET" != *msvc* && "$TARGET" != "aarch64-unknown-linux-gnu" ]]; then
134-
flags="$flags --features jemalloc"
152+
flags+=(--features jemalloc)
135153
fi
136154
155+
[[ "$TARGET" == *windows* ]] && ext=".exe"
156+
137157
if [[ "$TARGET" == "x86_64-unknown-linux-musl" ]]; then
138-
docker run -v $PWD:/opt/revive messense/rust-musl-cross:x86_64-musl /bin/bash -c "
158+
docker run -v $PWD:/opt/revive messense/rust-musl-cross@sha256:5afc91a4f7da8a14a6c688ebf49fef9b9ec30f28fd827f2cf7e7c4d6c31bd10a:x86_64-musl /bin/bash -c "
139159
cd /opt/revive
140160
rustup target add x86_64-unknown-linux-musl
141161
cargo build $flags
@@ -228,58 +248,6 @@ jobs:
228248
files: |
229249
${{ steps.artifacts.outputs.file_name }}
230250
${{ steps.man.outputs.foundry_man }}
231-
232-
- name: Test Foundryup Musl Installation
233-
shell: bash
234-
env:
235-
TARGET: ${{ matrix.target }}
236-
run: |
237-
if [[ "$TARGET" == "x86_64-unknown-linux-musl" ]]; then
238-
docker run -v $PWD:/opt/revive messense/rust-musl-cross:x86_64-musl /bin/bash -c "
239-
uname -s
240-
uname -m
241-
242-
# Install foundryup
243-
curl -L https://raw.githubusercontent.com/soul022/foundry-revive-testing/refs/heads/master/foundryup/install | bash
244-
245-
# Detect OS Type
246-
OS_TYPE=$(uname -s)
247-
if [[ "$OS_TYPE" == "Linux" ]]; then
248-
FOUNDARY_BIN_PATH="$HOME/.config/.foundry/bin"
249-
source "$HOME/.bashrc" || true # Load foundryup path if available
250-
elif [[ "$OS_TYPE" == "Darwin" ]]; then
251-
FOUNDARY_BIN_PATH="$HOME/.config/.foundry/bin"
252-
[[ -f "$HOME/.zshrc" ]] && source "$HOME/.zshrc" || true # Fix MacOS path issues
253-
[[ -f "$HOME/.bash_profile" ]] && source "$HOME/.bash_profile" || true
254-
elif [[ "$OS_TYPE" == "MINGW"* || "$OS_TYPE" == "CYGWIN"* || "$OS_TYPE" == "MSYS"* ]]; then
255-
FOUNDARY_BIN_PATH="$USERPROFILE/.foundry/bin"
256-
export PATH="$FOUNDARY_BIN_PATH:$PATH" # Manually add it for Windows
257-
else
258-
echo "❌ Unsupported OS: $OS_TYPE"
259-
exit 1
260-
fi
261-
262-
# Ensure PATH is updated
263-
echo "$FOUNDARY_BIN_PATH" >> $GITHUB_PATH
264-
export PATH="$FOUNDARY_BIN_PATH:$PATH"
265-
266-
# Determine installation version (stable or nightly)
267-
if [[ "${{ env.IS_NIGHTLY }}" == "true" ]]; then
268-
INSTALL_VERSION="nightly"
269-
else
270-
INSTALL_VERSION="stable"
271-
fi
272-
273-
# Run Foundry installation
274-
foundryup --install "$INSTALL_VERSION" || echo "⚠️ Foundryup installation failed!"
275-
276-
# Verify installation
277-
which forge || echo "❌ forge binary not found in PATH"
278-
which cast || echo "❌ cast binary not found in PATH"
279-
280-
forge --version || echo "❌ forge command not available after install"
281-
cast --version || echo "❌ cast command not available after install"
282-
"
283251
284252
cleanup:
285253
name: Release cleanup

0 commit comments

Comments
 (0)