Skip to content

Commit 8e4f146

Browse files
committed
💚 improve the CD script
Now the action will be triggered only when a new tag starting with v* is pushed. The release will then be published and the library will be built and published as well.
1 parent 6013b5e commit 8e4f146

File tree

1 file changed

+16
-13
lines changed

1 file changed

+16
-13
lines changed

.github/workflows/release-package.yml

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,27 @@
1-
name: Node.js Package
2-
3-
# This workflow will run whenever a new release is created in our repository
4-
# If the tests and the build pass, then the package will be published to GitHub Packages
1+
name: Publish package to GitHub Packages
52

3+
# Trigger the create release workflow
64
on:
7-
release:
8-
types: [created]
5+
push:
6+
tags:
7+
- "v*"
98

109
jobs:
11-
build:
10+
release:
11+
name: Create Release
1212
runs-on: ubuntu-latest
1313
steps:
14-
- uses: actions/checkout@v3
15-
- uses: actions/setup-node@v3
14+
- name: Checkout code
15+
uses: actions/checkout@v2
16+
- name: Create Release
17+
id: create_release
18+
uses: "marvinpinto/[email protected]"
1619
with:
17-
node-version: 18
18-
- run: npm ci
19-
- run: npm test
20+
repo_token: "${{ secrets.SMOOTH_QDQD_SECP256R1_RELEASE_TOKEN }}"
21+
prerelease: false
2022

2123
publish-gpr:
22-
needs: build
24+
needs: release # wait for the release job to finish
2325
runs-on: ubuntu-latest
2426
permissions:
2527
packages: write
@@ -31,6 +33,7 @@ jobs:
3133
node-version: 18
3234
registry-url: https://npm.pkg.github.com/
3335
- run: npm ci
36+
- run: npm run test
3437
- run: npm run build
3538
- run: npm publish
3639
env:

0 commit comments

Comments
 (0)