mirror of
https://hub.gitmirror.com/https://github.com/ExamAware/ExamShowboard-Legacy.git
synced 2025-04-29 11:26:34 +00:00
feat(ci): 仅在非预发行版本的情况下为macOS和Linux构建发布工件
修改了构建和发布工件的GitHub操作工作流,以便仅在非预发行版本的情况下为macOS和Linux构建和发布工件。这包括在发布工作流中条件性地运行macOS和Linux构建任务,并相应地调整Windows构建任务。以前,工件会无条件地为所有操作系统构建和上传。
This commit is contained in:
parent
6d385aa20b
commit
7a7bd9386e
24
.github/workflows/build.yaml
vendored
24
.github/workflows/build.yaml
vendored
@ -8,7 +8,7 @@ jobs:
|
|||||||
|
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
os: [ windows-latest, macos-latest, ubuntu-latest ]
|
os: [ windows-latest ]
|
||||||
node-version: [ 20.x ]
|
node-version: [ 20.x ]
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
@ -27,31 +27,9 @@ jobs:
|
|||||||
if: matrix.os == 'windows-latest'
|
if: matrix.os == 'windows-latest'
|
||||||
run: yarn build:win
|
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
|
- name: Upload artifact for Windows
|
||||||
if: matrix.os == 'windows-latest'
|
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
|
|
||||||
|
19
.github/workflows/publish.yaml
vendored
19
.github/workflows/publish.yaml
vendored
@ -12,6 +12,13 @@ jobs:
|
|||||||
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
|
||||||
@ -30,11 +37,11 @@ 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'
|
if: matrix.os == 'macos-latest' && github.event.release.prerelease == false
|
||||||
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'
|
if: matrix.os == 'ubuntu-latest' && github.event.release.prerelease == false
|
||||||
run: yarn build:linux
|
run: yarn build:linux
|
||||||
|
|
||||||
- name: Upload artifact for Windows
|
- name: Upload artifact for Windows
|
||||||
@ -43,20 +50,20 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
upload_url: ${{ github.event.release.upload_url }}
|
upload_url: ${{ github.event.release.upload_url }}
|
||||||
asset_path: dist/*.exe
|
asset_path: dist/*.exe
|
||||||
asset_name: ExamShowboard-Windows.exe
|
asset_name: ExamShowboard-Windows-amd64.exe
|
||||||
asset_content_type: application/octet-stream
|
asset_content_type: application/octet-stream
|
||||||
|
|
||||||
- name: Upload artifact for macOS
|
- name: Upload artifact for macOS
|
||||||
if: matrix.os == 'macos-latest'
|
if: matrix.os == 'macos-latest' && github.event.release.prerelease == false
|
||||||
uses: actions/upload-release-asset@v1
|
uses: actions/upload-release-asset@v1
|
||||||
with:
|
with:
|
||||||
upload_url: ${{ github.event.release.upload_url }}
|
upload_url: ${{ github.event.release.upload_url }}
|
||||||
asset_path: dist/*.dmg
|
asset_path: dist/*.dmg
|
||||||
asset_name: ExamShowboard-macOS.dmg
|
asset_name: ExamShowboard-macOS-arm64.dmg
|
||||||
asset_content_type: application/octet-stream
|
asset_content_type: application/octet-stream
|
||||||
|
|
||||||
- name: Upload artifact for Linux
|
- name: Upload artifact for Linux
|
||||||
if: matrix.os == 'ubuntu-latest'
|
if: matrix.os == 'ubuntu-latest' && github.event.release.prerelease == false
|
||||||
uses: actions/upload-release-asset@v1
|
uses: actions/upload-release-asset@v1
|
||||||
with:
|
with:
|
||||||
upload_url: ${{ github.event.release.upload_url }}
|
upload_url: ${{ github.event.release.upload_url }}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user