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
55 changes: 55 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Publish

# Tag-triggered publish to npm. A pushed v* tag starts the run, but the
# publish step is gated on maintainer sign-off through the npm-publish
# environment and authenticates with that environment's NPM_TOKEN secret.
on:
push:
tags: ['v*']

jobs:
publish:
runs-on: ubuntu-latest
# Required-reviewer environment: a pushed tag queues the publish until a
# maintainer approves the run, and the environment scopes the NPM_TOKEN
# secret so no other workflow can read it. id-token stays enabled for
# npm provenance attestation.
environment: npm-publish
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
node-version: 22
registry-url: https://registry.npmjs.org
cache: yarn

- name: Upgrade npm
# Trusted publishing (OIDC) needs npm >= 11.5.1; the Node 22 image
# ships npm 10.x.
run: npm install -g npm@latest

- name: Verify tag matches package version
run: |
version="$(node -p "require('./package.json').version")"
if [ "v$version" != "$GITHUB_REF_NAME" ]; then
echo "Tag $GITHUB_REF_NAME does not match package.json version $version" >&2
exit 1
fi

- name: Install
run: yarn install --frozen-lockfile

- name: Build
run: yarn run build

- name: Test
run: yarn run test

Comment thread
robrigo marked this conversation as resolved.
- name: Publish
run: npm publish --access public --provenance
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ The focus of VeRT is on the better compatibility than the performance, so it can
## Requirement

- WebAssembly binary with exported memory
- Nodejs v16 or higher (JavaScript runtime with WebAssembly BigInt support)
- Nodejs v20 or higher (JavaScript runtime with WebAssembly BigInt support)

## Chain compatibility

Expand Down
6 changes: 5 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
"description": "Testing library for Antelope smart contracts, with per-chain host function parity",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"engines": {
"node": ">=20"
},
"files": [
"dist",
"src"
Expand All @@ -14,7 +17,8 @@
"build-web": "webpack",
"start": "node dist/index",
"test": "mocha src/**/*.spec.ts -r ts-node/register && yarn --cwd examples",
"prepublish": "npm run test && npm run build"
"prepack": "npm run build",
"prepublishOnly": "npm run test"
},
"author": "Jeeyong Um <conr2d@gmail.com>",
"license": "MIT",
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@
"experimentalDecorators": true
},
"lib": ["es2020"],
"exclude": [ "examples/**/*" ]
"exclude": [ "examples/**/*", "src/**/tests/**", "**/*.spec.ts" ]
}
Loading