mirror of
https://hub.gitmirror.com/https://github.com/ExamAware/ExamShowboard-Legacy.git
synced 2025-04-29 11:26:34 +00:00
feat(CI): 多平台构建和发布
This commit is contained in:
parent
fdf981dfe3
commit
6d385aa20b
30
.github/workflows/build.yaml
vendored
30
.github/workflows/build.yaml
vendored
@ -4,15 +4,17 @@ on: [ push ]
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: windows-latest
|
runs-on: ${{ matrix.os }}
|
||||||
|
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
|
os: [ windows-latest, macos-latest, ubuntu-latest ]
|
||||||
node-version: [ 20.x ]
|
node-version: [ 20.x ]
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4.1.7
|
uses: actions/checkout@v4.1.7
|
||||||
|
|
||||||
- name: Set up Node.js
|
- name: Set up Node.js
|
||||||
uses: actions/setup-node@v4
|
uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
@ -22,10 +24,34 @@ jobs:
|
|||||||
run: yarn install
|
run: yarn install
|
||||||
|
|
||||||
- name: Build and package for Windows
|
- name: Build and package for Windows
|
||||||
|
if: matrix.os == 'windows-latest'
|
||||||
run: yarn build:win
|
run: yarn build:win
|
||||||
|
|
||||||
- name: Upload artifact
|
- name: Build and package for macOS
|
||||||
|
if: matrix.os == 'macos-latest'
|
||||||
|
run: yarn build:mac
|
||||||
|
|
||||||
|
- name: Build and package for Linux
|
||||||
|
if: matrix.os == 'ubuntu-latest'
|
||||||
|
run: yarn build:linux
|
||||||
|
|
||||||
|
- name: Upload artifact for Windows
|
||||||
|
if: matrix.os == 'windows-latest'
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
name: ExamShowboard-Windows
|
name: ExamShowboard-Windows
|
||||||
path: dist/*.exe
|
path: dist/*.exe
|
||||||
|
|
||||||
|
- name: Upload artifact for macOS
|
||||||
|
if: matrix.os == 'macos-latest'
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: ExamShowboard-macOS
|
||||||
|
path: dist/*.dmg
|
||||||
|
|
||||||
|
- name: Upload artifact for Linux
|
||||||
|
if: matrix.os == 'ubuntu-latest'
|
||||||
|
uses: actions/upload-artifact@v4
|
||||||
|
with:
|
||||||
|
name: ExamShowboard-Linux
|
||||||
|
path: dist/*.AppImage
|
||||||
|
65
.github/workflows/publish.yaml
vendored
Normal file
65
.github/workflows/publish.yaml
vendored
Normal file
@ -0,0 +1,65 @@
|
|||||||
|
name: Build and Package Electron App on Release
|
||||||
|
|
||||||
|
on:
|
||||||
|
release:
|
||||||
|
types: [published]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build:
|
||||||
|
runs-on: ${{ matrix.os }}
|
||||||
|
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
os: [windows-latest, macos-latest, ubuntu-latest]
|
||||||
|
node-version: [20.x]
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4.1.7
|
||||||
|
|
||||||
|
- name: Set up Node.js
|
||||||
|
uses: actions/setup-node@v4
|
||||||
|
with:
|
||||||
|
node-version: ${{ matrix.node-version }}
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
run: yarn install
|
||||||
|
|
||||||
|
- name: Build and package for Windows
|
||||||
|
if: matrix.os == 'windows-latest'
|
||||||
|
run: yarn build:win
|
||||||
|
|
||||||
|
- name: Build and package for macOS
|
||||||
|
if: matrix.os == 'macos-latest'
|
||||||
|
run: yarn build:mac
|
||||||
|
|
||||||
|
- name: Build and package for Linux
|
||||||
|
if: matrix.os == 'ubuntu-latest'
|
||||||
|
run: yarn build:linux
|
||||||
|
|
||||||
|
- name: Upload artifact for Windows
|
||||||
|
if: matrix.os == 'windows-latest'
|
||||||
|
uses: actions/upload-release-asset@v1
|
||||||
|
with:
|
||||||
|
upload_url: ${{ github.event.release.upload_url }}
|
||||||
|
asset_path: dist/*.exe
|
||||||
|
asset_name: ExamShowboard-Windows.exe
|
||||||
|
asset_content_type: application/octet-stream
|
||||||
|
|
||||||
|
- name: Upload artifact for macOS
|
||||||
|
if: matrix.os == 'macos-latest'
|
||||||
|
uses: actions/upload-release-asset@v1
|
||||||
|
with:
|
||||||
|
upload_url: ${{ github.event.release.upload_url }}
|
||||||
|
asset_path: dist/*.dmg
|
||||||
|
asset_name: ExamShowboard-macOS.dmg
|
||||||
|
asset_content_type: application/octet-stream
|
||||||
|
|
||||||
|
- name: Upload artifact for Linux
|
||||||
|
if: matrix.os == 'ubuntu-latest'
|
||||||
|
uses: actions/upload-release-asset@v1
|
||||||
|
with:
|
||||||
|
upload_url: ${{ github.event.release.upload_url }}
|
||||||
|
asset_path: dist/*.AppImage
|
||||||
|
asset_name: ExamShowboard-Linux.AppImage
|
||||||
|
asset_content_type: application/octet-stream
|
Loading…
x
Reference in New Issue
Block a user