发布新版本时构建应用 #11
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: 发布版本时构建应用 | |
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/[email protected] | |
- name: Set up Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ matrix.node-version }} | |
- name: Install dependencies | |
run: yarn config set registry https://registry.npmmirror.com/ | |
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-artifact@v4 | |
with: | |
name: ExamShowboard-Windows | |
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 |