From 000a1dce7936cee533b60ccf821c70142d76fcd5 Mon Sep 17 00:00:00 2001 From: Ali Behjati Date: Fri, 15 Jul 2022 13:46:41 +0200 Subject: [PATCH 1/6] 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) --- .github/workflows/publish.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index e586006..4d99570 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -13,7 +13,7 @@ jobs: - uses: actions/checkout@v2 - uses: actions/setup-node@v2 with: - node-version: "12.x" + node-version: "16" registry-url: "https://registry.npmjs.org" - run: npm ci working-directory: "pyth-common-js" @@ -29,7 +29,7 @@ jobs: - uses: actions/checkout@v2 - uses: actions/setup-node@v2 with: - node-version: "12.x" + node-version: "16" registry-url: "https://registry.npmjs.org" - run: npm ci working-directory: "pyth-evm-js" @@ -45,7 +45,7 @@ jobs: - uses: actions/checkout@v2 - uses: actions/setup-node@v2 with: - node-version: "12.x" + node-version: "16" registry-url: "https://registry.npmjs.org" - run: npm ci working-directory: "pyth-terra-js" From 5c4d07d957af882765bd08c61179fee4f5b99c79 Mon Sep 17 00:00:00 2001 From: Ali Behjati Date: Fri, 15 Jul 2022 11:51:35 +0000 Subject: [PATCH 2/6] Add build action --- .github/workflows/build.yml | 60 +++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..362b76d --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,60 @@ +name: Publish Pyth SDK to crates.io + +on: + pull_request: + push: + branches: [main] +jobs: + publish-pyth-common-js: + name: Publish Pyth Common JS + runs-on: ubuntu-latest + strategy: + matrix: + node-version: [12.x, 14.x, 16.x] + steps: + - uses: actions/checkout@v2 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v2 + with: + node-version: ${{ matrix.node-version }} + cache: "npm" + - run: npm ci + working-directory: "pyth-common-js" + - run: npm run build + working-directory: "pyth-common-js" + publish-pyth-evm-js: + name: Publish Pyth EVM JS + runs-on: ubuntu-latest + strategy: + matrix: + node-version: [12.x, 14.x, 16.x] + steps: + - uses: actions/checkout@v2 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v2 + with: + node-version: ${{ matrix.node-version }} + cache: "npm" + - run: npm ci + working-directory: "pyth-evm-js" + - run: npm run build + working-directory: "pyth-evm-js" + publish-pyth-terra-js: + name: Publish Pyth Common JS + runs-on: ubuntu-latest + strategy: + matrix: + node-version: [12.x, 14.x, 16.x] + steps: + - uses: actions/checkout@v2 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v2 + with: + node-version: ${{ matrix.node-version }} + cache: "npm" + - run: npm ci + working-directory: "pyth-terra-js" + - run: npm run build + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + working-directory: "pyth-terra-js" From d81155323cd6671a43e93bcc155d556cb2eb04e4 Mon Sep 17 00:00:00 2001 From: Ali Behjati Date: Fri, 15 Jul 2022 11:54:37 +0000 Subject: [PATCH 3/6] Fix build --- .github/workflows/build.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 362b76d..9e54ed7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -17,7 +17,6 @@ jobs: uses: actions/setup-node@v2 with: node-version: ${{ matrix.node-version }} - cache: "npm" - run: npm ci working-directory: "pyth-common-js" - run: npm run build @@ -34,7 +33,6 @@ jobs: uses: actions/setup-node@v2 with: node-version: ${{ matrix.node-version }} - cache: "npm" - run: npm ci working-directory: "pyth-evm-js" - run: npm run build @@ -51,7 +49,6 @@ jobs: uses: actions/setup-node@v2 with: node-version: ${{ matrix.node-version }} - cache: "npm" - run: npm ci working-directory: "pyth-terra-js" - run: npm run build From e4bb8a4a0ba23e7bedd2fa6ea75c36ba7d761a7d Mon Sep 17 00:00:00 2001 From: Ali Behjati Date: Fri, 15 Jul 2022 11:57:27 +0000 Subject: [PATCH 4/6] remove node 12 --- .github/workflows/build.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9e54ed7..fb85167 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -10,7 +10,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - node-version: [12.x, 14.x, 16.x] + node-version: [14.x, 16.x] steps: - uses: actions/checkout@v2 - name: Use Node.js ${{ matrix.node-version }} @@ -26,7 +26,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - node-version: [12.x, 14.x, 16.x] + node-version: [14.x, 16.x] steps: - uses: actions/checkout@v2 - name: Use Node.js ${{ matrix.node-version }} @@ -42,7 +42,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - node-version: [12.x, 14.x, 16.x] + node-version: [14.x, 16.x] steps: - uses: actions/checkout@v2 - name: Use Node.js ${{ matrix.node-version }} From 3ae4748cdb747ef253c94b23e5af4d4be7b6745a Mon Sep 17 00:00:00 2001 From: Ali Behjati Date: Fri, 15 Jul 2022 12:05:01 +0000 Subject: [PATCH 5/6] Fix evm build on node 14 --- .github/workflows/build.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index fb85167..25a8d9a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -29,6 +29,13 @@ jobs: node-version: [14.x, 16.x] steps: - uses: actions/checkout@v2 + with: + persist-credentials: false + # This step is required for npm 14 to work for installing this + - name: Reconfigure git to use HTTP authentication + run: > + git config --global url."https://github.com/".insteadOf + ssh://git@github.com/ - name: Use Node.js ${{ matrix.node-version }} uses: actions/setup-node@v2 with: From ec04d3c6871b2c8b68a29c782f8e0967d5e7d99e Mon Sep 17 00:00:00 2001 From: Ali Behjati Date: Fri, 15 Jul 2022 12:05:14 +0000 Subject: [PATCH 6/6] Add node 18 --- .github/workflows/build.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 25a8d9a..61cb9cf 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -10,7 +10,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - node-version: [14.x, 16.x] + node-version: [14.x, 16.x, 18.x] steps: - uses: actions/checkout@v2 - name: Use Node.js ${{ matrix.node-version }} @@ -26,7 +26,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - node-version: [14.x, 16.x] + node-version: [14.x, 16.x, 18.x] steps: - uses: actions/checkout@v2 with: @@ -49,7 +49,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - node-version: [14.x, 16.x] + node-version: [14.x, 16.x, 18.x] steps: - uses: actions/checkout@v2 - name: Use Node.js ${{ matrix.node-version }}