Skip to content
Closed
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
4 changes: 2 additions & 2 deletions .github/workflows/benchmarks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ jobs:
run: ./.github/scripts/commit-and-read-benchmarks.sh benches "${{ github.event_name }}" "${{ github.repository }}"

- name: Upload benchmark results as artifacts
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v5
with:
name: benchmark-results
path: |
Expand Down Expand Up @@ -165,7 +165,7 @@ jobs:
persist-credentials: false

- name: Download benchmark results
uses: actions/download-artifact@v5
uses: actions/download-artifact@v6
with:
name: benchmark-results
path: benches/
Expand Down
47 changes: 4 additions & 43 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@ name: CI
permissions: {}

on:
push:
branches:
- master
pull_request:
merge_group:

Expand All @@ -28,48 +25,12 @@ jobs:
secrets: inherit

docs:
runs-on: depot-ubuntu-latest
timeout-minutes: 30
uses: ./.github/workflows/docs.yml
permissions:
contents: read
steps:
- uses: actions/checkout@v5
with:
persist-credentials: false
- uses: dtolnay/rust-toolchain@e97e2d8cc328f1b50210efc529dca0028893a2d9 # master
with:
toolchain: nightly
- uses: rui314/setup-mold@725a8794d15fc7563f59595bd9556495c0564878 # v1
- uses: mozilla-actions/sccache-action@7d986dd989559c6ecdb630a3fd2557667be217ad # v0.0.9
- uses: Swatinem/rust-cache@f13886b937689c021905a6b90929199931d60db1 # v2
- name: Build documentation
run: cargo doc --workspace --all-features --no-deps --document-private-items
env:
RUSTDOCFLAGS: --cfg docsrs -D warnings --show-type-layout --generate-link-to-definition --enable-index-page -Zunstable-options
- name: Setup Pages
if: github.ref_name == 'master' && github.event_name == 'push'
uses: actions/configure-pages@v5
- name: Upload artifact
if: github.ref_name == 'master' && github.event_name == 'push'
uses: actions/upload-pages-artifact@v4
with:
path: ./target/doc

deploy-docs:
if: github.ref_name == 'master' && github.event_name == 'push'
needs: [docs]
runs-on: depot-ubuntu-latest
timeout-minutes: 30
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
secrets: inherit

doctest:
runs-on: depot-ubuntu-latest
Expand Down Expand Up @@ -166,7 +127,7 @@ jobs:
with:
toolchain: stable
- uses: rui314/setup-mold@725a8794d15fc7563f59595bd9556495c0564878 # v1
- uses: taiki-e/install-action@e43a5023a747770bfcb71ae048541a681714b951 # v2
- uses: taiki-e/install-action@0ed4032d5406d133639ce4e858011eb498223338 # v2
with:
tool: cargo-hack
- uses: mozilla-actions/sccache-action@7d986dd989559c6ecdb630a3fd2557667be217ad # v0.0.9
Expand All @@ -179,7 +140,7 @@ jobs:
contents: read

codeql:
name: Analyze (${{ matrix.language }})
name: analyze (${{ matrix.language }})
runs-on: ubuntu-latest
permissions:
security-events: write
Expand Down
63 changes: 63 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: docs

permissions: {}

on:
push:
branches:
- master
workflow_call:

