Skip to content

Commit 964509d

Browse files
authored
Update release-musl.yml
1 parent 63135a5 commit 964509d

File tree

1 file changed

+31
-262
lines changed

1 file changed

+31
-262
lines changed

.github/workflows/release-musl.yml

Lines changed: 31 additions & 262 deletions
Original file line numberDiff line numberDiff line change
@@ -1,271 +1,40 @@
11
name: ReleaseMusl
22

33
on:
4-
workflow_dispatch:
5-
inputs:
6-
isNightly:
7-
description: "Is this a nightly version or a release - Y or N"
8-
type: string
9-
required: true
10-
default: "Y"
11-
version:
12-
description: "stable version for the build"
13-
type: string
14-
required: false
15-
default: "v0.3.0"
16-
17-
env:
18-
CARGO_TERM_COLOR: always
19-
IS_NIGHTLY: ${{ inputs.isNightly == 'Y' }}
20-
PROFILE: maxperf
21-
STABLE_VERSION: ${{ inputs.version }}
4+
workflow_dispatch: # Manually trigger the workflow
225

236
jobs:
24-
prepare:
25-
name: Prepare release
26-
runs-on: ubuntu-latest
27-
timeout-minutes: 30
28-
outputs:
29-
tag_name: ${{ steps.release_info.outputs.tag_name }}
30-
release_name: ${{ steps.release_info.outputs.release_name }}
31-
changelog: ${{ steps.build_changelog.outputs.changelog }}
32-
steps:
33-
- uses: actions/checkout@v4
34-
with:
35-
fetch-depth: 0
36-
37-
- name: Compute release name and tag
38-
id: release_info
39-
run: |
40-
if [[ ${IS_NIGHTLY} == 'true' ]]; then
41-
echo "tag_name=nightly-${GITHUB_SHA}" >> $GITHUB_OUTPUT
42-
echo "release_name=Nightly ($(date '+%Y-%m-%d'))" >> $GITHUB_OUTPUT
43-
else
44-
echo "tag_name=${GITHUB_REF_NAME}" >> $GITHUB_OUTPUT
45-
echo "release_name=${GITHUB_REF_NAME}" >> $GITHUB_OUTPUT
46-
fi
47-
48-
# Creates a `nightly-SHA` tag for this specific nightly
49-
# This tag is used for this specific nightly version's release
50-
# which allows users to roll back. It is also used to build
51-
# the changelog.
52-
- name: Create build-specific nightly tag
53-
if: ${{ env.IS_NIGHTLY == 'true' }}
54-
uses: actions/github-script@v7
55-
env:
56-
TAG_NAME: ${{ steps.release_info.outputs.tag_name }}
57-
with:
58-
script: |
59-
const createTag = require('./.github/scripts/create-tag.js')
60-
await createTag({ github, context }, process.env.TAG_NAME)
61-
62-
- name: Build changelog
63-
id: build_changelog
64-
uses: mikepenz/release-changelog-builder-action@v4
65-
with:
66-
configuration: "./.github/changelog.json"
67-
fromTag: ${{ env.IS_NIGHTLY == 'true' && 'nightly' || env.STABLE_VERSION }}
68-
toTag: ${{ steps.release_info.outputs.tag_name }}
69-
env:
70-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
71-
72-
release:
73-
permissions:
74-
id-token: write
75-
contents: write
76-
attestations: write
77-
name: ${{ matrix.target }} (${{ matrix.runner }})
78-
runs-on: ${{ matrix.runner }}
79-
timeout-minutes: 240
80-
needs: prepare
81-
strategy:
82-
fail-fast: false
83-
matrix:
84-
include:
85-
# `runner`: GHA runner label
86-
# `target`: Rust build target triple
87-
# `platform` and `arch`: Used in tarball names
88-
# `svm`: target platform to use for the Solc binary: https://github.com/roynalnaruto/svm-rs/blob/84cbe0ac705becabdc13168bae28a45ad2299749/svm-builds/build.rs#L4-L24
89-
- runner: ubuntu-24.04
90-
target: x86_64-unknown-linux-musl
91-
svm_target_platform: linux-amd64
92-
platform: linux
93-
arch: amd64
7+
test-foundryup-windows:
8+
runs-on: windows-latest
949
steps:
95-
- uses: actions/checkout@v4
96-
- uses: dtolnay/rust-toolchain@stable
97-
with:
98-
targets: ${{ matrix.target }}
99-
- uses: Swatinem/rust-cache@v2
100-
with:
101-
key: ${{ matrix.target }}
102-
cache-on-failure: true
103-
104-
- name: Apple M1 setup
105-
if: matrix.target == 'aarch64-apple-darwin'
106-
run: |
107-
echo "SDKROOT=$(xcrun -sdk macosx --show-sdk-path)" >> $GITHUB_ENV
108-
echo "MACOSX_DEPLOYMENT_TARGET=$(xcrun -sdk macosx --show-sdk-platform-version)" >> $GITHUB_ENV
109-
110-
- name: Linux ARM setup musl x86_64
111-
if: matrix.target == 'x86_64-unknown-linux-musl'
112-
run: |
113-
sudo apt-get update -y
114-
sudo apt-get install -y musl-tools
115-
116-
- name: Build binaries
117-
env:
118-
TAG_NAME: ${{ (env.IS_NIGHTLY == 'true' && 'nightly') || needs.prepare.outputs.tag_name }}
119-
SVM_TARGET_PLATFORM: ${{ matrix.svm_target_platform }}
120-
PLATFORM_NAME: ${{ matrix.platform }}
121-
TARGET: ${{ matrix.target }}
122-
PROFILE: ${{ env.PROFILE }}
123-
OUT_DIR: target/${{ matrix.target }}/${{ env.PROFILE }}
124-
shell: bash
125-
run: |
126-
set -eo pipefail
127-
128-
ext=""
129-
[[ "$TARGET" == *windows* ]] && ext=".exe"
10+
- name: Checkout repository
11+
uses: actions/checkout@v4
13012

