diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6657362..93b4177 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -76,24 +76,48 @@ jobs: - name: windows os: windows-latest node: 22 - python: "3.12" + python: "3.13" release_artifacts: "dist/*-win-installer.exe,dist/*-win-portable.exe" build_input: build_windows dist_script: dist-prebuilt + variant: standard + electron_version: "39.2.4" - name: mac os: macos-14 - node: 18 - python: "3.11" + node: 22 + python: "3.13" release_artifacts: "dist/*-mac-*.dmg" build_input: build_mac dist_script: dist:mac-universal + variant: standard + electron_version: "39.2.4" - name: linux os: ubuntu-latest node: 22 - python: "3.12" + python: "3.13" release_artifacts: "dist/*-linux.AppImage,dist/*-linux.deb,python-dist/*.whl" build_input: build_linux dist_script: dist-prebuilt + variant: standard + electron_version: "39.2.4" + - name: windows-legacy + os: windows-latest + node: 18 + python: "3.11" + 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: 18 + python: "3.11" + 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: contents: write steps: @@ -103,6 +127,16 @@ jobs: (github.event_name == 'workflow_dispatch' && inputs[matrix.build_input] == true) 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 if: | github.event_name == 'push' || @@ -160,14 +194,14 @@ jobs: - name: Install patchelf if: | - matrix.name == 'linux' && + startsWith(matrix.name, 'linux') && (github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && inputs[matrix.build_input] == true)) run: sudo apt-get update && sudo apt-get install -y patchelf - name: Build Python wheel if: | - matrix.name == 'linux' && + startsWith(matrix.name, 'linux') && (github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && inputs[matrix.build_input] == true)) run: | @@ -182,6 +216,13 @@ jobs: (github.event_name == 'workflow_dispatch' && inputs[matrix.build_input] == true) 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)) + run: ./scripts/rename_legacy_artifacts.sh + - name: Upload build artifacts if: | github.event_name == 'push' || @@ -190,11 +231,11 @@ jobs: with: name: build-${{ matrix.name }} path: | - dist/*-win-installer.exe - dist/*-win-portable.exe + dist/*-win-installer*.exe + dist/*-win-portable*.exe dist/*-mac-*.dmg - dist/*-linux.AppImage - dist/*-linux.deb + dist/*-linux*.AppImage + dist/*-linux*.deb python-dist/*.whl if-no-files-found: ignore diff --git a/.github/workflows/dependency-review.yml b/.github/workflows/dependency-review.yml new file mode 100644 index 0000000..af9b511 --- /dev/null +++ b/.github/workflows/dependency-review.yml @@ -0,0 +1,22 @@ +name: 'Dependency review' + +on: + pull_request: + branches: [ "master" ] + +permissions: + contents: read + pull-requests: write + +jobs: + dependency-review: + runs-on: ubuntu-latest + + steps: + - name: 'Checkout repository' + uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4 + + - name: 'Dependency Review' + uses: actions/dependency-review-action@3c4e3dcb1aa7874d2c16be7d79418e9b7efd6261 # v4 + with: + comment-summary-in-pr: always \ No newline at end of file diff --git a/Makefile b/Makefile index 82bbbf0..56d174b 100644 --- a/Makefile +++ b/Makefile @@ -1,8 +1,9 @@ -.PHONY: install run develop clean build build-appimage build-exe dist sync-version wheel node_modules python build-docker run-docker +.PHONY: install run develop clean build build-appimage build-exe dist sync-version wheel node_modules python build-docker run-docker electron-legacy build-appimage-legacy build-exe-legacy PYTHON ?= python POETRY = $(PYTHON) -m poetry NPM = npm +LEGACY_ELECTRON_VERSION ?= 30.0.8 DOCKER_COMPOSE_CMD ?= docker compose DOCKER_COMPOSE_FILE ?= docker-compose.yml @@ -44,6 +45,20 @@ build-exe: build dist: build-appimage +electron-legacy: + $(NPM) install --no-save electron@$(LEGACY_ELECTRON_VERSION) + +# Legacy targets intended for manual/local builds; CI uses workflow jobs. +build-appimage-legacy: build electron-legacy + $(NPM) run electron-postinstall + $(NPM) run dist -- --linux AppImage + ./scripts/rename_legacy_artifacts.sh + +build-exe-legacy: build electron-legacy + $(NPM) run electron-postinstall + $(NPM) run dist -- --win portable + ./scripts/rename_legacy_artifacts.sh + clean: rm -rf node_modules rm -rf build diff --git a/scripts/rename_legacy_artifacts.sh b/scripts/rename_legacy_artifacts.sh new file mode 100755 index 0000000..7d39aef --- /dev/null +++ b/scripts/rename_legacy_artifacts.sh @@ -0,0 +1,21 @@ +#!/usr/bin/env bash +set -euo pipefail + +shopt -s nullglob + +patterns=( + "dist/*-win-installer.exe" + "dist/*-win-portable.exe" + "dist/*-linux.AppImage" + "dist/*-linux.deb" +) + +for pattern in "${patterns[@]}"; do + for f in $pattern; do + dir=$(dirname "$f") + base=$(basename "$f") + ext="${base##*.}" + name="${base%.$ext}" + mv "$f" "$dir/${name}-legacy.${ext}" + done +done