迁移部分内容
Some checks failed
test / Run tests (push) Failing after 55s
build / Build (push) Failing after 1m18s
Some checks failed
test / Run tests (push) Failing after 55s
build / Build (push) Failing after 1m18s
This commit is contained in:
45
.github/workflows/build.yaml
vendored
Normal file
45
.github/workflows/build.yaml
vendored
Normal file
@ -0,0 +1,45 @@
|
||||
name: build
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
- release/*
|
||||
- dev
|
||||
|
||||
jobs:
|
||||
build-deploy:
|
||||
runs-on: ubuntu-latest
|
||||
name: Build
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Use Node.js
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: 20
|
||||
cache: 'npm'
|
||||
|
||||
- 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: all-artifacts
|
||||
path: |
|
||||
dist/*.zip
|
||||
dist/*.crx
|
||||
|
||||
- name: Archive extension
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: scriptcat
|
||||
path: |
|
||||
dist/ext/*
|
76
.github/workflows/packageRelease.yml
vendored
Normal file
76
.github/workflows/packageRelease.yml
vendored
Normal file
@ -0,0 +1,76 @@
|
||||
name: Auto_Package
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- "*"
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
build-deploy:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Use Node.js
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: 20
|
||||
cache: 'npm'
|
||||
|
||||
- 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 test
|
||||
npm run pack
|
||||
|
||||
- name: Create Release
|
||||
id: create_release
|
||||
uses: actions/create-release@latest
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
|
||||
with:
|
||||
tag_name: ${{ github.ref }}
|
||||
release_name: ${{ github.ref }}
|
||||
body: |
|
||||
'no description'
|
||||
draft: false
|
||||
prerelease: false
|
||||
|
||||
- name: Upload Release Asset zip
|
||||
id: upload-release-asset
|
||||
uses: actions/upload-release-asset@v1
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
with:
|
||||
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
||||
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
|
||||
id: upload-firefox-release-asset
|
||||
uses: actions/upload-release-asset@v1
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
with:
|
||||
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
||||
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
|
||||
id: upload-crx-release-asset
|
||||
uses: actions/upload-release-asset@v1
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
with:
|
||||
upload_url: ${{ steps.create_release.outputs.upload_url }}
|
||||
asset_path: ./dist/scriptcat-${{ github.ref_name }}-chrome.crx
|
||||
asset_name: scriptcat-${{ github.ref_name }}-chrome.crx
|
||||
asset_content_type: application/zip
|
30
.github/workflows/test.yaml
vendored
Normal file
30
.github/workflows/test.yaml
vendored
Normal file
@ -0,0 +1,30 @@
|
||||
name: test
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
- release/*
|
||||
- dev
|
||||
- develop/*
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
tests:
|
||||
runs-on: ubuntu-latest
|
||||
name: Run tests
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Use Node.js
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: 20
|
||||
cache: 'npm'
|
||||
|
||||
- name: Unit Test
|
||||
run: |
|
||||
npm ci
|
||||
npm test
|
||||
|
||||
- name: Upload coverage reports to Codecov with GitHub Action
|
||||
uses: codecov/codecov-action@v3
|
Reference in New Issue
Block a user