From a3f877deae73e30b1d070a28ce34a9f95eba3c54 Mon Sep 17 00:00:00 2001 From: Dmytro Stebaiev Date: Thu, 15 Aug 2024 18:20:42 +0300 Subject: [PATCH 1/5] Update workflows and ethers --- .github/workflows/publish.yml | 38 ++++++++++---------------------- .github/workflows/test.yml | 29 +++++------------------- package.json | 2 +- src/submitters/auto-submitter.ts | 7 +++--- 4 files changed, 23 insertions(+), 53 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 2b7c401..4900ff5 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -1,4 +1,6 @@ -name: Build and publish +# cspell:words ncipollo + +name: publish on: push: branches-ignore: @@ -17,27 +19,15 @@ env: jobs: build: runs-on: ubuntu-latest + if: github.event_name != 'pull_request' || github.event.pull_request.merged == true steps: - - uses: actions/checkout@v2 - - - name: Get yarn cache directory path - id: yarn-cache-dir-path - run: echo "::set-output name=dir::$(yarn cache dir)" - - - uses: actions/cache@v2 - id: yarn-cache - with: - path: ${{ steps.yarn-cache-dir-path.outputs.dir }} - key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} - restore-keys: | - ${{ runner.os }}-yarn- + - uses: actions/checkout@v4 - name: Set up Node - uses: actions/setup-node@v2 + uses: actions/setup-node@v3 with: node-version: ${{ env.NODE_VERSION }} - registry-url: 'https://registry.npmjs.org' - always-auth: true + cache: 'yarn' - name: Install project run: | @@ -65,26 +55,22 @@ jobs: NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} - name: Create Release - id: create_release - uses: actions/create-release@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + uses: ncipollo/release-action@v1 with: - tag_name: ${{ env.VERSION }} - release_name: ${{ env.VERSION }} + tag: ${{ env.VERSION }} prerelease: ${{ env.PRERELEASE }} clean: runs-on: ubuntu-latest if: github.event.pull_request.merged steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Set up Node - uses: actions/setup-node@v2 + uses: actions/setup-node@ve with: node-version: ${{ env.NODE_VERSION }} - registry-url: 'https://registry.npmjs.org' + cache: 'yarn' - name: Remove feature tag env: diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 380230d..4f1e3b1 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,4 +1,4 @@ -name: Build and test +name: test on: [push, pull_request] env: @@ -13,36 +13,19 @@ jobs: node-version: [18.x, 20.x] steps: - - uses: actions/checkout@v2 - - - name: Get yarn cache directory path - id: yarn-cache-dir-path - run: echo "::set-output name=dir::$(yarn cache dir)" - - - uses: actions/cache@v2 - id: yarn-cache - with: - path: ${{ steps.yarn-cache-dir-path.outputs.dir }} - key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} - restore-keys: | - ${{ runner.os }}-yarn- - - - uses: actions/cache@v2 - with: - path: ~/.cache/pip - key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} - restore-keys: | - ${{ runner.os }}-pip- + - uses: actions/checkout@v4 - name: Install NODE JS - uses: actions/setup-node@v2 + uses: actions/setup-node@v3 with: node-version: ${{ matrix.node-version }} + cache: 'yarn' - name: Set up Python - uses: actions/setup-python@v2 + uses: actions/setup-python@v4 with: python-version: ${{ env.PYTHON_VERSION }} + cache: 'pip' - name: Install project run: yarn install diff --git a/package.json b/package.json index 1c68913..cc8825f 100644 --- a/package.json +++ b/package.json @@ -52,7 +52,7 @@ "@openzeppelin/hardhat-upgrades": "^3.1.1", "@openzeppelin/upgrades-core": "^1.27.1", "@types/mocha": "^9.1.0", - "ethers": "^6.1.0", + "ethers": "^6.7.1", "hardhat": "^2.9.9" } } diff --git a/src/submitters/auto-submitter.ts b/src/submitters/auto-submitter.ts index 3d097e7..ca123f8 100644 --- a/src/submitters/auto-submitter.ts +++ b/src/submitters/auto-submitter.ts @@ -1,4 +1,4 @@ -import hre, {ethers} from "hardhat"; +import {Transaction, ethers} from "ethers"; import {EXIT_CODES} from "../exitCodes"; import {EoaSubmitter} from "./eoa-submitter"; import {MARIONETTE_ADDRESS} from "./types/marionette"; @@ -7,9 +7,10 @@ import { } from "./safe-ima-legacy-marionette-submitter"; import {SafeSubmitter} from "./safe-submitter"; import {Submitter} from "./submitter"; -import {Transaction} from "ethers"; + import {Upgrader} from "../upgrader"; import chalk from "chalk"; +import hre from "hardhat"; import {skaleContracts} from "@skalenetwork/skale-contracts-ethers-v6"; @@ -110,7 +111,7 @@ export class AutoSubmitter extends Submitter { process.exit(EXIT_CODES.UNKNOWN_IMA); } const contractsNetwork = - await skaleContracts.getNetworkByProvider(ethers.provider); + await skaleContracts.getNetworkByProvider(hre.ethers.provider); const ima = await contractsNetwork.getProject("ima"); return await ima.getInstance(process.env.IMA); } From 1ea578c6ed64afc197c1e58828a9faffce5e49a9 Mon Sep 17 00:00:00 2001 From: Dmytro Stebaiev Date: Thu, 15 Aug 2024 19:12:05 +0300 Subject: [PATCH 2/5] Remove python installation --- .github/workflows/test.yml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 4f1e3b1..3cebdaa 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -21,12 +21,6 @@ jobs: node-version: ${{ matrix.node-version }} cache: 'yarn' - - name: Set up Python - uses: actions/setup-python@v4 - with: - python-version: ${{ env.PYTHON_VERSION }} - cache: 'pip' - - name: Install project run: yarn install From aeb5920c1431c181b33ab7ac182d1fb2e6f273a3 Mon Sep 17 00:00:00 2001 From: Dmytro Stebaiev Date: Thu, 15 Aug 2024 19:15:47 +0300 Subject: [PATCH 3/5] Update trigger --- .github/workflows/publish.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 4900ff5..497c663 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -19,7 +19,6 @@ env: jobs: build: runs-on: ubuntu-latest - if: github.event_name != 'pull_request' || github.event.pull_request.merged == true steps: - uses: actions/checkout@v4 From fc434d601eb2ad5030a795f6a2af464c0499a4a2 Mon Sep 17 00:00:00 2001 From: Dmytro Stebaiev Date: Thu, 15 Aug 2024 19:19:03 +0300 Subject: [PATCH 4/5] Add npm auth --- .github/workflows/publish.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 497c663..1ce0d21 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -26,6 +26,7 @@ jobs: uses: actions/setup-node@v3 with: node-version: ${{ env.NODE_VERSION }} + always-auth: true cache: 'yarn' - name: Install project From 3f427314cc0870318de9daabf1756c118ec8f243 Mon Sep 17 00:00:00 2001 From: Dmytro Stebaiev Date: Thu, 15 Aug 2024 19:21:35 +0300 Subject: [PATCH 5/5] Add registry --- .github/workflows/publish.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 1ce0d21..ac67c2a 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -26,6 +26,7 @@ jobs: uses: actions/setup-node@v3 with: node-version: ${{ env.NODE_VERSION }} + registry-url: 'https://registry.npmjs.org' always-auth: true cache: 'yarn'