-
Notifications
You must be signed in to change notification settings - Fork 21
92 lines (76 loc) · 2.53 KB
/
e2e.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
name: install_and_publish
on:
push:
branches:
- feature/e2e_pipeline
jobs:
install:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ~/etherspot-sdk
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 18
- name: Authenticate with registry
run: echo "//registry.npmjs.org/:_authToken=${{ secrets.ETHERSPOT_NPM_TOKEN }}" > ~/etherspot-sdk/.npmrc
- name: Restore cache
uses: actions/cache@v3
with:
path: ./node_modules
key: dependency-cache-${{ hashFiles('package.json') }}
restore-keys: dependency-cache-*
- name: Install dependencies
run: npm install
- name: Save cache
uses: actions/cache@v3
with:
path: ./node_modules
key: dependency-cache-${{ hashFiles('package.json') }}
publish:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ~/etherspot-sdk
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 18
- name: Restore cache
uses: actions/cache@v3
with:
path: ./node_modules
key: dependency-cache-${{ hashFiles('package.json') }}
restore-keys: dependency-cache-*
- name: Authenticate with registry
run: echo "//registry.npmjs.org/:_authToken=${{ secrets.ETHERSPOT_NPM_TOKEN }}" > ~/etherspot-sdk/.npmrc
- name: Build Etherpot-SDK
run: npm run build
- name: Checkout e2e repo and run tests
run: |
git clone https://github.com/etherspot/e2e-sdk.git
cd e2e-sdk
sed -i.bak "s/_private_key_/${{ secrets.PRIVATE_KEY }}/g" .env
mv package.json temp.json
jq -r '.dependencies.etherspot |= "file:../etherspot-sdk"' temp.json > package.json
rm temp.json
npm i
# npm run test-mainnet
- name: Install gh cli
run: |
sudo apt update
sudo apt install gh
- name: Get package version
run: |
PACKAGE_VERSION="$(jq .version package.json -r)"
echo $PACKAGE_VERSION
- name: Publish release
run: |
ghr -t ${{ secrets.GITHUB_TOKEN }} -u ${{ secrets.GITHUB_USERNAME }} -r ${{ github.repository }} -c ${{ github.sha }} $PACKAGE_VERSION