Skip to content

Commit

Permalink
Merge branch 'main' into nish-upstream-5e72c69-fix-tests
Browse files Browse the repository at this point in the history
  • Loading branch information
nbaztec committed Jan 24, 2025
2 parents 889c181 + b993907 commit bb731b1
Show file tree
Hide file tree
Showing 42 changed files with 1,143 additions and 255 deletions.
2 changes: 1 addition & 1 deletion .github/release-please/manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "0.0.2"
".": "0.0.4"
}
26 changes: 0 additions & 26 deletions .github/workflows/bump-forge-std.yml

This file was deleted.

1 change: 1 addition & 0 deletions .github/workflows/release-please.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,5 @@ 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
87 changes: 45 additions & 42 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,12 @@ on:
workflow_call:
inputs:
tag:
description: "Tag to use for the release."
description: "Tag to use for the release (<component>-v<version>)."
type: string
required: true
default: ""
version:
description: "Version for the release."
type: string
required: true
default: ""
Expand All @@ -24,6 +29,7 @@ jobs:
timeout-minutes: 30
outputs:
tag_name: ${{ steps.release_info.outputs.tag_name }}
version_name: ${{ steps.release_info.outputs.version_name }}
release_name: ${{ steps.release_info.outputs.release_name }}
prerelease: ${{ steps.release_info.outputs.prerelease }}
changelog: ${{ steps.build_changelog.outputs.changelog || '' }}
Expand All @@ -36,21 +42,37 @@ jobs:
- name: Compute release name and tag
id: release_info
run: |
if [[ ${IS_NIGHTLY} == 'true' ]]; then
echo "tag_name=nightly-${GITHUB_SHA}" >> $GITHUB_OUTPUT
echo "nightly: $IS_NIGHTLY"
if [ $IS_NIGHTLY == "true" ]; then
TAG="${{ inputs.tag || format('nightly-{0}', github.sha) }}"
VERSION="${{ inputs.version || 'nightly' }}"
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
echo "tag_name=${GITHUB_REF_NAME}" >> $GITHUB_OUTPUT
echo "release_name=foundry-zksync@${GITHUB_REF_NAME}" >> $GITHUB_OUTPUT
TAG="${{ inputs.tag || format('stable-{0}', github.sha) }}"
VERSION="${{ inputs.version || 'stable' }}"
echo "tag_name=${TAG}" >> $GITHUB_OUTPUT
echo "version_name=v${VERSION}" >> $GITHUB_OUTPUT
echo "release_name=foundry-zksync v${VERSION}" >> $GITHUB_OUTPUT
echo "prerelease=false" >> $GITHUB_OUTPUT
fi
- name: Print release info
run: |
echo tag_name: "${{ steps.release_info.outputs.tag_name }}"
echo version_name: "${{ steps.release_info.outputs.version_name }}"
echo release_name: "${{ steps.release_info.outputs.release_name }}"
echo prerelease: "${{ steps.release_info.outputs.prerelease }}"
# Creates a `nightly-SHA` tag for this specific nightly
# This tag is used for this specific nightly version's release
# which allows users to roll back. It is also used to build
# the changelog.
- name: Create build-specific nightly tag
- name: Create build-specific tag (nightly)
if: ${{ env.IS_NIGHTLY == 'true' }}
uses: actions/github-script@v7
env:
Expand All @@ -60,7 +82,7 @@ jobs:
const createTag = require('./.github/scripts/create-tag.js')
await createTag({ github, context }, process.env.TAG_NAME)
- name: Build changelog
- name: Build changelog (nightly)
if: ${{ env.IS_NIGHTLY == 'true' }}
id: build_changelog
uses: mikepenz/release-changelog-builder-action@v4
Expand Down Expand Up @@ -114,41 +136,22 @@ jobs:
with:
ref: ${{ inputs.tag || '' }}

- uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}

- name: Install required Rust targets
run: rustup target add ${{ matrix.target }}

- uses: Swatinem/rust-cache@v2
with:
key: ${{ matrix.target }}
cache-on-failure: true

