-
-
Notifications
You must be signed in to change notification settings - Fork 2
95 lines (84 loc) · 2.89 KB
/
node.js.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
name: Build Management
on:
push:
branches: [main, develop]
pull_request:
branches: [develop]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Use Node.js
uses: actions/setup-node@v1
with:
node-version: "20.x"
registry-url: "https://registry.npmjs.org"
- name: Install Yarn
run: npm install -g yarn
- name: Install Dependencies
run: yarn install
- name: Lint Package
run: npx lerna run lint
- name: Test Package
run: npx lerna run test
- name: Verify Building Package
run: npx lerna run build
pre_release:
runs-on: ubuntu-latest
needs: build
if: ${{ github.ref == 'refs/heads/develop' && github.event_name == 'push' }}
steps:
- uses: actions/checkout@v2
- name: Use Node.js
uses: actions/setup-node@v1
with:
node-version: "20.x"
registry-url: "https://registry.npmjs.org"
- name: Install Yarn
run: npm install -g yarn
- name: Install Dependencies
run: yarn install
- name: Build Package
run: npx lerna run build
- name: Publish Package
run: |
rm -rf packages/core/src/tools/__generated__
npx lerna publish $(yarn --silent ci:version)-pre.${{ github.run_number }} --exact --yes --no-git-tag-version --dist-tag next
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
release:
runs-on: ubuntu-latest
needs: build
if: ${{ github.ref == 'refs/heads/main' && github.event_name == 'push' }}
steps:
- uses: actions/checkout@v2
- name: Use Node.js
uses: actions/setup-node@v1
with:
node-version: "20.x"
registry-url: "https://registry.npmjs.org"
- name: Install Yarn
run: npm install -g yarn
- name: Install Dependencies
run: yarn install
- name: Build Package
run: npx lerna run build
- name: Publish Package
run: |
git config --global user.email "[email protected]"
git config --global user.name "github-actions-bot"
yarn ci:version --update
rm -rf packages/core/src/tools/__generated__
git add CHANGELOG.md
git commit -m "updated release date"
npx lerna publish $(yarn --silent ci:version) --exact --yes --dist-tag latest --message '[skip ci] publish release'
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
- name: Deploy Website
run: |
git remote set-url origin https://git:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git
cp packages/example-app/dist/release/index.html packages/example-app/dist/release/404.html
yarn ci:deploy -- -u "github-actions-bot <[email protected]>"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}