Skip to content

Commit

Permalink
chore: Update publish_package workflow to trigger only on the feat/dy…
Browse files Browse the repository at this point in the history
…namic-token-list branch
  • Loading branch information
trungbach committed Nov 6, 2024
1 parent 23b5238 commit 64b0d98
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 2 deletions.
63 changes: 63 additions & 0 deletions .github/workflows/publish_package.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
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: [feat/dynamic-token-list]

# 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: 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 packages/common
env:
CI: false
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 packages/common/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@oraichain/common",
"version": "1.1.2",
"version": "1.1.2-beta",
"main": "build/index.js",
"license": "MIT",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion packages/common/src/constants/chain-registry.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export const CHAIN_REGISTRY_BACKEND_ENDPOINTS = {
// FIXME: setup a basic backend & URL for fetching & storing all chain infos
BASE_URL: "https://",
BASE_URL: "https://oraicommon-staging.oraidex.io",
BASE_ENDPOINT: "/api/v1",
CHAIN_INFOS: "/chains"
} as const;
Expand Down

0 comments on commit 64b0d98

Please sign in to comment.