Skip to content

Commit e632e77

Browse files
committed
Updated workflow
1 parent edf4fb1 commit e632e77

File tree

5 files changed

+23
-8144
lines changed

5 files changed

+23
-8144
lines changed

.github/workflows/publish.yml

Lines changed: 11 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,18 @@
1-
name: Publish snapshot package
1+
name: Publish NPM package
22
on:
33
push:
44
branches: [ 'master' ]
55
release:
66
types: [ published ]
77

8-
permissions:
9-
contents: read
10-
id-token: write
118
jobs:
12-
publish-snapshots:
13-
environment:
14-
name: NPMJS
15-
url: ${{ steps.publish.outputs.url }}
16-
name: Publish snapshot packages
17-
runs-on: ubuntu-latest
18-
steps:
19-
- uses: actions/checkout@v4
20-
- uses: actions/setup-node@v4
21-
with:
22-
registry-url: 'https://registry.npmjs.org'
23-
node-version: '>=24.7.0' # Trusted publishing requires npm CLI version 11.5.1 or later.
24-
- run: npm i
25-
- if: ${{ github.event_name == 'push' }}
26-
run: |
27-
PACKAGE_NAME=$(jq --raw-output .name package.json)
28-
npm version prerelease --preid=snapshot --no-git-tag-version
29-
PREFIX=$(jq --raw-output .version package.json | sed 's/\.[0-9]\+$//')
30-
NEXT=$(npm view $PACKAGE_NAME versions --json \
31-
| jq --raw-output --arg prefix $PREFIX '[.[] | select(startswith($prefix))|capture("snapshot\\.(?<n>[0-9]+)").n|tonumber]|max + 1 // 0')
32-
npm version $PREFIX.$NEXT --no-git-tag-version
33-
echo "TAG=snapshot" >> $GITHUB_ENV
34-
- if: ${{ github.event_name == 'release' }}
35-
run: |
36-
npm version $(echo ${{ github.release.tag_name }} | sed 's/^v//') --no-git-tag-version
37-
echo "TAG=latest" >> $GITHUB_ENV
38-
- id: publish
39-
run: |
40-
npm run build
41-
npm publish --provenance --access public --tag $TAG
42-
echo "url=https://www.npmjs.com/package/@waves/ts-lib-crypto/v/$(jq --raw-output .version package.json)" >> "$GITHUB_OUTPUT"
9+
publish:
10+
uses: wavesplatform/publish-to-npm/.github/workflows/publish.yml@7d9462af686d83552d72097bf47a892e43d11f6e
11+
with:
12+
environment: NPMJS
13+
event_name: ${{ github.event_name }}
14+
test: true
15+
version: ${{ github.event.release.tag_name }}
16+
permissions:
17+
id-token: write
18+
contents: read

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
node_modules
32
cjs
43
dist
@@ -7,3 +6,4 @@ coverage
76
.idea
87
test/_state.ts
98
.DS_Store
9+
package-lock.json

0 commit comments

Comments
 (0)