From 147af102494b6a6ce6b0fb6b83194f82ff0120a5 Mon Sep 17 00:00:00 2001 From: vuonghuuhung Date: Wed, 11 Dec 2024 15:17:12 +0700 Subject: [PATCH 1/3] feat: add GitHub Actions workflow for package publishing --- .github/workflows/publish_package.yml | 70 +++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 .github/workflows/publish_package.yml diff --git a/.github/workflows/publish_package.yml b/.github/workflows/publish_package.yml new file mode 100644 index 0000000..2ede345 --- /dev/null +++ b/.github/workflows/publish_package.yml @@ -0,0 +1,70 @@ +name: publish_package + +# Controls when the action will run. +on: + # Triggers the workflow on push or pull request events but only for the main branch + push: + branches: [master] + + # Allows you to run this workflow manually from the Actions tab + workflow_dispatch: + +# A workflow run is made up of one or more jobs that can run sequentially or in parallel +jobs: + build: + runs-on: ubuntu-20.04 + strategy: + matrix: + node-version: ["18"] + + steps: + - name: Cancel Previous Runs + uses: styfle/cancel-workflow-action@0.8.0 + with: + access_token: ${{ github.token }} + - uses: actions/checkout@v2 + - name: Use Node.js ${{ matrix.node-version }} + uses: actions/setup-node@v2 + with: + node-version: ${{ matrix.node-version }} + - name: Get yarn cache directory path + id: yarn-cache-dir-path + run: echo "::set-output name=dir::$(yarn cache dir)" + - uses: actions/cache@v4 + id: yarn-cache + with: + path: | + ${{ steps.yarn-cache-dir-path.outputs.dir }} + ./node_modules/ + key: ${{ runner.os }}-yarn-${{ hashFiles('./yarn.lock') }} + restore-keys: | + ${{ runner.os }}-yarn- + + - name: Enable Corepack + run: corepack enable + - name: Prepare Yarn + run: corepack prepare yarn@4.3.1 --activate + + - name: Install Dependencies + if: steps.yarn-cache.outputs.cache-hit != 'true' + run: yarn + - name: Build + run: yarn build + - name: Authenticate with private NPM package + run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_TOKEN }}" > ~/.npmrc + + - name: Publish Oraichain Common + id: publish-oraichain-common + continue-on-error: true + run: yarn deploy:ci + env: + CI: false + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} + - name: send result via discord + uses: appleboy/discord-action@master + with: + webhook_id: ${{ secrets.WEBHOOK_ID }} + webhook_token: ${{ secrets.WEBHOOK_TOKEN }} + username: "GitBot" + message: "Repo oraichain-sdk has just published. @oraichain/common: ${{ steps.publish-oraichain-common.outcome }}. ${{ github.event.head_commit.author.name }}" From 3b239e6dea8306c7513d9f87c235c142f8984a9e Mon Sep 17 00:00:00 2001 From: vuonghuuhung Date: Wed, 11 Dec 2024 15:18:36 +0700 Subject: [PATCH 2/3] chore: update cosmjs-types to version 0.9.0 and bump common package version to 1.2.4 --- package.json | 2 +- packages/common/package.json | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 2af7532..9422723 100644 --- a/package.json +++ b/package.json @@ -32,7 +32,7 @@ "@types/lodash": "^4.17.0", "@types/node": "^20.11.30", "@vitest/coverage-v8": "^2.0.3", - "cosmjs-types": "0.8.0", + "cosmjs-types": "^0.9.0", "cz-conventional-changelog": "^3.3.0", "dotenv": "^16.4.5", "lerna": "^8.1.6", diff --git a/packages/common/package.json b/packages/common/package.json index 706a7e2..a9010ec 100644 --- a/packages/common/package.json +++ b/packages/common/package.json @@ -1,6 +1,6 @@ { "name": "@oraichain/common", - "version": "1.2.3", + "version": "1.2.4", "main": "build/index.js", "license": "MIT", "scripts": { @@ -17,7 +17,7 @@ "axios": "0.21.4", "axios-extensions": "3.1.6", "bech32": "^1.1.4", - "cosmjs-types": "^0.8.0", + "cosmjs-types": "^0.9.0", "ethers": "^5.5.1", "lodash": "^4.17.21" }, From 0ad66a05710d1a3bd85be80e5ddddcd272948440 Mon Sep 17 00:00:00 2001 From: vuonghuuhung Date: Wed, 11 Dec 2024 15:21:04 +0700 Subject: [PATCH 3/3] chore: update cosmjs-types to version 0.9.0 in yarn.lock --- yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yarn.lock b/yarn.lock index 6982976..5630b0c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1615,7 +1615,7 @@ __metadata: axios: "npm:0.21.4" axios-extensions: "npm:3.1.6" bech32: "npm:^1.1.4" - cosmjs-types: "npm:^0.8.0" + cosmjs-types: "npm:^0.9.0" ethers: "npm:^5.5.1" lodash: "npm:^4.17.21" languageName: unknown @@ -3221,7 +3221,7 @@ __metadata: languageName: node linkType: hard -"cosmjs-types@npm:0.8.0, cosmjs-types@npm:^0.8.0": +"cosmjs-types@npm:^0.8.0": version: 0.8.0 resolution: "cosmjs-types@npm:0.8.0" dependencies: @@ -7363,7 +7363,7 @@ __metadata: "@types/lodash": "npm:^4.17.0" "@types/node": "npm:^20.11.30" "@vitest/coverage-v8": "npm:^2.0.3" - cosmjs-types: "npm:0.8.0" + cosmjs-types: "npm:^0.9.0" cz-conventional-changelog: "npm:^3.3.0" dotenv: "npm:^16.4.5" lerna: "npm:^8.1.6"