-
Notifications
You must be signed in to change notification settings - Fork 16
55 lines (52 loc) · 1.38 KB
/
publish.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
name: Publish package
on:
release:
types:
- created
tags:
- "v[0-9]+(\\.[0-9]+)*"
jobs:
build-test:
name: Build and Test
timeout-minutes: 5
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: true
- name: Install node
uses: actions/setup-node@v4
- run: npm install -g yarn
- run: yarn install
- run: yarn build
- run: yarn test
publish:
timeout-minutes: 5
runs-on: ubuntu-latest
needs: [build-test]
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: true
- name: Install node
uses: actions/setup-node@v4
with:
registry-url: "https://registry.npmjs.org"
scope: "@zondax"
- run: npm install -g yarn
- run: yarn install
- run: yarn build
- run: mv README-npm README.md
- name: Get latest release version number
id: get_version
run: echo "version=${GITHUB_REF##*/}" >> $GITHUB_OUTPUT
- name: Show version
run: echo ${{ steps.get_version.outputs.version }}
- name: Update tag
run: npm --no-git-tag-version version ${{ steps.get_version.outputs.version }}
- name: Publish package
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN_PUBLISH_AUTO }}