mirror of
https://hub.gitmirror.com/https://github.com/ExamAware/ExamShowboard-Legacy.git
synced 2025-04-29 13:46:32 +00:00
ci(release): 优化发布工作流
This commit is contained in:
parent
2e30841d7e
commit
f81bf2d592
50
.github/workflows/publish.yaml
vendored
50
.github/workflows/publish.yaml
vendored
@ -1,5 +1,4 @@
|
|||||||
# .github/workflows/publish.yaml
|
name: Release Build and Package
|
||||||
name: Build and Package Electron App on Release
|
|
||||||
|
|
||||||
on:
|
on:
|
||||||
release:
|
release:
|
||||||
@ -8,32 +7,23 @@ on:
|
|||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
|
if: github.event.release.prerelease == false || matrix.os == 'windows-latest'
|
||||||
|
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
os: [windows-latest, macos-latest, ubuntu-latest]
|
os: [windows-latest, macos-latest, ubuntu-latest]
|
||||||
node-version: [20.x]
|
node-version: [20.x]
|
||||||
include:
|
|
||||||
- os: windows-latest
|
|
||||||
build_all: false
|
|
||||||
- os: macos-latest
|
|
||||||
build_all: true
|
|
||||||
- os: ubuntu-latest
|
|
||||||
build_all: true
|
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
if: matrix.os == 'windows-latest' || github.event.release.prerelease == false
|
|
||||||
uses: actions/checkout@v4.1.7
|
uses: actions/checkout@v4.1.7
|
||||||
|
|
||||||
- name: Set up Node.js
|
- name: Set up Node.js
|
||||||
if: matrix.os == 'windows-latest' || github.event.release.prerelease == false
|
|
||||||
uses: actions/setup-node@v4
|
uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node-version: ${{ matrix.node-version }}
|
node-version: ${{ matrix.node-version }}
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
if: matrix.os == 'windows-latest' || github.event.release.prerelease == false
|
|
||||||
run: yarn install
|
run: yarn install
|
||||||
|
|
||||||
- name: Build and package for Windows
|
- name: Build and package for Windows
|
||||||
@ -41,40 +31,30 @@ jobs:
|
|||||||
run: yarn build:win
|
run: yarn build:win
|
||||||
|
|
||||||
- name: Build and package for macOS
|
- name: Build and package for macOS
|
||||||
if: matrix.os == 'macos-latest' && github.event.release.prerelease == false
|
if: matrix.os == 'macos-latest'
|
||||||
run: yarn build:mac
|
run: yarn build:mac
|
||||||
|
|
||||||
- name: Build and package for Linux
|
- name: Build and package for Linux
|
||||||
if: matrix.os == 'ubuntu-latest' && github.event.release.prerelease == false
|
if: matrix.os == 'ubuntu-latest'
|
||||||
run: yarn build:linux
|
run: yarn build:linux
|
||||||
|
|
||||||
- name: Get version from package.json
|
|
||||||
id: get_version
|
|
||||||
run: echo "::set-output name=version::$(node -p \"require('./package.json').version\")"
|
|
||||||
|
|
||||||
- name: Upload artifact for Windows
|
- name: Upload artifact for Windows
|
||||||
if: matrix.os == 'windows-latest'
|
if: matrix.os == 'windows-latest'
|
||||||
uses: actions/upload-release-asset@v1
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
upload_url: ${{ github.event.release.upload_url }}
|
name: ExamShowboard-Windows
|
||||||
asset_path: dist/dsz-exam-showboard-${{ steps.get_version.outputs.version }}-setup.exe
|
path: dist/*.exe
|
||||||
asset_name: ExamShowboard-Windows-amd64-${{ steps.get_version.outputs.version }}-setup.exe
|
|
||||||
asset_content_type: application/octet-stream
|
|
||||||
|
|
||||||
- name: Upload artifact for macOS
|
- name: Upload artifact for macOS
|
||||||
if: matrix.os == 'macos-latest' && github.event.release.prerelease == false
|
if: matrix.os == 'macos-latest'
|
||||||
uses: actions/upload-release-asset@v1
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
upload_url: ${{ github.event.release.upload_url }}
|
name: ExamShowboard-macOS
|
||||||
asset_path: dist/dsz-exam-showboard-${{ steps.get_version.outputs.version }}.dmg
|
path: dist/*.dmg
|
||||||
asset_name: ExamShowboard-macOS-arm64-${{ steps.get_version.outputs.version }}.dmg
|
|
||||||
asset_content_type: application/octet-stream
|
|
||||||
|
|
||||||
- name: Upload artifact for Linux
|
- name: Upload artifact for Linux
|
||||||
if: matrix.os == 'ubuntu-latest' && github.event.release.prerelease == false
|
if: matrix.os == 'ubuntu-latest'
|
||||||
uses: actions/upload-release-asset@v1
|
uses: actions/upload-artifact@v4
|
||||||
with:
|
with:
|
||||||
upload_url: ${{ github.event.release.upload_url }}
|
name: ExamShowboard-Linux
|
||||||
asset_path: dist/dsz-exam-showboard-${{ steps.get_version.outputs.version }}.AppImage
|
path: dist/*.AppImage
|
||||||
asset_name: ExamShowboard-Linux-amd64-${{ steps.get_version.outputs.version }}-setup.AppImage
|
|
||||||
asset_content_type: application/octet-stream
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user