Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
79 changes: 41 additions & 38 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,20 @@ on:
env:
PYTHON_VERSION: '3.14'

# Required for creating a new GitHub release
permissions:
contents: write

jobs:
build-app-packages:
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
include:
- os: ubuntu-latest
dist_name: linux
assets_path: dist/naturtag/_internal/assets/data
- os: macos-latest
dist_name: macos
assets_path: dist/naturtag.app/Contents/Resources/assets/data
- os: windows-latest
dist_name: windows
assets_path: dist/naturtag/_internal/assets/data
fail-fast: false
defaults:
run:
Expand Down Expand Up @@ -46,32 +51,22 @@ jobs:
run: uv run pyinstaller -y packaging/naturtag.spec

# Include taxon FTS db, compress, and set platform name
- name: Finish pyinstaller package (Linux)
if: startsWith(matrix.os, 'ubuntu')
run: |
ASSETS=dist/naturtag/_internal/assets/data
tar -xvzf $ASSETS/taxonomy.tar.gz --directory $ASSETS/
rm $ASSETS/taxonomy.tar.gz
tar -C dist/naturtag/ -czvf naturtag-linux.tar.gz .
echo 'DIST_NAME=linux' >> $GITHUB_ENV

- name: Finish pyinstaller package (macOS)
if: startsWith(matrix.os, 'macos')
- name: Finish pyinstaller package
run: |
ASSETS=dist/naturtag.app/Contents/Resources/assets/data
ASSETS=${{ matrix.assets_path }}
tar -xvzf $ASSETS/taxonomy.tar.gz --directory $ASSETS/
rm $ASSETS/taxonomy.tar.gz
tar -C dist/naturtag/ -czvf naturtag-macos.tar.gz .
echo 'DIST_NAME=macos' >> $GITHUB_ENV
tar -C dist/naturtag/ -czvf naturtag-${{ matrix.dist_name }}.tar.gz .

- name: Finish pyinstaller package (Windows)
# Build Windows installer with Inno Setup
- name: Install Inno Setup
if: startsWith(matrix.os, 'windows')
run: choco install innosetup -y
- name: Build Windows installer
if: startsWith(matrix.os, 'windows')
run: |
ASSETS=dist/naturtag/_internal/assets/data
tar -xvzf $ASSETS/taxonomy.tar.gz --directory $ASSETS/
rm $ASSETS/taxonomy.tar.gz
tar -C dist/naturtag/ -czvf naturtag-windows.tar.gz .
echo 'DIST_NAME=windows' >> $GITHUB_ENV
APP_VERSION=$(uv run python packaging/get_version.py)
iscc //DAppVersion=$APP_VERSION packaging/naturtag.iss

# Build deb, rpm, and pacman packages
- name: Build Linux packages with FPM
Expand Down Expand Up @@ -105,50 +100,58 @@ jobs:

# Upload workflow artifacts
- name: Upload pyinstaller package
uses: actions/upload-artifact@v6
uses: actions/upload-artifact@v7
with:
name: naturtag-${{ env.DIST_NAME }}.tar.gz
path: naturtag-${{ env.DIST_NAME }}.tar.gz
name: naturtag-${{ matrix.dist_name }}.tar.gz
path: naturtag-${{ matrix.dist_name }}.tar.gz

- name: Upload disk image (macOS)
if: startsWith(matrix.os, 'macos')
uses: actions/upload-artifact@v6
uses: actions/upload-artifact@v7
with:
name: naturtag.dmg
path: dist/naturtag.dmg

- name: Upload FPM workflow artifacts (Linux)
if: startsWith(matrix.os, 'ubuntu')
uses: actions/upload-artifact@v6
uses: actions/upload-artifact@v7
with:
name: naturtag-fpm
path: dist/naturtag.*

- name: Upload AppImage (Linux)
if: startsWith(matrix.os, 'ubuntu')
uses: actions/upload-artifact@v6
uses: actions/upload-artifact@v7
with:
name: naturtag.AppImage
path: dist/naturtag.AppImage

- name: Upload Windows installer
if: startsWith(matrix.os, 'windows')
uses: actions/upload-artifact@v7
with:
name: naturtag-installer.exe
path: dist/naturtag-installer.exe

# Create a release with all workflow artifacts attached
release-app-packages:
if: startsWith(github.ref, 'refs/tags/')
runs-on: ubuntu-latest
needs: build-app-packages
permissions:
contents: write
steps:
- uses: actions/download-artifact@v7
- name: Collect artifacts from workflow subdirs
run: |
find . -type d -depth -name 'naturtag*' -exec mv {} {}_dir \;
find . -type f -mindepth 2 -exec mv -- {} . \;
rmdir *_dir
ls -ARl
with:
pattern: naturtag*
path: release-assets
merge-multiple: true
- run: ls -l release-assets/

- name: Create release
uses: softprops/action-gh-release@v2
with:
files: 'naturtag*'
files: 'release-assets/naturtag*'
body: |
See changelog for release details: https://github.com/pyinat/naturtag/blob/main/HISTORY.md
See docs for installation instructions: https://naturtag.readthedocs.io/en/stable/installation.html
Expand Down
1 change: 1 addition & 0 deletions HISTORY.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
**Packaging:**
* Build pacman package for Arch Linux
* Build AppImage package for other Linux distros not covered by other formats (replaces snap package)
* Automate Windows installer build with Inno Setup (replaces Actual Installer)
* Include locale data in PyInstaller packages
* Update packaged taxonomy db with iNaturalist data from February 2026
* Upgrade to Qt 6.10
Expand Down
6 changes: 0 additions & 6 deletions packaging/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,8 @@ This directory contains scripts and config for building Naturtag packages in the
* Export full db with `export_taxa_full.sh`
* This will create a file `taxonomy-full.tar.gz` to upload later

## Windows Installer
* Update version in `pyproject.toml` and Actual Installer config (`naturtag.aip`)
* On a Windows machine or VM, build the project locally and create an installer with Actual Installer.
* See steps in `build_win.ps1` for details (not fully automated; requires GUI interaction)

## Release
* Create and push new git tag. This will trigger jobs to build packages and create a new GitHub release.
* Most release assets will be built by the CI job, except for the following, which must be uploaded manually:
* Full taxonomy db (`taxonomy-full.tar.gz`)
* Windows installer (`naturtag-installer.exe`)
* Publish the GitHub release (by default, it will be created in draft mode)
14 changes: 5 additions & 9 deletions packaging/build_win.ps1
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# Build pyinstaller package prior to creating Windows installer

# Create virtualenv (if needed)
# python3.14 -m venv $env:USERPROFILE\.virtualenvs\naturtag
# Build pyinstaller package and Windows installer
# (for local builds; not used by CI)

# Install uv (if needed)
# Invoke-RestMethod https://astral.sh/uv/install.ps1 | Invoke-Expression
Expand All @@ -10,8 +8,6 @@
uv sync --no-dev
uv run pyinstaller -y packaging\naturtag.spec

# Launch Actual Installer, then:
# 1. Run 'Build Project' (F9)
# 2. Run installer
# 3. Open Naturtag and test basic features
Invoke-Item packaging\naturtag.aip
# Build installer with Inno Setup
$version = uv run python packaging\get_version.py
iscc /DAppVersion=$version packaging\naturtag.iss
2 changes: 0 additions & 2 deletions packaging/latest.txt

This file was deleted.

184 changes: 0 additions & 184 deletions packaging/naturtag.aip

This file was deleted.

Binary file removed packaging/naturtag.ifp
Binary file not shown.
Loading