-
Notifications
You must be signed in to change notification settings - Fork 19
63 lines (53 loc) · 1.88 KB
/
publish-npm-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
name: publish-npm-packages
on: workflow_dispatch
jobs:
publish-packages:
runs-on: ubuntu-latest
env:
TEST_ENDPOINT: dapp-example.onekeytest.com
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
registry-url: 'https://registry.npmjs.org'
cache: 'yarn'
- name: Install Packages
# global env make ci `yarn && yarn bootstrap` not correctly
# fix src/classes.ts(2,27): error TS2307: Cannot find module 'fast-safe-stringify'
# exec `yarn bootstrap` twice
run: |
yarn
yarn bootstrap
yarn bootstrap
NODE_ENV=production yarn build
yarn test
yarn lint
- name: Publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
# TODO check published packages injected is minified
run: |
git reset --hard
NODE_ENV=production yarn publish-packages -y --no-verify-access
- name: Sleep for 90 seconds
uses: jakejarvis/wait-action@master
with:
time: '90s'
- name: Write Example .env
run: |
# Next.js environment variables
echo "NEXT_PUBLIC_WALLET_CONNECT_PROJECT_ID=${{ secrets.WALLET_CONNECT_PROJECT_ID }}" > ./packages/example/.env
echo "NEXT_PUBLIC_BLOCKFROST_CARDANO_PROJECT_ID=${{ secrets.BLOCKFROST_CARDANO_PROJECT_ID }}" >> ./packages/example/.env
- name: Build Example Web
run: |
yarn clean-workspace
yarn example-build
cp ./packages/example/out/index.html ./packages/example/out/404.html
- name: Deploy Github Pages
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./packages/example/out
cname: ${{ env.TEST_ENDPOINT }}
force_orphan: true