chore: update GitHub Actions workflow for multi-platform builds
- Added support for legacy builds with specific Electron versions for Windows and Linux. - Updated artifact naming conventions to include '-legacy' suffix for legacy builds. - Introduced conditional steps for setting Electron versions and renaming artifacts based on build variant.
This commit is contained in:
63
.github/workflows/build.yml
vendored
63
.github/workflows/build.yml
vendored
@@ -80,6 +80,8 @@ jobs:
|
|||||||
release_artifacts: "dist/*-win-installer.exe,dist/*-win-portable.exe"
|
release_artifacts: "dist/*-win-installer.exe,dist/*-win-portable.exe"
|
||||||
build_input: build_windows
|
build_input: build_windows
|
||||||
dist_script: dist-prebuilt
|
dist_script: dist-prebuilt
|
||||||
|
variant: standard
|
||||||
|
electron_version: "39.2.4"
|
||||||
- name: mac
|
- name: mac
|
||||||
os: macos-14
|
os: macos-14
|
||||||
node: 18
|
node: 18
|
||||||
@@ -87,6 +89,8 @@ jobs:
|
|||||||
release_artifacts: "dist/*-mac-*.dmg"
|
release_artifacts: "dist/*-mac-*.dmg"
|
||||||
build_input: build_mac
|
build_input: build_mac
|
||||||
dist_script: dist:mac-universal
|
dist_script: dist:mac-universal
|
||||||
|
variant: standard
|
||||||
|
electron_version: "39.2.4"
|
||||||
- name: linux
|
- name: linux
|
||||||
os: ubuntu-latest
|
os: ubuntu-latest
|
||||||
node: 22
|
node: 22
|
||||||
@@ -94,6 +98,26 @@ jobs:
|
|||||||
release_artifacts: "dist/*-linux.AppImage,dist/*-linux.deb,python-dist/*.whl"
|
release_artifacts: "dist/*-linux.AppImage,dist/*-linux.deb,python-dist/*.whl"
|
||||||
build_input: build_linux
|
build_input: build_linux
|
||||||
dist_script: dist-prebuilt
|
dist_script: dist-prebuilt
|
||||||
|
variant: standard
|
||||||
|
electron_version: "39.2.4"
|
||||||
|
- name: windows-legacy
|
||||||
|
os: windows-latest
|
||||||
|
node: 22
|
||||||
|
python: "3.12"
|
||||||
|
release_artifacts: "dist/*-win-installer*.exe,dist/*-win-portable*.exe"
|
||||||
|
build_input: build_windows
|
||||||
|
dist_script: dist-prebuilt
|
||||||
|
variant: legacy
|
||||||
|
electron_version: "30.0.8"
|
||||||
|
- name: linux-legacy
|
||||||
|
os: ubuntu-latest
|
||||||
|
node: 22
|
||||||
|
python: "3.12"
|
||||||
|
release_artifacts: "dist/*-linux*.AppImage,dist/*-linux*.deb,python-dist/*.whl"
|
||||||
|
build_input: build_linux
|
||||||
|
dist_script: dist-prebuilt
|
||||||
|
variant: legacy
|
||||||
|
electron_version: "30.0.8"
|
||||||
permissions:
|
permissions:
|
||||||
contents: write
|
contents: write
|
||||||
steps:
|
steps:
|
||||||
@@ -103,6 +127,16 @@ jobs:
|
|||||||
(github.event_name == 'workflow_dispatch' && inputs[matrix.build_input] == true)
|
(github.event_name == 'workflow_dispatch' && inputs[matrix.build_input] == true)
|
||||||
uses: actions/checkout@50fbc622fc4ef5163becd7fab6573eac35f8462e # v1
|
uses: actions/checkout@50fbc622fc4ef5163becd7fab6573eac35f8462e # v1
|
||||||
|
|
||||||
|
- name: Set legacy Electron version
|
||||||
|
if: |
|
||||||
|
matrix.variant == 'legacy' &&
|
||||||
|
(github.event_name == 'push' ||
|
||||||
|
(github.event_name == 'workflow_dispatch' && inputs[matrix.build_input] == true))
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
node -e "const fs=require('fs');const pkg=require('./package.json');pkg.devDependencies.electron='${{ matrix.electron_version }}';fs.writeFileSync('package.json', JSON.stringify(pkg,null,2));"
|
||||||
|
if [ -f package-lock.json ]; then rm package-lock.json; fi
|
||||||
|
|
||||||
- name: Install NodeJS
|
- name: Install NodeJS
|
||||||
if: |
|
if: |
|
||||||
github.event_name == 'push' ||
|
github.event_name == 'push' ||
|
||||||
@@ -160,14 +194,14 @@ jobs:
|
|||||||
|
|
||||||
- name: Install patchelf
|
- name: Install patchelf
|
||||||
if: |
|
if: |
|
||||||
matrix.name == 'linux' &&
|
startsWith(matrix.name, 'linux') &&
|
||||||
(github.event_name == 'push' ||
|
(github.event_name == 'push' ||
|
||||||
(github.event_name == 'workflow_dispatch' && inputs[matrix.build_input] == true))
|
(github.event_name == 'workflow_dispatch' && inputs[matrix.build_input] == true))
|
||||||
run: sudo apt-get update && sudo apt-get install -y patchelf
|
run: sudo apt-get update && sudo apt-get install -y patchelf
|
||||||
|
|
||||||
- name: Build Python wheel
|
- name: Build Python wheel
|
||||||
if: |
|
if: |
|
||||||
matrix.name == 'linux' &&
|
startsWith(matrix.name, 'linux') &&
|
||||||
(github.event_name == 'push' ||
|
(github.event_name == 'push' ||
|
||||||
(github.event_name == 'workflow_dispatch' && inputs[matrix.build_input] == true))
|
(github.event_name == 'workflow_dispatch' && inputs[matrix.build_input] == true))
|
||||||
run: |
|
run: |
|
||||||
@@ -182,6 +216,23 @@ jobs:
|
|||||||
(github.event_name == 'workflow_dispatch' && inputs[matrix.build_input] == true)
|
(github.event_name == 'workflow_dispatch' && inputs[matrix.build_input] == true)
|
||||||
run: npm run ${{ matrix.dist_script }}
|
run: npm run ${{ matrix.dist_script }}
|
||||||
|
|
||||||
|
- name: Rename artifacts for legacy build
|
||||||
|
if: |
|
||||||
|
matrix.variant == 'legacy' &&
|
||||||
|
(github.event_name == 'push' ||
|
||||||
|
(github.event_name == 'workflow_dispatch' && inputs[matrix.build_input] == true))
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
shopt -s nullglob
|
||||||
|
for f in dist/*-win-installer.exe dist/*-win-portable.exe dist/*-linux.AppImage dist/*-linux.deb; do
|
||||||
|
[ -e "$f" ] || continue
|
||||||
|
dir=$(dirname "$f")
|
||||||
|
base=$(basename "$f")
|
||||||
|
ext="${base##*.}"
|
||||||
|
name="${base%.$ext}"
|
||||||
|
mv "$f" "$dir/${name}-legacy.${ext}"
|
||||||
|
done
|
||||||
|
|
||||||
- name: Upload build artifacts
|
- name: Upload build artifacts
|
||||||
if: |
|
if: |
|
||||||
github.event_name == 'push' ||
|
github.event_name == 'push' ||
|
||||||
@@ -190,11 +241,11 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
name: build-${{ matrix.name }}
|
name: build-${{ matrix.name }}
|
||||||
path: |
|
path: |
|
||||||
dist/*-win-installer.exe
|
dist/*-win-installer*.exe
|
||||||
dist/*-win-portable.exe
|
dist/*-win-portable*.exe
|
||||||
dist/*-mac-*.dmg
|
dist/*-mac-*.dmg
|
||||||
dist/*-linux.AppImage
|
dist/*-linux*.AppImage
|
||||||
dist/*-linux.deb
|
dist/*-linux*.deb
|
||||||
python-dist/*.whl
|
python-dist/*.whl
|
||||||
if-no-files-found: ignore
|
if-no-files-found: ignore
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user