修正错误,添加dev构建

pull/459/head
lyswhut 2021-03-10 01:34:58 +08:00
parent d533c12315
commit ab2cf5a50f
3 changed files with 99 additions and 0 deletions

94
.github/workflows/dev-pack.yml vendored Normal file
View File

@ -0,0 +1,94 @@
name: Build/release
on:
push:
branches:
- dev
jobs:
Windows:
name: Windows
runs-on: windows-latest
steps:
- name: Check out git repository
uses: actions/checkout@v2
- name: Install Node.js
uses: actions/setup-node@v2
with:
node-version: '12.x'
- name: Cache file
uses: actions/cache@v2
with:
path: |
node_modules
%APPDATA%\npm-cache
%LOCALAPPDATA%\electron\Cache
%LOCALAPPDATA%\electron-builder\Cache
key: ${{ runner.os }}-build-caches-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-
- name: Build & Release
run: npm install && npm run publish:dev
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BT_TOKEN: ${{ secrets.BT_TOKEN }}
Mac:
name: Mac
runs-on: macos-latest
steps:
- name: Check out git repository
uses: actions/checkout@v2
- name: Install Node.js
uses: actions/setup-node@v2
with:
node-version: '12.x'
- name: Cache file
uses: actions/cache@v2
with:
path: |
node_modules
$HOME/.cache/electron
$HOME/.cache/electron-builder
$HOME/.npm/_prebuilds
key: ${{ runner.os }}-build-caches-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-
- name: Build & Release
run: npm install && npm run publish:gh:mac
env:
ELECTRON_CACHE: $HOME/.cache/electron
ELECTRON_BUILDERCACHE: $HOME/.cache/electron-builder
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BT_TOKEN: ${{ secrets.BT_TOKEN }}
Linux:
name: Linux
runs-on: ubuntu-latest
steps:
- name: Install package
run: sudo apt-get install -y rpm bsdtar|libarchive-tools
- name: Check out git repository
uses: actions/checkout@v2
- name: Install Node.js
uses: actions/setup-node@v2
with:
node-version: '12.x'
- name: Cache file
uses: actions/cache@v2
with:
path: |
node_modules
$HOME/.cache/electron
$HOME/.cache/electron-builder
$HOME/.npm/_prebuilds
key: ${{ runner.os }}-build-caches-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-
- name: Build & Release
run: npm install && npm run publish:gh:linux
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BT_TOKEN: ${{ secrets.BT_TOKEN }}

View File

@ -31,6 +31,7 @@ jobs:
run: npm install && npm run publish:gh
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BT_TOKEN: ${{ secrets.BT_TOKEN }}
Mac:
name: Mac
@ -59,6 +60,7 @@ jobs:
ELECTRON_CACHE: $HOME/.cache/electron
ELECTRON_BUILDERCACHE: $HOME/.cache/electron-builder
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BT_TOKEN: ${{ secrets.BT_TOKEN }}
Linux:
name: Linux
@ -89,3 +91,4 @@ jobs:
run: npm install && npm run publish:gh:linux
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BT_TOKEN: ${{ secrets.BT_TOKEN }}

View File

@ -28,6 +28,8 @@
"publish:win:7z": "npm run publish:win:7z:x64 && npm run publish:win:7z:x86",
"publish:win:7z:x64": "cross-env TARGET=green ARCH=win_x64 electron-builder -w=7z --x64 -p always",
"publish:win:7z:x86": "cross-env TARGET=green ARCH=win_x86 electron-builder -w=7z --ia32 -p onTagOrDraft",
"publish:win:7z:x64:noalways": "cross-env TARGET=green ARCH=win_x64 electron-builder -w=7z --x64 -p onTagOrDraft",
"publish:dev": "node build-config/pack.js && npm run publish:win:setup && npm run publish:win:7z:x64:noalways && npm run publish:win:7z:x86",
"publish:gh:mac": "node build-config/pack.js && npm run publish:mac",
"publish:mac": "npm run publish:mac:dmg",
"publish:mac:dmg": "electron-builder -m=dmg -p onTagOrDraft",