concurrency:
group: docs-${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: full
RUSTC_WRAPPER: "sccache"

jobs:
docs:
runs-on: depot-ubuntu-latest
timeout-minutes: 30
permissions:
contents: read
steps:
- uses: actions/checkout@v5
with:
persist-credentials: false
- uses: dtolnay/rust-toolchain@e97e2d8cc328f1b50210efc529dca0028893a2d9 # master
with:
toolchain: nightly
- uses: rui314/setup-mold@725a8794d15fc7563f59595bd9556495c0564878 # v1
- uses: mozilla-actions/sccache-action@7d986dd989559c6ecdb630a3fd2557667be217ad # v0.0.9
- uses: Swatinem/rust-cache@f13886b937689c021905a6b90929199931d60db1 # v2
- name: Build documentation
run: cargo doc --workspace --all-features --no-deps --document-private-items
env:
RUSTDOCFLAGS: --cfg docsrs -D warnings --show-type-layout --generate-link-to-definition --enable-index-page -Zunstable-options
- name: Setup Pages
if: github.ref_name == 'master' && github.event_name == 'push'
uses: actions/configure-pages@v5
- name: Upload artifact
if: github.ref_name == 'master' && github.event_name == 'push'
uses: actions/upload-pages-artifact@v4
with:
path: ./target/doc

deploy-docs:
if: github.ref_name == 'master' && github.event_name == 'push'
needs: [docs]
runs-on: depot-ubuntu-latest
timeout-minutes: 30
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
129 changes: 85 additions & 44 deletions .github/workflows/npm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ defaults:
shell: bash

env:
ACTIONS_RUNNER_DEBUG: true
NPM_CONFIG_PROVENANCE: true
NPM_REGISTRY_URL: "https://registry.npmjs.org"

Expand All @@ -32,22 +31,72 @@ jobs:
contents: read
actions: read
id-token: write
name: ${{ matrix.os }}-${{ matrix.arch }}
name: ${{ matrix.tool }}-${{ matrix.os }}-${{ matrix.arch }}
runs-on: ubuntu-latest
strategy:
max-parallel: 3
fail-fast: false
matrix:
include:
- os: linux
- tool: forge
os: linux
arch: amd64
- os: linux
- tool: forge
os: linux
arch: arm64
- os: darwin
- tool: forge
os: darwin
arch: amd64
- os: darwin
- tool: forge
os: darwin
arch: arm64
- os: win32
- tool: forge
os: win32
arch: amd64
- tool: cast
os: linux
arch: amd64
- tool: cast
os: linux
arch: arm64
- tool: cast
os: darwin
arch: amd64
- tool: cast
os: darwin
arch: arm64
- tool: cast
os: win32
arch: amd64
- tool: anvil
os: linux
arch: amd64
- tool: anvil
os: linux
arch: arm64
- tool: anvil
os: darwin
arch: amd64
- tool: anvil
os: darwin
arch: arm64
- tool: anvil
os: win32
arch: amd64
- tool: chisel
os: linux
arch: amd64
- tool: chisel
os: linux
arch: arm64
- tool: chisel
os: darwin
arch: amd64
- tool: chisel
os: darwin
arch: arm64
- tool: chisel
os: win32
arch: amd64
# Run automatically after a successful 'release' workflow, or manually if a run_id is provided
if: >-
Expand Down Expand Up @@ -77,7 +126,7 @@ jobs:
ls -la "$ARTIFACT_DIR" || true

- name: Download Release Assets
uses: actions/download-artifact@v5
uses: actions/download-artifact@v6
with:
merge-multiple: true
# Download all foundry artifacts from the triggering release run
Expand All @@ -98,14 +147,6 @@ jobs:
node-version: "24"
registry-url: "https://registry.npmjs.org"

- name: Install Dependencies
working-directory: ./npm
run: bun install --frozen-lockfile

- name: Transpile TS -> JS
working-directory: ./npm
run: bun run build

- name: Derive RELEASE_VERSION
id: release-version
working-directory: ./npm
Expand Down Expand Up @@ -142,33 +183,26 @@ jobs:
ARTIFACT_DIR: ${{ steps.paths.outputs.artifact_dir }}
run: |
set -euo pipefail
mkdir -p "$ARTIFACT_DIR/tmp"

FILE_PREFIX="$ARTIFACT_DIR/foundry_${RELEASE_VERSION}_${{ matrix.os }}_${{ matrix.arch }}"
if [[ -f "${FILE_PREFIX}.zip" ]]; then
echo "Extracting ${FILE_PREFIX}.zip"
if ! command -v unzip >/dev/null 2>&1; then
sudo apt-get update -y && sudo apt-get install -y unzip
fi
unzip -o "${FILE_PREFIX}.zip" -d "$ARTIFACT_DIR/tmp"
BIN="$ARTIFACT_DIR/tmp/forge.exe"
else
echo "Extracting ${FILE_PREFIX}.tar.gz"
tar -xzf "${FILE_PREFIX}.tar.gz" -C "$ARTIFACT_DIR/tmp"
BIN="$ARTIFACT_DIR/tmp/forge"
fi

echo "Staging binary $BIN into @foundry-rs/forge-${{ matrix.os }}-${{ matrix.arch }}"
PLATFORM_NAME=${{ matrix.os }} ARCH=${{ matrix.arch }} FORGE_BIN_PATH="$BIN" bun ./scripts/prepublish.ts
bun ./scripts/stage-from-artifact.mjs \
--tool '${{ matrix.tool }}' \
--platform '${{ matrix.os }}' \
--arch '${{ matrix.arch }}' \
--release-version "$RELEASE_VERSION" \
--artifact-dir "$ARTIFACT_DIR"

- name: Sanity Check Binary
working-directory: ./npm
run: |
set -euo pipefail
PKG_DIR="./@foundry-rs/forge-${{ matrix.os }}-${{ matrix.arch }}"
BIN="$PKG_DIR/bin/forge"
if [[ "${{ matrix.os }}" == "win32" ]]; then
BIN="$PKG_DIR/bin/forge.exe"
TOOL='${{ matrix.tool }}'
PLATFORM='${{ matrix.os }}'
ARCH='${{ matrix.arch }}'

PKG_DIR="./@foundry-rs/${TOOL}-${PLATFORM}-${ARCH}"
BIN="$PKG_DIR/bin/${TOOL}"
if [[ "$PLATFORM" == "win32" ]]; then
BIN="$PKG_DIR/bin/${TOOL}.exe"
fi
echo "Verifying binary at: $BIN"
ls -la "$BIN"
Expand All @@ -195,11 +229,16 @@ jobs:
run: |
set -euo pipefail

ls -la ./@foundry-rs/forge-${{ matrix.os }}-${{ matrix.arch }}
TOOL='${{ matrix.tool }}'
PLATFORM='${{ matrix.os }}'
ARCH='${{ matrix.arch }}'

bun ./scripts/publish.ts ./@foundry-rs/forge-${{ matrix.os }}-${{ matrix.arch }}
PACKAGE_DIR="./@foundry-rs/${TOOL}-${PLATFORM}-${ARCH}"
ls -la "$PACKAGE_DIR"

echo "Published @foundry-rs/forge-${{ matrix.os }}-${{ matrix.arch }}"
bun ./scripts/publish.mjs "$PACKAGE_DIR"

echo "Published @foundry-rs/${TOOL}-${PLATFORM}-${ARCH}"

publish-meta:
permissions:
Expand Down Expand Up @@ -234,13 +273,15 @@ jobs:
working-directory: ./npm
run: bun install --frozen-lockfile

- name: Transpile TS -> JS
- name: Typecheck
working-directory: ./npm
run: bun run build
run: bun tsc --project tsconfig.json --noEmit

- name: Publish Meta
- name: Publish Meta Packages
working-directory: ./npm
run: bun run ./scripts/publish.ts ./@foundry-rs/forge
run: |
set -euo pipefail
bun ./scripts/publish-meta.mjs --release-version "$RELEASE_VERSION"
env:
PROVENANCE: true
VERSION_NAME: ${{ env.RELEASE_VERSION }}
Expand Down
Loading