Skip to content
This repository was archived by the owner on Apr 3, 2023. It is now read-only.

Commit 3801a72

Browse files
authored
Use node 16 for publishing + Add build step (#23)
* Use node 16 for publishing The reason is github actions issue on running `npm ci` that requires using git. [https://github.com/actions/setup-node/issues/214](the issue that discusses this problem) * Add build action * Fix build * remove node 12 * Fix evm build on node 14 * Add node 18
1 parent f4a64c7 commit 3801a72

File tree

2 files changed

+67
-3
lines changed

2 files changed

+67
-3
lines changed

.github/workflows/build.yml

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
name: Publish Pyth SDK to crates.io
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches: [main]
7+
jobs:
8+
publish-pyth-common-js:
9+
name: Publish Pyth Common JS
10+
runs-on: ubuntu-latest
11+
strategy:
12+
matrix:
13+
node-version: [14.x, 16.x, 18.x]
14+
steps:
15+
- uses: actions/checkout@v2
16+
- name: Use Node.js ${{ matrix.node-version }}
17+
uses: actions/setup-node@v2
18+
with:
19+
node-version: ${{ matrix.node-version }}
20+
- run: npm ci
21+
working-directory: "pyth-common-js"
22+
- run: npm run build
23+
working-directory: "pyth-common-js"
24+
publish-pyth-evm-js:
25+
name: Publish Pyth EVM JS
26+
runs-on: ubuntu-latest
27+
strategy:
28+
matrix:
29+
node-version: [14.x, 16.x, 18.x]
30+
steps:
31+
- uses: actions/checkout@v2
32+
with:
33+
persist-credentials: false
34+
# This step is required for npm 14 to work for installing this
35+
- name: Reconfigure git to use HTTP authentication
36+
run: >
37+
git config --global url."https://github.com/".insteadOf
38+
39+
- name: Use Node.js ${{ matrix.node-version }}
40+
uses: actions/setup-node@v2
41+
with:
42+
node-version: ${{ matrix.node-version }}
43+
- run: npm ci
44+
working-directory: "pyth-evm-js"
45+
- run: npm run build
46+
working-directory: "pyth-evm-js"
47+
publish-pyth-terra-js:
48+
name: Publish Pyth Common JS
49+
runs-on: ubuntu-latest
50+
strategy:
51+
matrix:
52+
node-version: [14.x, 16.x, 18.x]
53+
steps:
54+
- uses: actions/checkout@v2
55+
- name: Use Node.js ${{ matrix.node-version }}
56+
uses: actions/setup-node@v2
57+
with:
58+
node-version: ${{ matrix.node-version }}
59+
- run: npm ci
60+
working-directory: "pyth-terra-js"
61+
- run: npm run build
62+
env:
63+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
64+
working-directory: "pyth-terra-js"

.github/workflows/publish.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
- uses: actions/checkout@v2
1414
- uses: actions/setup-node@v2
1515
with:
16-
node-version: "12.x"
16+
node-version: "16"
1717
registry-url: "https://registry.npmjs.org"
1818
- run: npm ci
1919
working-directory: "pyth-common-js"
@@ -29,7 +29,7 @@ jobs:
2929
- uses: actions/checkout@v2
3030
- uses: actions/setup-node@v2
3131
with:
32-
node-version: "12.x"
32+
node-version: "16"
3333
registry-url: "https://registry.npmjs.org"
3434
- run: npm ci
3535
working-directory: "pyth-evm-js"
@@ -45,7 +45,7 @@ jobs:
4545
- uses: actions/checkout@v2
4646
- uses: actions/setup-node@v2
4747
with:
48-
node-version: "12.x"
48+
node-version: "16"
4949
registry-url: "https://registry.npmjs.org"
5050
- run: npm ci
5151
working-directory: "pyth-terra-js"

0 commit comments

Comments
 (0)