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
44 changes: 35 additions & 9 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,40 @@ on:
release:
types: [ published ]

permissions:
contents: read
id-token: write

jobs:
publish:
uses: wavesplatform/publish-to-npm/.github/workflows/publish.yml@7d9462af686d83552d72097bf47a892e43d11f6e
with:
environment: NPMJS
event_name: ${{ github.event_name }}
test: true
version: ${{ github.event.release.tag_name }}
permissions:
id-token: write
contents: read
name: Publish package
runs-on: ubuntu-latest
environment:
name: NPMJS
url: ${{ steps.publish.outputs.url }}
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
- uses: pnpm/action-setup@0e279bb959325dab635dd2c09392533439d90093
- uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f
with:
registry-url: 'https://registry.npmjs.org' # Trusted publishing requires npm CLI version 11.5.1 or later.
node-version: '>=24.7.0'
cache: 'pnpm'
- run: pnpm install --frozen-lockfile
- if: ${{ github.event_name == 'push' }}
run: |
PACKAGE_NAME=$(jq --raw-output .name package.json)
PREFIX=$(jq --raw-output .version package.json)-snapshot
NEXT=$(pnpm view $PACKAGE_NAME versions --json \
| jq --raw-output --arg prefix $PREFIX '[.[] | select(startswith($prefix))|capture("snapshot\\.(?<n>[0-9]+)").n|tonumber]|max + 1 // 0')
pnpm version $PREFIX.$NEXT --no-git-tag-version
echo "TAG=snapshot" >> $GITHUB_ENV
- if: ${{ github.event_name == 'release' }}
run: |
pnpm version $(echo '${{ github.event.release.tag_name }}' | sed 's/^v//') --no-git-tag-version --allow-same-version
echo "TAG=latest" >> $GITHUB_ENV
- run: pnpm test
- id: publish
run: |
pnpm publish --provenance --access public --tag $TAG --no-git-checks
echo "url=https://www.npmjs.com/package/$(jq --raw-output .name package.json)/v/$(jq --raw-output .version package.json)" >> "$GITHUB_OUTPUT"
8 changes: 5 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,12 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
- uses: pnpm/action-setup@0e279bb959325dab635dd2c09392533439d90093
- uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f
with:
registry-url: 'https://registry.npmjs.org'
node-version: '>=24.7.0'
- run: npm i
- run: npm test
- run: npm run build
cache: 'pnpm'
- run: pnpm install --frozen-lockfile
- run: pnpm test
- run: pnpm run build
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
node_modules
.pnpm-store
cjs
dist
es
coverage
.idea
test/_state.ts
.DS_Store
package-lock.json
20 changes: 10 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
"version": "1.4.0",
"main": "cjs/index.js",
"types": "cjs/index.d.ts",
"packageManager": "pnpm@11.5.2",
"scripts": {
"testCommand": "jest",
"prepublishOnly": "npm run build",
"prepublishOnly": "pnpm run build",
"build": "tsc -p ./tsconfig-cjs.json",
"test": "node-state -e -n -m typescript -i ghcr.io/wavesplatform/waves-private-node:finality -o ./test/_state.ts -r"
"test": "jest"
},
"repository": {
"type": "git",
Expand All @@ -24,6 +24,8 @@
"cjs"
],
"jest": {
"globalSetup": "<rootDir>/test/globalSetupWrapper.js",
"globalTeardown": "<rootDir>/test/globalTeardownWrapper.js",
"moduleFileExtensions": [
"ts",
"tsx",
Expand All @@ -42,25 +44,23 @@
},
"devDependencies": {
"@eslint/js": "^9.35.0",
"@types/dockerode": "^3.3.0",
"@types/jest": "^30.0.0",
"@typescript-eslint/eslint-plugin": "^8.56.0",
"@typescript-eslint/parser": "^8.56.0",
"@waves/node-state": "^0.2.0-snapshot.2",
"@waves/waves-transactions": "4.4.0-snapshot.3",
"@waves/waves-transactions": "^5.0.0",
"dockerode": "^5.0.0",
"ts-node": "^10.9.2",
"eslint": "^9.35.0",
"eslint-config-prettier": "^10.1.8",
"eslint-plugin-import": "^2.32.0",
"eslint-plugin-jest": "^29.15.0",
"eslint-plugin-prettier": "^5.5.5",
"globals": "^16.4.0",
"jest": "^30.3.0",
"jest-matcher-utils": "^30.3.0",
"prettier": "^3.8.1",
"ts-jest": "^29.4.6",
"typescript": "^5.9.2"
},
"overrides": {
"test-exclude": "^8.0.0",
"glob": "^13.0.6",
"flatted": "^3.4.2"
}
}
Loading