Skip to content

Commit 05c3061

Browse files
committed
feat: 发布
1 parent 9eaf4f3 commit 05c3061

1 file changed

Lines changed: 55 additions & 0 deletions

File tree

.github/workflows/release.yml

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
name: CyberEdge-Front Build and Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
permissions:
9+
contents: write
10+
11+
jobs:
12+
build:
13+
name: Build and Release
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- name: Checkout code
18+
uses: actions/checkout@v3
19+
20+
- name: Setup Node.js
21+
uses: actions/setup-node@v4
22+
with:
23+
node-version: '20.11.1'
24+
25+
- name: Cache node modules
26+
uses: actions/cache@v3
27+
with:
28+
path: node_modules
29+
key: ${{ runner.os }}-node-${{ hashFiles('package-lock.json') }}
30+
restore-keys: |
31+
${{ runner.os }}-node-
32+
33+
- name: Install dependencies
34+
run: |
35+
npm install -g npm@latest
36+
npm ci
37+
38+
- name: Build
39+
run: npm run build
40+
env:
41+
NODE_ENV: production
42+
43+
- name: Prepare artifacts
44+
run: |
45+
cd dist
46+
zip -r ../cyberedge-front.zip .
47+
cd ..
48+
49+
- name: Release
50+
uses: softprops/action-gh-release@v1
51+
if: startsWith(github.ref, 'refs/tags/')
52+
with:
53+
files: cyberedge-front.zip
54+
env:
55+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)