Skip to content
Merged
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
8 changes: 8 additions & 0 deletions .github/workflows/publish-evm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,14 @@ jobs:
run: ls -R ./npm
shell: bash

- name: Prepare release
run: pnpm run release:prepare && pnpm install --lockfile-only

- name: Publish native to NPM
run: pnpm run release:native -- --publish-branch=evm --tag=evm --no-git-checks
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}

- name: Publish to NPM
run: |
pnpm run release -- --publish-branch=evm --tag=evm --no-git-checks
Expand Down
8 changes: 8 additions & 0 deletions .github/workflows/publish-rc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,14 @@ jobs:
run: ls -R ./npm
shell: bash

- name: Prepare release
run: pnpm run release:prepare && pnpm install --lockfile-only

- name: Publish native to NPM
run: pnpm run release:native -- --publish-branch=develop --tag=rc --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
Expand Down
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@
"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:native": "bash ./scripts/publish-evm-native.sh",
"release:prepare": "lerna run release:prepare --scope=@mainsail/evm",
"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\"",
Expand Down
2 changes: 1 addition & 1 deletion packages/evm/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
"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",
"release:prepare": "napi prepublish -t pnpm --skip-optional-publish --no-gh-release",
"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",
Expand Down
6 changes: 1 addition & 5 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

28 changes: 28 additions & 0 deletions scripts/publish-evm-native.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/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 -- <flags>` 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

for dir in npm/*/; do
echo "Publishing ${dir%/} $*"
(cd "$dir" && pnpm publish --access public "$@")
done
Loading