build: add single-command release script + portable zip artifacts
One-developer workflow: ``python build/make_release.py`` on each target OS produces both the installer and a portable .zip for that platform. Preflight checks PyInstaller / Pillow / iscc / hdiutil / ditto / appimagetool and bails with install hints if anything is missing — no half-built dist/. New scripts: - build/make_release.py — orchestrator, auto-detects host OS. - build/generate_icons.py — icon.ico / icon.icns / icon.png from src/gui/assets/datatools_icon_256.png (Pillow ships ICO + ICNS writers; no platform tooling needed). - build/build_portable_zip.py — Win/Linux portable zip via stdlib. - build/macos/build_zip.sh — Mac portable .app via ditto so bundle metadata survives. installer.iss now adds: Quick Launch task (opt-in, legacy Win 7), App Paths registry entry (Win+R "DataTools" works), SetupIconFile, UninstallDisplayIcon, AppSupportURL, AppUpdatesURL. CI workflow uploads installer + portable per platform and attaches both to GitHub Releases on tag push. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
71
.github/workflows/build.yml
vendored
71
.github/workflows/build.yml
vendored
@@ -1,8 +1,18 @@
|
||||
name: Build installers
|
||||
|
||||
# Triggers:
|
||||
# * Tag push (v*) → produces installers, attaches to a GitHub Release.
|
||||
# * Manual dispatch → produces installers as workflow artifacts only.
|
||||
# * Tag push (v*) → produces installers + portable zips, attaches them
|
||||
# to a GitHub Release.
|
||||
# * Manual dispatch → uploads everything as workflow artifacts only.
|
||||
#
|
||||
# Outputs per platform (downloadable by buyers):
|
||||
# * macOS: .dmg installer + portable .zip (signed .app inside).
|
||||
# * Windows: .exe installer + portable .zip (no-install).
|
||||
# * Linux: .AppImage (already portable; no separate zip).
|
||||
#
|
||||
# Self-contained: every artifact ships its own Python interpreter + every
|
||||
# runtime dep through PyInstaller. No pre/post install steps on the
|
||||
# buyer's machine.
|
||||
#
|
||||
# What this workflow doesn't do (yet):
|
||||
# * Code signing (Mac Developer ID, Windows code-signing cert).
|
||||
@@ -29,14 +39,17 @@ jobs:
|
||||
matrix:
|
||||
include:
|
||||
- os: macos-latest
|
||||
artifact_name: DataTools-mac.dmg
|
||||
artifact_path: dist/DataTools-*-mac.dmg
|
||||
platform: mac
|
||||
installer_glob: dist/DataTools-*-mac.dmg
|
||||
portable_glob: dist/DataTools-*-mac-portable.zip
|
||||
- os: windows-latest
|
||||
artifact_name: DataTools-win.exe
|
||||
artifact_path: dist/DataTools-*-win-setup.exe
|
||||
platform: win
|
||||
installer_glob: dist/DataTools-*-win-setup.exe
|
||||
portable_glob: dist/DataTools-*-win-portable.zip
|
||||
- os: ubuntu-latest
|
||||
artifact_name: DataTools-linux.AppImage
|
||||
artifact_path: dist/DataTools-*-linux-x86_64.AppImage
|
||||
platform: linux
|
||||
installer_glob: dist/DataTools-*-linux-x86_64.AppImage
|
||||
portable_glob: '' # AppImage is already a portable single file
|
||||
runs-on: ${{ matrix.os }}
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
@@ -50,7 +63,7 @@ jobs:
|
||||
run: |
|
||||
pip install --upgrade pip
|
||||
pip install -r requirements.txt
|
||||
pip install pyinstaller
|
||||
pip install pyinstaller pillow
|
||||
|
||||
- name: Read version
|
||||
id: version
|
||||
@@ -59,15 +72,22 @@ jobs:
|
||||
VER=$(python -c "import re; print(re.search(r'__version__\s*=\s*\"([^\"]+)\"', open('src/__init__.py').read()).group(1))")
|
||||
echo "version=$VER" >> "$GITHUB_OUTPUT"
|
||||
|
||||
- name: Generate platform icons
|
||||
run: python build/generate_icons.py
|
||||
|
||||
- name: Build PyInstaller bundle
|
||||
run: pyinstaller build/datatools.spec --clean --noconfirm
|
||||
|
||||
# ---- Per-platform packaging ----------------------------------
|
||||
# ---- Per-platform installer packaging ------------------------
|
||||
|
||||
- name: Package macOS DMG
|
||||
- name: Package macOS DMG (installer)
|
||||
if: matrix.os == 'macos-latest'
|
||||
run: bash build/macos/build_dmg.sh "${{ steps.version.outputs.version }}"
|
||||
|
||||
- name: Package macOS portable .zip
|
||||
if: matrix.os == 'macos-latest'
|
||||
run: bash build/macos/build_zip.sh "${{ steps.version.outputs.version }}"
|
||||
|
||||
- name: Install Inno Setup (Windows)
|
||||
if: matrix.os == 'windows-latest'
|
||||
run: choco install innosetup --no-progress -y
|
||||
@@ -78,6 +98,10 @@ jobs:
|
||||
run: |
|
||||
iscc /DAppVersion=${{ steps.version.outputs.version }} build\installer.iss
|
||||
|
||||
- name: Package Windows portable .zip
|
||||
if: matrix.os == 'windows-latest'
|
||||
run: python build/build_portable_zip.py win ${{ steps.version.outputs.version }}
|
||||
|
||||
- name: Install AppImage tooling (Linux)
|
||||
if: matrix.os == 'ubuntu-latest'
|
||||
run: |
|
||||
@@ -92,17 +116,32 @@ jobs:
|
||||
|
||||
# ---- Upload + release ----------------------------------------
|
||||
|
||||
- name: Upload artifact
|
||||
- name: Upload installer artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: ${{ matrix.artifact_name }}
|
||||
path: ${{ matrix.artifact_path }}
|
||||
name: DataTools-${{ matrix.platform }}-installer
|
||||
path: ${{ matrix.installer_glob }}
|
||||
if-no-files-found: error
|
||||
|
||||
- name: Attach to Release (tag push only)
|
||||
- name: Upload portable artifact
|
||||
if: matrix.portable_glob != ''
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: DataTools-${{ matrix.platform }}-portable
|
||||
path: ${{ matrix.portable_glob }}
|
||||
if-no-files-found: error
|
||||
|
||||
- name: Attach installer to Release (tag push only)
|
||||
if: startsWith(github.ref, 'refs/tags/v')
|
||||
uses: softprops/action-gh-release@v2
|
||||
with:
|
||||
files: ${{ matrix.artifact_path }}
|
||||
files: ${{ matrix.installer_glob }}
|
||||
fail_on_unmatched_files: true
|
||||
generate_release_notes: true
|
||||
|
||||
- name: Attach portable to Release (tag push only)
|
||||
if: startsWith(github.ref, 'refs/tags/v') && matrix.portable_glob != ''
|
||||
uses: softprops/action-gh-release@v2
|
||||
with:
|
||||
files: ${{ matrix.portable_glob }}
|
||||
fail_on_unmatched_files: true
|
||||
|
||||
Reference in New Issue
Block a user