From ce5e44904f9969a98aae086983e4e76321b3fc2a Mon Sep 17 00:00:00 2001 From: sergey filyanin Date: Wed, 2 Oct 2024 15:34:46 +0200 Subject: [PATCH] Create CI-CD-Wallet-Connect-Package.yml --- .../CI-CD-Wallet-Connect-Package.yml | 98 +++++++++++++++++++ 1 file changed, 98 insertions(+) create mode 100644 .github/workflows/CI-CD-Wallet-Connect-Package.yml diff --git a/.github/workflows/CI-CD-Wallet-Connect-Package.yml b/.github/workflows/CI-CD-Wallet-Connect-Package.yml new file mode 100644 index 0000000000..c2e64f2eab --- /dev/null +++ b/.github/workflows/CI-CD-Wallet-Connect-Package.yml @@ -0,0 +1,98 @@ +name: 'CI-CD @gear-js/wallet-connect' + +on: + pull_request: + branches: [main] + paths: + - utils/wallet-connect/** + push: + branches: [main] + paths: + - utils/wallet-connect/** + workflow_dispatch: + +jobs: + wallet-connect-test: + if: github.event_name == 'pull_request' + runs-on: ubuntu-latest + steps: + - name: Cancel previous workflow runs + uses: styfle/cancel-workflow-action@0.4.0 + with: + access_token: ${{ github.token }} + + - uses: actions/checkout@v2 + + - name: Install NodeJS 18.x + uses: actions/setup-node@v2.1.5 + with: + node-version: 18.x + + - name: 'gear-js-wallet: Install dependencies' + working-directory: utils/wallet-connect + run: yarn install + + - name: 'gear-js-wallet: Build pkg' + working-directory: utils/wallet-connect + run: yarn build + + - name: 'gear-js-wallet: Run tests' + working-directory: utils/wallet-connect + run: yarn test + + wallet-connect-build: + if: github.event_name == 'pull_request' + runs-on: ubuntu-latest + steps: + - name: Cancel previous workflow runs + uses: styfle/cancel-workflow-action@0.4.0 + with: + access_token: ${{ github.token }} + + - uses: actions/checkout@v2 + + - name: Install NodeJS 18.x + uses: actions/setup-node@v2.1.5 + with: + node-version: 18.x + + - name: 'vara-ui: Install dependencies' + working-directory: utils/wallet-connect + run: npm install + + - name: 'vara-ui: Build pkg' + working-directory: utils/wallet-connect + run: npm run build + + publish-to-npm: + if: github.event_name == 'push' + runs-on: ubuntu-latest + steps: + - name: 'Checkout' + uses: actions/checkout@v2 + + - name: Use node 18.x + uses: actions/setup-node@v2.1.5 + with: + node-version: 18.x + + - name: '@gear-js/wallet-connect: Check pkg version' + uses: EndBug/version-check@v1 + id: check_gear + with: + file-name: utils/wallet-connect/package.json + file-url: https://unpkg.com/@gear-js/ui@latest/package.json + static-checking: localIsNew + + - name: '@gear-js/wallet-connect: Publish' + if: steps.check_gear.outputs.changed == 'true' + working-directory: utils/wallet-connect + run: | + export token=$(printenv $(printenv GITHUB_ACTOR)) + npm install + npm run build + npm config set //registry.npmjs.org/:_authToken=$token --no-workspaces + npm publish + env: + osipov-mit: ${{ secrets.OSIPOV_NPM_TOKEN }} + nikitayutanov: ${{ secrets.YUTANOV_NPM_TOKEN }}