From eea2a8d352d76eb8c6f506d8f9a90256e436eda9 Mon Sep 17 00:00:00 2001 From: David Lutterkort Date: Fri, 27 Mar 2026 15:11:54 -0700 Subject: [PATCH 1/4] ci: Add npm publish step to gnd binary build workflow Publish @graphprotocol/gnd-* platform packages to npm automatically after uploading release assets. Adds a dry_run input for testing. --- .github/workflows/gnd-binary-build.yml | 110 ++++++++++++++++++++++++- 1 file changed, 109 insertions(+), 1 deletion(-) diff --git a/.github/workflows/gnd-binary-build.yml b/.github/workflows/gnd-binary-build.yml index fff3e3a76c0..e4832b9ff0c 100644 --- a/.github/workflows/gnd-binary-build.yml +++ b/.github/workflows/gnd-binary-build.yml @@ -2,6 +2,11 @@ name: Build gnd Binaries on: workflow_dispatch: + inputs: + dry_run: + description: 'Dry-run npm publish (no actual publish)' + type: boolean + default: false jobs: build: @@ -156,4 +161,107 @@ jobs: # Upload Windows x86_64 asset gh release upload $VERSION artifacts/gnd-windows-x86_64.exe/gnd-windows-x86_64.exe.zip --repo $GITHUB_REPOSITORY env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + publish-npm: + name: Publish npm package for ${{ matrix.platform }} + needs: release + if: startsWith(github.ref, 'refs/tags/') + runs-on: ubuntu-latest + permissions: + id-token: write + contents: read + strategy: + fail-fast: false + matrix: + include: + - platform: linux-x64 + asset: gnd-linux-x86_64.gz + os_field: linux + cpu_field: x64 + extract: gunzip + - platform: linux-arm64 + asset: gnd-linux-aarch64.gz + os_field: linux + cpu_field: arm64 + extract: gunzip + - platform: darwin-x64 + asset: gnd-macos-x86_64.gz + os_field: darwin + cpu_field: x64 + extract: gunzip + - platform: darwin-arm64 + asset: gnd-macos-aarch64.gz + os_field: darwin + cpu_field: arm64 + extract: gunzip + - platform: win32-x64 + asset: gnd-windows-x86_64.exe.zip + os_field: win32 + cpu_field: x64 + extract: unzip + steps: + - uses: actions/setup-node@v4 + with: + node-version: 20 + registry-url: https://registry.npmjs.org + + - name: Download gnd binary + env: + GH_TOKEN: ${{ github.token }} + run: | + gh release download "${{ github.ref_name }}" \ + --repo "${{ github.repository }}" \ + --pattern "${{ matrix.asset }}" \ + --output ./binary-archive + + - name: Extract binary + run: | + mkdir -p pkg/bin + if [ "${{ matrix.extract }}" = "gunzip" ]; then + gunzip -c ./binary-archive > pkg/bin/gnd + chmod +x pkg/bin/gnd + else + unzip ./binary-archive -d pkg/bin + mv pkg/bin/*.exe pkg/bin/gnd.exe + fi + + - name: Create package.json + shell: bash + run: | + VERSION="${{ github.ref_name }}" + VERSION="${VERSION#v}" + + if [ "${{ matrix.os_field }}" = "win32" ]; then + BIN_PATH="./bin/gnd.exe" + else + BIN_PATH="./bin/gnd" + fi + + cat > pkg/package.json << EOF + { + "name": "@graphprotocol/gnd-${{ matrix.platform }}", + "version": "${VERSION}", + "description": "gnd binary for ${{ matrix.platform }}", + "os": ["${{ matrix.os_field }}"], + "cpu": ["${{ matrix.cpu_field }}"], + "bin": { + "gnd": "${BIN_PATH}" + }, + "publishConfig": { + "access": "public", + "provenance": true + }, + "license": "(Apache-2.0 OR MIT)", + "repository": { + "type": "git", + "url": "https://github.com/graphprotocol/graph-node.git" + } + } + EOF + + - name: Publish + run: npm publish --provenance --access public ${{ inputs.dry_run && '--dry-run' || '' }} + working-directory: pkg + env: + NODE_AUTH_TOKEN: ${{ secrets.GRAPHPROTOCOL_NPM_TOKEN }} \ No newline at end of file From d4540fcb399c374bdad5d1f9f5245bf56d88c09e Mon Sep 17 00:00:00 2001 From: David Lutterkort Date: Fri, 27 Mar 2026 17:18:48 -0700 Subject: [PATCH 2/4] ci: Replace deprecated macos-13 runner with macos-14 macos-13 runners are no longer available. Use macos-14 (ARM) and cross-compile for x86_64 since the target is already explicit. --- .github/workflows/gnd-binary-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/gnd-binary-build.yml b/.github/workflows/gnd-binary-build.yml index e4832b9ff0c..7d4d1bb990f 100644 --- a/.github/workflows/gnd-binary-build.yml +++ b/.github/workflows/gnd-binary-build.yml @@ -23,7 +23,7 @@ jobs: runner: ubuntu-22.04 asset_name: gnd-linux-aarch64 - target: x86_64-apple-darwin - runner: macos-13 + runner: macos-14 asset_name: gnd-macos-x86_64 - target: aarch64-apple-darwin runner: macos-latest From f9950d38cf0d457a4250968eb92e4267d87ca89c Mon Sep 17 00:00:00 2001 From: David Lutterkort Date: Fri, 27 Mar 2026 17:25:30 -0700 Subject: [PATCH 3/4] all: Update clap to 4.6.0 Fix Windows build failure caused by anstream 0.6.14 conflicting with anstyle-wincon 3.0.11. The clap update pulls anstream 1.0.0 which is compatible. --- Cargo.lock | 58 ++++++++++++++++-------------------------------------- 1 file changed, 17 insertions(+), 41 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 4b26127715c..7b7913a3cfa 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -867,21 +867,6 @@ dependencies = [ "libc", ] -[[package]] -name = "anstream" -version = "0.6.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "418c75fa768af9c03be99d17643f93f79bbba589895012a80e3452a19ddda15b" -dependencies = [ - "anstyle", - "anstyle-parse 0.2.4", - "anstyle-query", - "anstyle-wincon", - "colorchoice", - "is_terminal_polyfill", - "utf8parse", -] - [[package]] name = "anstream" version = "1.0.0" @@ -889,7 +874,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "824a212faf96e9acacdbd09febd34438f8f711fb84e09a8916013cd7815ca28d" dependencies = [ "anstyle", - "anstyle-parse 1.0.0", + "anstyle-parse", "anstyle-query", "anstyle-wincon", "colorchoice", @@ -903,15 +888,6 @@ version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "940b3a0ca603d1eade50a4846a2afffd5ef57a9feac2c0e2ec2e14f9ead76000" -[[package]] -name = "anstyle-parse" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c03a11a9034d92058ceb6ee011ce58af4a9bf61491aa7e1e59ecd24bd40d22d4" -dependencies = [ - "utf8parse", -] - [[package]] name = "anstyle-parse" version = "1.0.0" @@ -938,7 +914,7 @@ checksum = "291e6a250ff86cd4a820112fb8898808a366d8f9f58ce16d1f538353ad55747d" dependencies = [ "anstyle", "once_cell_polyfill", - "windows-sys 0.61.1", + "windows-sys 0.60.2", ] [[package]] @@ -2078,9 +2054,9 @@ dependencies = [ [[package]] name = "clap" -version = "4.5.8" +version = "4.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84b3edb18336f4df585bc9aa31dd99c036dfa5dc5e9a2939a722a188f3a8970d" +checksum = "b193af5b67834b676abd72466a96c1024e6a6ad978a1f484bd90b85c94041351" dependencies = [ "clap_builder", "clap_derive", @@ -2088,11 +2064,11 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.8" +version = "4.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1c09dd5ada6c6c78075d6fd0da3f90d8080651e2d6cc8eb2f1aaa4034ced708" +checksum = "714a53001bf66416adb0e2ef5ac857140e7dc3a0c48fb28b2f10762fc4b5069f" dependencies = [ - "anstream 0.6.14", + "anstream", "anstyle", "clap_lex", "strsim", @@ -2110,9 +2086,9 @@ dependencies = [ [[package]] name = "clap_derive" -version = "4.5.8" +version = "4.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2bac35c6dafb060fd4d275d9a4ffae97917c13a6327903a8be2153cd964f7085" +checksum = "1110bd8a634a1ab8cb04345d8d878267d57c3cf1b38d91b71af6686408bbca6a" dependencies = [ "heck 0.5.0", "proc-macro2", @@ -2122,9 +2098,9 @@ dependencies = [ [[package]] name = "clap_lex" -version = "0.7.1" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b82cf0babdbd58558212896d1a4272303a57bdb245c2bf1147185fb45640e70" +checksum = "c8d4a3bb8b1e0c1050499d1815f5ab16d04f0959b233085fb31653fbfc9d98f9" [[package]] name = "cobs" @@ -3249,7 +3225,7 @@ version = "0.11.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0621c04f2196ac3f488dd583365b9c09be011a4ab8b9f37248ffcc8f6198b56a" dependencies = [ - "anstream 1.0.0", + "anstream", "anstyle", "env_filter", "jiff", @@ -6291,7 +6267,7 @@ version = "0.14.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "343d3bd7056eda839b03204e68deff7d1b13aba7af2b2fd16890697274262ee7" dependencies = [ - "heck 0.5.0", + "heck 0.4.1", "itertools 0.14.0", "log", "multimap", @@ -7882,12 +7858,12 @@ dependencies = [ [[package]] name = "terminal_size" -version = "0.3.0" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21bebf2b7c9e0a515f6e0f8c51dc0f8e4696391e6f1ff30379559f8365fb0df7" +checksum = "230a1b821ccbd75b185820a1f1ff7b14d21da1e442e22c0863ea5f08771a8874" dependencies = [ - "rustix 0.38.34", - "windows-sys 0.48.0", + "rustix 1.0.7", + "windows-sys 0.60.2", ] [[package]] From 226c34f77882d394ffdb3eb902f47edf134f4729 Mon Sep 17 00:00:00 2001 From: David Lutterkort Date: Fri, 27 Mar 2026 17:26:40 -0700 Subject: [PATCH 4/4] ci: Bump GitHub Actions to Node.js 24-compatible versions - actions/checkout v4 -> v6 - actions/upload-artifact v4 -> v7 - actions/download-artifact v4 -> v8 - actions/setup-node v4 -> v6 - node-version 20 -> 22 --- .github/workflows/gnd-binary-build.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/gnd-binary-build.yml b/.github/workflows/gnd-binary-build.yml index 7d4d1bb990f..696c9d67dbe 100644 --- a/.github/workflows/gnd-binary-build.yml +++ b/.github/workflows/gnd-binary-build.yml @@ -34,7 +34,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v4 + uses: actions/checkout@v6 - name: Install Rust toolchain run: | @@ -109,7 +109,7 @@ jobs: 7z a -tzip ${{ matrix.asset_name }}.zip ${{ matrix.asset_name }} - name: Upload artifact - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v7 with: name: ${{ matrix.asset_name }} path: | @@ -124,7 +124,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout code - uses: actions/checkout@v4 + uses: actions/checkout@v6 - name: Setup GitHub CLI run: | @@ -134,7 +134,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Download all artifacts - uses: actions/download-artifact@v4 + uses: actions/download-artifact@v8 with: path: artifacts @@ -201,9 +201,9 @@ jobs: cpu_field: x64 extract: unzip steps: - - uses: actions/setup-node@v4 + - uses: actions/setup-node@v6 with: - node-version: 20 + node-version: 22 registry-url: https://registry.npmjs.org - name: Download gnd binary