- name: Apple M1 setup
if: matrix.target == 'aarch64-apple-darwin'
run: |
brew install make
echo "PATH=/usr/local/opt/make/libexec/gnubin:$PATH" >> $GITHUB_ENV
echo "SDKROOT=$(xcrun -sdk macosx --show-sdk-path)" >> $GITHUB_ENV
echo "MACOSX_DEPLOYMENT_TARGET=$(xcrun -sdk macosx --show-sdk-platform-version)" >> $GITHUB_ENV
- name: Apple Darwin
if: matrix.target == 'x86_64-apple-darwin'
run: |
brew install make
echo "PATH=/usr/local/opt/make/libexec/gnubin:$PATH" >> $GITHUB_ENV
- name: Install required Rust targets
run: rustup target add ${{ matrix.target }}

- name: Linux ARM setup
if: matrix.target == 'aarch64-unknown-linux-gnu'
run: |
sudo apt-get update -y
sudo apt-get install -y gcc-aarch64-linux-gnu g++-aarch64-linux-gnu
echo "CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=aarch64-linux-gnu-gcc" >> $GITHUB_ENV
echo "C_INCLUDE_PATH=/usr/aarch64-linux-gnu/include" >> $GITHUB_ENV
echo "CPLUS_INCLUDE_PATH=/usr/aarch64-linux-gnu/include" >> $GITHUB_ENV
- uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}

- name: Install cross v0.2.5 from source
run: cargo install cross --git https://github.com/cross-rs/cross --tag v0.2.5

# We diverge from upstream and build with cross as we're building static binaries
- name: Build binaries
env:
SVM_TARGET_PLATFORM: ${{ matrix.svm_target_platform }}
Expand All @@ -164,7 +167,7 @@ jobs:
# flags+=(--features asm-keccak)
# fi
cargo build --release --bin forge --bin cast --target "$target" "${flags[@]}"
RUSTFLAGS='-C target-feature=+crt-static' OPENSSL_STATIC=1 cross build --release --bin forge --bin cast --target "$target" "${flags[@]}"
bins=(cast forge)
for name in "${bins[@]}"; do
Expand All @@ -181,17 +184,17 @@ jobs:
PLATFORM_NAME: ${{ matrix.platform }}
TARGET: ${{ matrix.target }}
ARCH: ${{ matrix.arch }}
VERSION_NAME: ${{ (env.IS_NIGHTLY && 'nightly') || needs.prepare.outputs.tag_name }}
VERSION_NAME: ${{ needs.prepare.outputs.version_name }}
shell: bash
run: |
if [ "$PLATFORM_NAME" == "linux" ]; then
tar -czvf "foundry_${VERSION_NAME}_${PLATFORM_NAME}_${ARCH}.tar.gz" -C ./target/${TARGET}/release forge cast
echo "file_name=foundry_${VERSION_NAME}_${PLATFORM_NAME}_${ARCH}.tar.gz" >> $GITHUB_OUTPUT
tar -czvf "foundry_zksync_${VERSION_NAME}_${PLATFORM_NAME}_${ARCH}.tar.gz" -C ./target/${TARGET}/release forge cast
echo "file_name=foundry_zksync_${VERSION_NAME}_${PLATFORM_NAME}_${ARCH}.tar.gz" >> $GITHUB_OUTPUT
elif [ "$PLATFORM_NAME" == "darwin" ]; then
# We need to use gtar here otherwise the archive is corrupt.
# See: https://github.com/actions/virtual-environments/issues/2619
gtar -czvf "foundry_${VERSION_NAME}_${PLATFORM_NAME}_${ARCH}.tar.gz" -C ./target/${TARGET}/release forge cast
echo "file_name=foundry_${VERSION_NAME}_${PLATFORM_NAME}_${ARCH}.tar.gz" >> $GITHUB_OUTPUT
gtar -czvf "foundry_zksync_${VERSION_NAME}_${PLATFORM_NAME}_${ARCH}.tar.gz" -C ./target/${TARGET}/release forge cast
echo "file_name=foundry_zksync_${VERSION_NAME}_${PLATFORM_NAME}_${ARCH}.tar.gz" >> $GITHUB_OUTPUT
fi
- name: Build man page
Expand All @@ -200,7 +203,7 @@ jobs:
env:
PLATFORM_NAME: ${{ matrix.platform }}
TARGET: ${{ matrix.target }}
VERSION_NAME: ${{ (env.IS_NIGHTLY == 'true' && 'nightly') || needs.prepare.outputs.tag_name }}
VERSION_NAME: ${{ needs.prepare.outputs.version_name }}
shell: bash
run: |
sudo apt-get -y install help2man
Expand Down
Loading

0 comments on commit bb731b1

Please sign in to comment.