Skip to content

Commit 5505dd6

Browse files
committed
💚 修复ci构建
1 parent 8cc8637 commit 5505dd6

File tree

3 files changed

+41
-33
lines changed

3 files changed

+41
-33
lines changed

.github/workflows/build.yaml

Lines changed: 32 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -4,34 +4,42 @@ on:
44
push:
55
branches:
66
- main
7-
- develop/*
7+
- test/*
88

99
jobs:
1010
build-deploy:
1111
runs-on: ubuntu-latest
12-
12+
name: Build
1313
steps:
14-
- uses: actions/checkout@v2
15-
- name: Use Node.js
16-
uses: actions/setup-node@v1
17-
with:
18-
node-version: '16.x'
14+
- uses: actions/checkout@v2
15+
- name: Use Node.js
16+
uses: actions/setup-node@v1
17+
with:
18+
node-version: '16.x'
19+
20+
- name: Cache Node.js modules
21+
uses: actions/cache@v2
22+
with:
23+
path: ~/.npm
24+
key: ${{ runner.OS }}-node-${{ hashFiles('**/package-lock.json') }}
25+
restore-keys: |
26+
${{ runner.OS }}-node-
27+
${{ runner.OS }}-
1928
20-
- name: Cache Node.js modules
21-
uses: actions/cache@v2
22-
with:
23-
path: ~/.npm
24-
key: ${{ runner.OS }}-node-${{ hashFiles('**/package-lock.json') }}
25-
restore-keys: |
26-
${{ runner.OS }}-node-
27-
${{ runner.OS }}-
29+
- name: Package with Node
30+
env:
31+
CHROME_PEM: ${{ secrets.CHROME_PEM }}
32+
run: |
33+
mkdir dist
34+
echo "$CHROME_PEM" > ./dist/scriptcat.pem
35+
chmod 600 ./dist/scriptcat.pem
36+
npm ci
37+
npm run pack
2838
29-
- name: Package with Node
30-
env:
31-
CHROME_PEM: ${{ secrets.CHROME_PEM }}
32-
run: |
33-
mkdir dist
34-
echo "$CHROME_PEM" > ./dist/scriptcat.pem
35-
chmod 600 ./dist/scriptcat.pem
36-
npm ci
37-
npm run pack
39+
- name: Archive production artifacts
40+
uses: actions/upload-artifact@v3
41+
with:
42+
name: scriptcat-extension
43+
path: |
44+
dist/*.zip
45+
dist/*.crx

.github/workflows/packageRelease.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
- name: Use Node.js
1616
uses: actions/setup-node@v1
1717
with:
18-
node-version: "14.x"
18+
node-version: "16.x"
1919

2020
- name: Cache Node.js modules
2121
uses: actions/cache@v2
@@ -33,7 +33,7 @@ jobs:
3333
mkdir dist
3434
echo "$CHROME_PEM" > ./dist/scriptcat.pem
3535
chmod 600 ./dist/scriptcat.pem
36-
npm ci
36+
npm ci
3737
npm test
3838
npm run pack
3939
@@ -57,8 +57,8 @@ jobs:
5757
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5858
with:
5959
upload_url: ${{ steps.create_release.outputs.upload_url }}
60-
asset_path: ./dist/scriptcat-${{ github.ref }}-chrome.zip
61-
asset_name: scriptcat-${{ github.ref }}-chrome.zip
60+
asset_path: ./dist/scriptcat-${{ github.ref_name }}-chrome.zip
61+
asset_name: scriptcat-${{ github.ref_name }}-chrome.zip
6262
asset_content_type: application/zip
6363

6464
- name: Upload FireFox Release Asset zip
@@ -68,8 +68,8 @@ jobs:
6868
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6969
with:
7070
upload_url: ${{ steps.create_release.outputs.upload_url }}
71-
asset_path: ./dist/scriptcat-${{ github.ref }}-firefox.zip
72-
asset_name: scriptcat-${{ github.ref }}-firefox.zip
71+
asset_path: ./dist/scriptcat-${{ github.ref_name }}-firefox.zip
72+
asset_name: scriptcat-${{ github.ref_name }}-firefox.zip
7373
asset_content_type: application/zip
7474

7575
- name: Upload Crx Release Asset zip
@@ -79,6 +79,6 @@ jobs:
7979
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
8080
with:
8181
upload_url: ${{ steps.create_release.outputs.upload_url }}
82-
asset_path: ./dist/scriptcat-${{ github.ref }}-chrome.crx
83-
asset_name: scriptcat-${{ github.ref }}-chrome.crx
82+
asset_path: ./dist/scriptcat-${{ github.ref_name }}-chrome.crx
83+
asset_name: scriptcat-${{ github.ref_name }}-chrome.crx
8484
asset_content_type: application/zip

.github/workflows/test.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
- name: Unit Test
3131
run: |
3232
npm ci
33-
npm run test
33+
npm test
3434
3535
- name: Upload coverage reports to Codecov with GitHub Action
3636
uses: codecov/codecov-action@v3

0 commit comments

Comments
 (0)