Skip to content

Commit

Permalink
💚 修复ci构建
Browse files Browse the repository at this point in the history
  • Loading branch information
CodFrm committed Oct 27, 2022
1 parent 8cc8637 commit 5505dd6
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 33 deletions.
56 changes: 32 additions & 24 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,34 +4,42 @@ on:
push:
branches:
- main
- develop/*
- test/*

jobs:
build-deploy:
runs-on: ubuntu-latest

name: Build
steps:
- uses: actions/checkout@v2
- name: Use Node.js
uses: actions/setup-node@v1
with:
node-version: '16.x'
- uses: actions/checkout@v2
- name: Use Node.js
uses: actions/setup-node@v1
with:
node-version: '16.x'

- name: Cache Node.js modules
uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.OS }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.OS }}-node-
${{ runner.OS }}-
- name: Cache Node.js modules
uses: actions/cache@v2
with:
path: ~/.npm
key: ${{ runner.OS }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.OS }}-node-
${{ runner.OS }}-
- name: Package with Node
env:
CHROME_PEM: ${{ secrets.CHROME_PEM }}
run: |
mkdir dist
echo "$CHROME_PEM" > ./dist/scriptcat.pem
chmod 600 ./dist/scriptcat.pem
npm ci
npm run pack
- name: Package with Node
env:
CHROME_PEM: ${{ secrets.CHROME_PEM }}
run: |
mkdir dist
echo "$CHROME_PEM" > ./dist/scriptcat.pem
chmod 600 ./dist/scriptcat.pem
npm ci
npm run pack
- name: Archive production artifacts
uses: actions/upload-artifact@v3
with:
name: scriptcat-extension
path: |
dist/*.zip
dist/*.crx
16 changes: 8 additions & 8 deletions .github/workflows/packageRelease.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
- name: Use Node.js
uses: actions/setup-node@v1
with:
node-version: "14.x"
node-version: "16.x"

- name: Cache Node.js modules
uses: actions/cache@v2
Expand All @@ -33,7 +33,7 @@ jobs:
mkdir dist
echo "$CHROME_PEM" > ./dist/scriptcat.pem
chmod 600 ./dist/scriptcat.pem
npm ci
npm ci
npm test
npm run pack
Expand All @@ -57,8 +57,8 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./dist/scriptcat-${{ github.ref }}-chrome.zip
asset_name: scriptcat-${{ github.ref }}-chrome.zip
asset_path: ./dist/scriptcat-${{ github.ref_name }}-chrome.zip
asset_name: scriptcat-${{ github.ref_name }}-chrome.zip
asset_content_type: application/zip

- name: Upload FireFox Release Asset zip
Expand All @@ -68,8 +68,8 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./dist/scriptcat-${{ github.ref }}-firefox.zip
asset_name: scriptcat-${{ github.ref }}-firefox.zip
asset_path: ./dist/scriptcat-${{ github.ref_name }}-firefox.zip
asset_name: scriptcat-${{ github.ref_name }}-firefox.zip
asset_content_type: application/zip

- name: Upload Crx Release Asset zip
Expand All @@ -79,6 +79,6 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./dist/scriptcat-${{ github.ref }}-chrome.crx
asset_name: scriptcat-${{ github.ref }}-chrome.crx
asset_path: ./dist/scriptcat-${{ github.ref_name }}-chrome.crx
asset_name: scriptcat-${{ github.ref_name }}-chrome.crx
asset_content_type: application/zip
2 changes: 1 addition & 1 deletion .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
- name: Unit Test
run: |
npm ci
npm run test
npm test
- name: Upload coverage reports to Codecov with GitHub Action
uses: codecov/codecov-action@v3

0 comments on commit 5505dd6

Please sign in to comment.