131-
flags="--target $TARGET --profile $PROFILE --bins --no-default-features --features aws-kms,cli,asm-keccak"
132-
if [[ "$TARGET" != *msvc* && "$TARGET" != "aarch64-unknown-linux-gnu" ]]; then
133-
flags="$flags --features jemalloc"
134-
fi
135-
136-
if [[ "$TARGET" == "x86_64-unknown-linux-musl" ]]; then
137-
docker run -v $PWD:/opt/revive messense/rust-musl-cross:x86_64-musl /bin/bash -c "
138-
cd /opt/revive
139-
rustup target add x86_64-unknown-linux-musl
140-
cargo build $flags
141-
"
142-
sudo chown -R $(id -u):$(id -g) .
143-
else
144-
cargo build $flags
145-
fi
146-
147-
bins=(cast forge)
148-
for name in "${bins[@]}"; do
149-
bin=$OUT_DIR/$name$ext
150-
echo ""
151-
file "$bin" || true
152-
du -h "$bin" || true
153-
ldd "$bin" || true
154-
$bin --version || true
155-
echo "${name}_bin_path=${bin}" >> $GITHUB_ENV
156-
done
157-
158-
- name: Archive binaries
159-
id: artifacts
160-
env:
161-
PLATFORM_NAME: ${{ matrix.platform }}
162-
OUT_DIR: target/${{ matrix.target }}/${{ env.PROFILE }}
163-
VERSION_NAME: ${{ (env.IS_NIGHTLY == 'true' && 'nightly') || needs.prepare.outputs.tag_name }}
164-
ARCH: ${{ matrix.arch }}
165-
shell: bash
166-
run: |
167-
if [ "$PLATFORM_NAME" == "linux" ]; then
168-
tar -czvf "foundry_${VERSION_NAME}_${PLATFORM_NAME}_${ARCH}.tar.gz" -C $OUT_DIR forge cast
169-
echo "file_name=foundry_${VERSION_NAME}_${PLATFORM_NAME}_${ARCH}.tar.gz" >> $GITHUB_OUTPUT
170-
elif [ "$PLATFORM_NAME" == "darwin" ]; then
171-
# We need to use gtar here otherwise the archive is corrupt.
172-
# See: https://github.com/actions/virtual-environments/issues/2619
173-
gtar -czvf "foundry_${VERSION_NAME}_${PLATFORM_NAME}_${ARCH}.tar.gz" -C $OUT_DIR forge cast
174-
echo "file_name=foundry_${VERSION_NAME}_${PLATFORM_NAME}_${ARCH}.tar.gz" >> $GITHUB_OUTPUT
175-
else
176-
cd $OUT_DIR
177-
7z a -tzip "foundry_${VERSION_NAME}_${PLATFORM_NAME}_${ARCH}.zip" forge.exe cast.exe
178-
mv "foundry_${VERSION_NAME}_${PLATFORM_NAME}_${ARCH}.zip" ../../../
179-
echo "file_name=foundry_${VERSION_NAME}_${PLATFORM_NAME}_${ARCH}.zip" >> $GITHUB_OUTPUT
180-
fi
181-
182-
- name: Build man page
183-
id: man
184-
if: matrix.target == 'x86_64-unknown-linux-gnu'
185-
env:
186-
OUT_DIR: target/${{ matrix.target }}/${{ env.PROFILE }}
187-
VERSION_NAME: ${{ (env.IS_NIGHTLY == 'true' && 'nightly') || needs.prepare.outputs.tag_name }}
13+
- name: Test Foundryup Installation (Windows)
18814
shell: bash
18915
run: |
190-
sudo apt-get -y install help2man
191-
help2man -N $OUT_DIR/forge > forge.1
192-
help2man -N $OUT_DIR/cast > cast.1
193-
gzip forge.1
194-
gzip cast.1
195-
tar -czvf "foundry_man_${VERSION_NAME}.tar.gz" forge.1.gz cast.1.gz
196-
echo "foundry_man=foundry_man_${VERSION_NAME}.tar.gz" >> $GITHUB_OUTPUT
197-
198-
# Creates the release for this specific version
199-
- name: Create release
200-
uses: softprops/action-gh-release@v2
201-
with:
202-
name: ${{ needs.prepare.outputs.release_name }}
203-
tag_name: ${{ needs.prepare.outputs.tag_name }}
204-
prerelease: ${{ env.IS_NIGHTLY == 'true' }}
205-
body: ${{ needs.prepare.outputs.changelog }}
206-
files: |
207-
${{ steps.artifacts.outputs.file_name }}
208-
${{ steps.man.outputs.foundry_man }}
209-
210-
- name: Binaries attestation
211-
uses: actions/attest-build-provenance@v2
212-
with:
213-
subject-path: |
214-
${{ env.cast_bin_path }}
215-
${{ env.forge_bin_path }}
216-
217-
# If this is a nightly release, it also updates the release
218-
# tagged `nightly` for compatibility with `foundryup`
219-
- name: Update nightly release
220-
if: ${{ env.IS_NIGHTLY == 'true' }}
221-
uses: softprops/action-gh-release@v2
222-
with:
223-
name: "Nightly"
224-
tag_name: "nightly"
225-
prerelease: true
226-
body: ${{ needs.prepare.outputs.changelog }}
227-
files: |
228-
${{ steps.artifacts.outputs.file_name }}
229-
${{ steps.man.outputs.foundry_man }}
230-
231-
cleanup:
232-
name: Release cleanup
233-
runs-on: ubuntu-latest
234-
timeout-minutes: 30
235-
needs: release
236-
if: always()
237-
steps:
238-
- uses: actions/checkout@v4
239-
240-
# Moves the `nightly` tag to `HEAD`
241-
- name: Move nightly tag
242-
if: ${{ env.IS_NIGHTLY == 'true' }}
243-
uses: actions/github-script@v7
244-
with:
245-
script: |
246-
const moveTag = require('./.github/scripts/move-tag.js')
247-
await moveTag({ github, context }, 'nightly')
248-
249-
- name: Delete old nightlies
250-
uses: actions/github-script@v7
251-
with:
252-
script: |
253-
const prunePrereleases = require('./.github/scripts/prune-prereleases.js')
254-
await prunePrereleases({github, context})
255-
256-
# If any of the jobs fail, this will create a high-priority issue to signal so.
257-
issue:
258-
name: Open an issue
259-
runs-on: ubuntu-latest
260-
needs: [ prepare, release, cleanup ]
261-
if: failure()
262-
steps:
263-
- uses: actions/checkout@v4
264-
- uses: JasonEtco/create-an-issue@v2
265-
env:
266-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
267-
WORKFLOW_URL: |
268-
${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
269-
with:
270-
update_existing: true
271-
filename: .github/RELEASE_FAILURE_ISSUE_TEMPLATE.md
16+
echo "=== Windows OS Detection ==="
17+
uname -s
18+
uname -m
19+
20+
echo "=== Downloading Foundryup ==="
21+
curl -L https://raw.githubusercontent.com/soul022/foundry-revive-testing/refs/heads/master/foundryup/install | bash
22+
23+
echo "=== Setting Foundry PATH ==="
24+
export FOUNDARY_BIN_PATH="$USERPROFILE/.foundry/bin"
25+
export PATH="$FOUNDARY_BIN_PATH:$PATH"
26+
echo "$FOUNDARY_BIN_PATH" >> $GITHUB_PATH
27+
28+
echo "=== Debug: Checking Installation Directory ==="
29+
ls -lah "$FOUNDARY_BIN_PATH" || echo "❌ Foundry binaries directory not found!"
30+
31+
echo "=== Running Foundryup ==="
32+
foundryup --install "stable" || echo "⚠️ Foundryup installation failed!"
33+
34+
echo "=== Verifying Forge & Cast Installation ==="
35+
which forge || echo "❌ forge binary not found in PATH"
36+
which cast || echo "❌ cast binary not found in PATH"
37+
38+
echo "=== Checking Forge & Cast Versions ==="
39+
forge --version || echo "❌ forge command not available after install"
40+
cast --version || echo "❌ cast command not available after install"

0 commit comments

Comments
 (0)