From d1e450686bd891452ebad2c3511cc326d728be4f Mon Sep 17 00:00:00 2001 From: sebastijankuzner Date: Thu, 4 Jun 2026 13:32:17 +0000 Subject: [PATCH 1/9] Add config tag --- .github/workflows/publish-evm.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/publish-evm.yml b/.github/workflows/publish-evm.yml index 87d346138..65d7dcfe3 100644 --- a/.github/workflows/publish-evm.yml +++ b/.github/workflows/publish-evm.yml @@ -137,6 +137,7 @@ jobs: pnpm run release -- --publish-branch=evm --tag=evm --no-git-checks env: NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} + npm_config_tag: evm # - name: Set dist-tag latest # run: | From b40e2a3958bd0f8b6999011aa75782cdbcde82fe Mon Sep 17 00:00:00 2001 From: sebastijankuzner Date: Thu, 4 Jun 2026 13:36:33 +0000 Subject: [PATCH 2/9] Skip and run on opened --- .github/workflows/publish-evm.yml | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/.github/workflows/publish-evm.yml b/.github/workflows/publish-evm.yml index 65d7dcfe3..8460abb7e 100644 --- a/.github/workflows/publish-evm.yml +++ b/.github/workflows/publish-evm.yml @@ -8,14 +8,18 @@ env: permissions: contents: read +# on: +# push: +# branches: +# - "evm" + on: - push: - branches: - - "evm" + pull_request: + types: [opened] jobs: build: - if: contains(github.event.head_commit.message, 'release:') && contains(github.event.head_commit.message, 'evm') + # if: contains(github.event.head_commit.message, 'release:') && contains(github.event.head_commit.message, 'evm') strategy: fail-fast: false @@ -78,7 +82,7 @@ jobs: publish: name: Publish - if: contains(github.event.head_commit.message, 'release:') && contains(github.event.head_commit.message, 'evm') + # if: contains(github.event.head_commit.message, 'release:') && contains(github.event.head_commit.message, 'evm') runs-on: ubuntu-latest needs: - build From 6ff49b156c3edf4485f6e1ef274741025b95f319 Mon Sep 17 00:00:00 2001 From: sebastijankuzner Date: Thu, 4 Jun 2026 13:38:11 +0000 Subject: [PATCH 3/9] Publish evm only --- .github/workflows/publish-evm.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish-evm.yml b/.github/workflows/publish-evm.yml index 8460abb7e..b8fa7723e 100644 --- a/.github/workflows/publish-evm.yml +++ b/.github/workflows/publish-evm.yml @@ -138,7 +138,7 @@ jobs: - name: Publish to NPM run: | - pnpm run release -- --publish-branch=evm --tag=evm --no-git-checks + pnpm run release --scope=@mainsail/evm -- --publish-branch=evm --tag=evm --no-git-checks env: NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} npm_config_tag: evm From 1edc9df3c5b346a98936f96f064fda93649e918d Mon Sep 17 00:00:00 2001 From: sebastijankuzner Date: Thu, 4 Jun 2026 14:13:14 +0000 Subject: [PATCH 4/9] Napi release --- .github/workflows/publish-evm.yml | 6 ++- .github/workflows/publish-rc.yml | 5 +++ package.json | 1 + packages/evm/package.json | 71 ++++++++++++++++--------------- scripts/publish-evm-native.sh | 31 ++++++++++++++ 5 files changed, 79 insertions(+), 35 deletions(-) create mode 100755 scripts/publish-evm-native.sh diff --git a/.github/workflows/publish-evm.yml b/.github/workflows/publish-evm.yml index b8fa7723e..b18840fe9 100644 --- a/.github/workflows/publish-evm.yml +++ b/.github/workflows/publish-evm.yml @@ -136,12 +136,16 @@ jobs: run: ls -R ./npm shell: bash + - name: Publish native packages + run: pnpm run release:napi -- --tag=evm --publish-branch=evm --no-git-checks + env: + NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} + - name: Publish to NPM run: | pnpm run release --scope=@mainsail/evm -- --publish-branch=evm --tag=evm --no-git-checks env: NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} - npm_config_tag: evm # - name: Set dist-tag latest # run: | diff --git a/.github/workflows/publish-rc.yml b/.github/workflows/publish-rc.yml index 54be9e1c2..227dbb7a8 100644 --- a/.github/workflows/publish-rc.yml +++ b/.github/workflows/publish-rc.yml @@ -132,6 +132,11 @@ jobs: run: ls -R ./npm shell: bash + - name: Publish native packages + run: pnpm run release:napi -- --tag=rc --publish-branch=develop --no-git-checks + env: + NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} + - name: Publish to NPM run: | pnpm run release -- --publish-branch=develop --tag=rc --no-git-checks diff --git a/package.json b/package.json index a2b573240..8e005f21e 100644 --- a/package.json +++ b/package.json @@ -36,6 +36,7 @@ "prettier:dry": "prettier --check \"./*.{ts,js,json,md}\" \"./packages/**/*.{ts,js,json,md}\"", "references": "node ./scripts/references/update-references.js", "release": "lerna run release --concurrency=1", + "release:napi": "bash ./scripts/publish-evm-native.sh", "setup": "pnpm install && pnpm run build", "sort": "sort-package-json \"package.json\" \"packages/*/package.json\"", "sort:dry": "sort-package-json --check \"package.json\" \"packages/*/package.json\"", diff --git a/packages/evm/package.json b/packages/evm/package.json index 6413353b6..ad2d35746 100644 --- a/packages/evm/package.json +++ b/packages/evm/package.json @@ -1,35 +1,38 @@ { - "name": "@mainsail/evm", - "version": "0.0.1-evm.48", - "description": "EVM for the Mainsail blockchain", - "license": "GPL-3.0-only", - "contributors": [], - "main": "index.js", - "types": "index.d.ts", - "scripts": { - "artifacts": "napi artifacts", - "build-napi": "napi build --platform --output-dir ./ --manifest-path bindings/Cargo.toml --release", - "build-napi:debug": "napi build --platform --output-dir ./ --manifest-path bindings/Cargo.toml", - "build-rs": "pnpm run clean && pnpm run build-napi", - "clean": "rm -f index.js && rm -f index.d.ts && rm -f evm.*.node && rm -rf target", - "prepublishOnly": "napi prepublish -t pnpm", - "release": "pnpm publish --access public", - "test": "cargo test --release", - "test:coverage": "mkdir -p coverage && cargo llvm-cov --lcov --output-path coverage/lcov.info --remap-path-prefix", - "test:coverage:html": "mkdir -p coverage && cargo llvm-cov --html --output-dir coverage/ --remap-path-prefix", - "version": "napi version" - }, - "devDependencies": { - "@napi-rs/cli": "3.6.2" - }, - "engines": { - "node": ">=24" - }, - "napi": { - "binaryName": "evm", - "targets": [ - "aarch64-unknown-linux-gnu", - "x86_64-unknown-linux-gnu" - ] - } -} + "name": "@mainsail/evm", + "version": "0.0.1-evm.48", + "description": "EVM for the Mainsail blockchain", + "license": "GPL-3.0-only", + "contributors": [], + "main": "index.js", + "types": "index.d.ts", + "scripts": { + "artifacts": "napi artifacts", + "build-napi": "napi build --platform --output-dir ./ --manifest-path bindings/Cargo.toml --release", + "build-napi:debug": "napi build --platform --output-dir ./ --manifest-path bindings/Cargo.toml", + "build-rs": "pnpm run clean && pnpm run build-napi", + "clean": "rm -f index.js && rm -f index.d.ts && rm -f evm.*.node && rm -rf target", + "release": "pnpm publish --access public", + "test": "cargo test --release", + "test:coverage": "mkdir -p coverage && cargo llvm-cov --lcov --output-path coverage/lcov.info --remap-path-prefix", + "test:coverage:html": "mkdir -p coverage && cargo llvm-cov --html --output-dir coverage/ --remap-path-prefix", + "version": "napi version" + }, + "devDependencies": { + "@napi-rs/cli": "3.6.2" + }, + "engines": { + "node": ">=24" + }, + "napi": { + "binaryName": "evm", + "targets": [ + "aarch64-unknown-linux-gnu", + "x86_64-unknown-linux-gnu" + ] + }, + "optionalDependencies": { + "@mainsail/evm-linux-arm64-gnu": "0.0.1-evm.48", + "@mainsail/evm-linux-x64-gnu": "0.0.1-evm.48" + } +} \ No newline at end of file diff --git a/scripts/publish-evm-native.sh b/scripts/publish-evm-native.sh new file mode 100755 index 000000000..37213dbc9 --- /dev/null +++ b/scripts/publish-evm-native.sh @@ -0,0 +1,31 @@ +#!/usr/bin/env bash +set -euo pipefail + +# Publishes the EVM native platform packages (@mainsail/evm-*) to npm. +# +# Run this BEFORE `pnpm run release`. It first lets napi sync the platform package versions and the +# main package's optionalDependencies (without publishing them or creating a GitHub release), then +# publishes each platform package, forwarding every flag passed on the command line straight to +# `pnpm publish`. `napi prepublish` would otherwise publish them with a bare `npm publish` (no +# --tag), which npm rejects for prerelease versions, and pnpm strips npm_config_* from the +# lifecycle-script env so a dist-tag cannot be injected that way. +# +# Usage: +# pnpm run release:napi -- --tag=evm --publish-branch=evm --no-git-checks +# pnpm run release:napi -- --tag=rc --publish-branch=develop --no-git-checks + +cd "$(dirname "${BASH_SOURCE[0]}")/../packages/evm" + +# `pnpm run release:napi -- ` forwards the literal `--` separator into "$@" as well; drop it +# so the flags reach `pnpm publish` as options instead of being treated as a positional argument. +if [ "${1:-}" = "--" ]; then + shift +fi + +# Sync versions + optionalDependencies only; we publish the platform packages ourselves below. +pnpm exec napi prepublish -t pnpm --skip-optional-publish --no-gh-release + +for dir in npm/*/; do + echo "Publishing ${dir%/} $*" + (cd "$dir" && pnpm publish --access public "$@") +done From 0b30e5c04e8fd14f5bef77dfb65a35eec77099af Mon Sep 17 00:00:00 2001 From: sebastijankuzner Date: Thu, 4 Jun 2026 14:13:45 +0000 Subject: [PATCH 5/9] On workflow call --- .github/workflows/publish-evm.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/publish-evm.yml b/.github/workflows/publish-evm.yml index b18840fe9..dc7cdae3b 100644 --- a/.github/workflows/publish-evm.yml +++ b/.github/workflows/publish-evm.yml @@ -14,8 +14,7 @@ permissions: # - "evm" on: - pull_request: - types: [opened] + workflow_call: jobs: build: From 36752078e789af6305282b7508d38dbaa78c3fc0 Mon Sep 17 00:00:00 2001 From: sebastijankuzner Date: Thu, 4 Jun 2026 14:19:01 +0000 Subject: [PATCH 6/9] Remove optional deps --- packages/evm/package.json | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/packages/evm/package.json b/packages/evm/package.json index ad2d35746..571730568 100644 --- a/packages/evm/package.json +++ b/packages/evm/package.json @@ -30,9 +30,5 @@ "aarch64-unknown-linux-gnu", "x86_64-unknown-linux-gnu" ] - }, - "optionalDependencies": { - "@mainsail/evm-linux-arm64-gnu": "0.0.1-evm.48", - "@mainsail/evm-linux-x64-gnu": "0.0.1-evm.48" } -} \ No newline at end of file +} From 395f6ccf469c42a75e2fd62889bb10e3fd4fd366 Mon Sep 17 00:00:00 2001 From: sebastijankuzner <58827427+sebastijankuzner@users.noreply.github.com> Date: Thu, 4 Jun 2026 14:21:19 +0000 Subject: [PATCH 7/9] style: resolve style guide violations [ci-lint-fix] --- packages/evm/package.json | 64 +++++++++++++++++++-------------------- 1 file changed, 32 insertions(+), 32 deletions(-) diff --git a/packages/evm/package.json b/packages/evm/package.json index 571730568..e7317354d 100644 --- a/packages/evm/package.json +++ b/packages/evm/package.json @@ -1,34 +1,34 @@ { - "name": "@mainsail/evm", - "version": "0.0.1-evm.48", - "description": "EVM for the Mainsail blockchain", - "license": "GPL-3.0-only", - "contributors": [], - "main": "index.js", - "types": "index.d.ts", - "scripts": { - "artifacts": "napi artifacts", - "build-napi": "napi build --platform --output-dir ./ --manifest-path bindings/Cargo.toml --release", - "build-napi:debug": "napi build --platform --output-dir ./ --manifest-path bindings/Cargo.toml", - "build-rs": "pnpm run clean && pnpm run build-napi", - "clean": "rm -f index.js && rm -f index.d.ts && rm -f evm.*.node && rm -rf target", - "release": "pnpm publish --access public", - "test": "cargo test --release", - "test:coverage": "mkdir -p coverage && cargo llvm-cov --lcov --output-path coverage/lcov.info --remap-path-prefix", - "test:coverage:html": "mkdir -p coverage && cargo llvm-cov --html --output-dir coverage/ --remap-path-prefix", - "version": "napi version" - }, - "devDependencies": { - "@napi-rs/cli": "3.6.2" - }, - "engines": { - "node": ">=24" - }, - "napi": { - "binaryName": "evm", - "targets": [ - "aarch64-unknown-linux-gnu", - "x86_64-unknown-linux-gnu" - ] - } + "name": "@mainsail/evm", + "version": "0.0.1-evm.48", + "description": "EVM for the Mainsail blockchain", + "license": "GPL-3.0-only", + "contributors": [], + "main": "index.js", + "types": "index.d.ts", + "scripts": { + "artifacts": "napi artifacts", + "build-napi": "napi build --platform --output-dir ./ --manifest-path bindings/Cargo.toml --release", + "build-napi:debug": "napi build --platform --output-dir ./ --manifest-path bindings/Cargo.toml", + "build-rs": "pnpm run clean && pnpm run build-napi", + "clean": "rm -f index.js && rm -f index.d.ts && rm -f evm.*.node && rm -rf target", + "release": "pnpm publish --access public", + "test": "cargo test --release", + "test:coverage": "mkdir -p coverage && cargo llvm-cov --lcov --output-path coverage/lcov.info --remap-path-prefix", + "test:coverage:html": "mkdir -p coverage && cargo llvm-cov --html --output-dir coverage/ --remap-path-prefix", + "version": "napi version" + }, + "devDependencies": { + "@napi-rs/cli": "3.6.2" + }, + "engines": { + "node": ">=24" + }, + "napi": { + "binaryName": "evm", + "targets": [ + "aarch64-unknown-linux-gnu", + "x86_64-unknown-linux-gnu" + ] + } } From 3603c310acbdfa10a5da36bf5cef7493e5737cb0 Mon Sep 17 00:00:00 2001 From: sebastijankuzner Date: Thu, 4 Jun 2026 14:22:44 +0000 Subject: [PATCH 8/9] In pull request --- .github/workflows/publish-evm.yml | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/.github/workflows/publish-evm.yml b/.github/workflows/publish-evm.yml index dc7cdae3b..0574c6888 100644 --- a/.github/workflows/publish-evm.yml +++ b/.github/workflows/publish-evm.yml @@ -8,13 +8,9 @@ env: permissions: contents: read -# on: -# push: -# branches: -# - "evm" - on: - workflow_call: + pull_request: + types: [opened, synchronize, reopened] jobs: build: From c834b4a23d721be305f308f90b4a44d368a681c2 Mon Sep 17 00:00:00 2001 From: sebastijankuzner Date: Thu, 4 Jun 2026 16:13:31 +0000 Subject: [PATCH 9/9] Run no bail --- .github/workflows/publish-evm.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/publish-evm.yml b/.github/workflows/publish-evm.yml index 0574c6888..4063b7cea 100644 --- a/.github/workflows/publish-evm.yml +++ b/.github/workflows/publish-evm.yml @@ -131,14 +131,14 @@ jobs: run: ls -R ./npm shell: bash - - name: Publish native packages - run: pnpm run release:napi -- --tag=evm --publish-branch=evm --no-git-checks + - name: Publish to NPM + run: | + pnpm run release --no-bail -- --publish-branch=evm --tag=evm --no-git-checks env: NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} - - name: Publish to NPM - run: | - pnpm run release --scope=@mainsail/evm -- --publish-branch=evm --tag=evm --no-git-checks + - name: Publish native packages + run: pnpm run release:napi -- --tag=evm --publish-branch=evm --no-git-checks env: NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}