This repository has been archived by the owner on Aug 2, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 462
133 lines (126 loc) · 3.67 KB
/
publish-release.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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
name: Publish
on:
release:
types: [published]
jobs:
check-tokens:
name: "Check NPM Token"
runs-on: ubuntu-18.04
steps:
- name: Check for NPM_AUTH_TOKEN
id: check_token
run: echo ::set-output name=token_exists::${HAS_SECRET}
env:
HAS_SECRET: ${{ secrets.NPM_AUTH_TOKEN != null }}
- name: Succeed job on existing NPM_AUTH_TOKEN
if: ${{ steps.check_token.outputs.token_exists == 'true' }}
uses: actions/github-script@v5
with:
script: |
core.setOutput('Success. NPM_AUTH_TOKEN is present in repository secrets.');
- name: Fail on missing NPM_AUTH_TOKEN
if: ${{ steps.check_token.outputs.token_exists == 'false' }}
uses: actions/github-script@v5
with:
script: |
core.setFailed('Failure: No NPM_AUTH_TOKEN present in repository secrets.');
publish-release:
if: "!github.event.release.prerelease"
name: Publish Release
runs-on: ubuntu-18.04
needs: check-tokens
steps:
- name: Checkout
uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579
- name: Setup Node.js v16.x.x
uses: actions/setup-node@2fddd8803e2f5c9604345a0b591c3020ee971a93
with:
node-version: '16'
registry-url: 'https://registry.npmjs.org'
- name: Install
run: |
yarn --frozen-lockfile
- name: Lint
run: |
yarn lint
- name: Test
run: |
yarn test
- name: Test Node
run: |
yarn test-node
- name: Test Types
run: |
yarn test-types
- name: Build
run: |
yarn build-web
- name: Test Web
uses: cypress-io/github-action@2113e5bc19c45979ba123df6e07256d2aaba9a33
with:
spec: cypress/integration/index.spec.js
- name: Publish Release
run: |
. ./scripts/publish-utils.sh
setup_git
ensure_version_match
git commit -a -m "Updating version [skip ci]" --allow-empty
npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
services:
nodeos:
image: eosio/eosjs-ci:release_2.2.x
ports:
- 8888:8888
- 9876:9876
publish-rc:
if: "github.event.release.prerelease"
name: Publish RC
runs-on: ubuntu-18.04
needs: check-tokens
steps:
- name: Checkout
uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579
- name: Setup Node.js v16.x.x
uses: actions/setup-node@2fddd8803e2f5c9604345a0b591c3020ee971a93
with:
node-version: '16'
registry-url: 'https://registry.npmjs.org'
- name: Install
run: |
yarn --frozen-lockfile
- name: Lint
run: |
yarn lint
- name: Test
run: |
yarn test
- name: Test Node
run: |
yarn test-node
- name: Test Types
run: |
yarn test-types
- name: Build
run: |
yarn build-web
- name: Test Web
uses: cypress-io/github-action@2113e5bc19c45979ba123df6e07256d2aaba9a33
with:
spec: cypress/integration/index.spec.js
- name: Publish RC
run: |
. ./scripts/publish-utils.sh
setup_git
ensure_version_match
git commit -a -m "Updating version [skip ci]" --allow-empty
npm publish --access public --tag RC
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
services:
nodeos:
image: eosio/eosjs-ci:release_2.2.x
ports:
- 8888:8888
- 9876:9876