Skip to content

Commit 7058f0a

Browse files
初始化 github workflow 用于自动打包
1 parent 6d4b9e8 commit 7058f0a

File tree

1 file changed

+43
-0
lines changed

1 file changed

+43
-0
lines changed

.github/workflows/build.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Build Userscript
2+
3+
on:
4+
push:
5+
branches: ['main']
6+
pull_request:
7+
branches: ['main']
8+
9+
jobs:
10+
build:
11+
name: Build
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v3
15+
16+
- name: Enable Corepack
17+
run: corepack enable
18+
19+
- name: Set Node.js 22.2.0
20+
uses: actions/setup-node@v3
21+
with:
22+
node-version: 22.2.0
23+
cache: 'yarn'
24+
25+
- name: Install dependencies
26+
uses: borales/actions-yarn@v4
27+
with:
28+
cmd: install --frozen-lockfile
29+
env:
30+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} # if needed
31+
- name: Build
32+
uses: borales/actions-yarn@v4
33+
with:
34+
cmd: build
35+
36+
- name: Rename artifact
37+
run: cp dist/main.user.js /tmp/lg-admin-extend.user.js
38+
39+
- name: Upload artifact
40+
uses: actions/upload-artifact@v4.3.6
41+
with:
42+
name: lg-admin-extend
43+
path: /tmp/lg-admin-extend.user.js

0 commit comments

Comments
 (0)