-
Notifications
You must be signed in to change notification settings - Fork 10
98 lines (87 loc) · 3.02 KB
/
publish_package.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
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: [main]
# 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:
# This workflow contains 1 job called "build"
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 Oraidex Common
id: publish-common
continue-on-error: true
run: yarn deploy packages/oraidex-common
env:
CI: false
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Publish Universal-swap
id: publish-universal-swap
continue-on-error: true
run: yarn deploy packages/universal-swap
env:
CI: false
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Publish Oraidex contracts-sdk
id: publish-oraidex-contracts-sdk
continue-on-error: true
run: yarn deploy packages/contracts-sdk
env:
CI: false
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Publish Oraidex contracts-build
id: publish-oraidex-contracts-build
continue-on-error: true
run: yarn deploy packages/contracts-build
env:
CI: false
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Publish Oraidex oraiswap-v3
id: publish-oraiswap-v3
continue-on-error: true
run: yarn deploy packages/oraiswap-v3
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 oraidex-sdk has just published. result: ${{ steps.publish.outcome }}."