Skip to content

Commit

Permalink
Merge pull request #25 from oraichain/feat/workflow-publish-package
Browse files Browse the repository at this point in the history
Feat/workflow publish package
  • Loading branch information
vuonghuuhung authored Dec 11, 2024
2 parents 9334151 + 0ad66a0 commit 2548b8a
Show file tree
Hide file tree
Showing 4 changed files with 76 additions and 6 deletions.
70 changes: 70 additions & 0 deletions .github/workflows/publish_package.yml
Original file line number Diff line number Diff line change
@@ -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/[email protected]
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 [email protected] --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 }}"
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
4 changes: 2 additions & 2 deletions packages/common/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@oraichain/common",
"version": "1.2.3",
"version": "1.2.4",
"main": "build/index.js",
"license": "MIT",
"scripts": {
Expand All @@ -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"
},
Expand Down
6 changes: 3 additions & 3 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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"
Expand Down

0 comments on commit 2548b8a

Please sign in to comment.