-
-
Notifications
You must be signed in to change notification settings - Fork 139
232 lines (192 loc) · 5.28 KB
/
release.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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
name: Release kit.zip
on:
push:
branches:
- main
- beta
- alpha
- next
tags:
- "*"
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
test-windows:
runs-on: windows-latest
steps:
- name: Checkout kit
uses: actions/checkout@master
- uses: pnpm/action-setup@v4
name: Install pnpm
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 20.18.1
cache: 'pnpm'
- name: Check node $PATH version
shell: bash
run: |
node --version
pnpm --version
- name: pnpm i
shell: bash
run: |
cd "${{ env.wd_path }}"
pnpm i
- name: pnpm run ava
shell: bash
run: |
pnpm run ava
- name: pnpm run build-kit
shell: bash
env:
KIT: ${{ env.kit_path }}
run: |
pnpm run build-kit
- name: pnpm run test
uses: nick-invision/retry@v3
with:
max_attempts: 3
timeout_minutes: 30
command: |
pnpm run test
env:
KIT: ${{ env.kit_path }}
test-mac-and-ubuntu:
strategy:
matrix:
os: [macos-latest, ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Inject slug/short variables
uses: rlespinasse/github-slug-action@v4
- name: Get Time
id: time
uses: nanzm/[email protected]
with:
timeZone: 8
format: "YYYY-MM-DD-HH-mm-ss"
- name: Checkout kit
uses: actions/checkout@master
- uses: pnpm/action-setup@v4
name: Install pnpm
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 20.18.1
cache: 'pnpm'
- name: Build Kit
run: |
pnpm i
export KIT_NODE_PATH=$(pnpm node -e )
KIT=./.kit pnpm node ./build/build-ci.js
env:
KIT: ${{ env.kit_path }}
- name: Set env vars
run: |
echo "wd_path=$PWD" >> $GITHUB_ENV
echo "kit_path=$PWD/.kit" >> $GITHUB_ENV
echo "release_channel=${{ env.GITHUB_REF_SLUG_URL }}" >> $GITHUB_ENV
- name: Add node and kit to PATH
run: |
echo "${{ env.kit_path }}/bin" >> $GITHUB_PATH
echo "---"
echo "$GITHUB_PATH"
echo "$PATH"
- name: Check node $PATH version
run: |
node --version
npm --version
- name: Log ./.kit
run: |
ls ./.kit/*/*
- name: pnpm i
run: |
cd "${{ env.wd_path }}"
pnpm i
- name: pnpm run ava
run: |
pnpm run ava
- name: npm run test
run: |
npm run test
env:
KIT: ${{ env.kit_path }}
release:
runs-on: macos-latest
needs: [test-windows, test-mac-and-ubuntu]
steps:
- name: Inject slug/short variables
uses: rlespinasse/github-slug-action@v4
- name: Get Time
id: time
uses: nanzm/[email protected]
with:
timeZone: 8
format: "YYYY-MM-DD-HH-mm-ss"
- name: Checkout kit
uses: actions/checkout@master
- uses: pnpm/action-setup@v4
name: Install pnpm
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 20.18.1
cache: 'pnpm'
- name: Build Kit
run: |
pnpm install
KIT=./.kit pnpm node ./build/build-ci.js
- name: Set env vars
run: |
echo "wd_path=$PWD" >> $GITHUB_ENV
echo "kit_path=$PWD/.kit" >> $GITHUB_ENV
echo "release_channel=${{ env.GITHUB_REF_SLUG_URL }}" >> $GITHUB_ENV
- name: Add node and kit to PATH
run: |
echo "${{ env.kit_path }}/bin" >> $GITHUB_PATH
echo "---"
echo "$GITHUB_PATH"
echo "$PATH"
- name: Check node $PATH version
run: |
node --version
pnpm --version
- name: Semantic Release
run: |
cd "${{ env.wd_path }}"
npx semantic-release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Archive Release
uses: thedoctor0/zip-release@master
with:
filename: "kit.zip"
path: ".kit"
- name: Create Draft Release
id: create_release
uses: softprops/action-gh-release@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.time.outputs.time }}
name: ${{ env.release_channel }}
draft: true
prerelease: false
- name: Create and Upload Release
uses: softprops/action-gh-release@v2
with:
files: ./kit.zip
tag_name: ${{ steps.time.outputs.time }}
name: ${{ env.release_channel }}
draft: true
prerelease: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: eregon/publish-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
release_id: ${{ steps.create_release.outputs.id }}