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
81 lines (77 loc) · 2.36 KB
/
publish-edge.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
name: Publish Edge
on:
push:
branches:
- develop
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-edge:
name: Publish Edge
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 Edge
run: |
. ./scripts/publish-utils.sh
setup_git
COMMIT=${GITHUB_SHA:0:7}
sed -i "s/ \"version\": \"\([0-9]\+\).\([0-9]\+\).\([0-9]\+\)/&-$GITHUB_RUN_NUMBER-$COMMIT/" package.json
git commit -a -m "Updating version [skip ci]" --allow-empty
npm publish --access public --tag edge
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
services:
nodeos:
image: eosio/eosjs-ci:develop
ports:
- 8888:8888
- 9876:9876