-
Notifications
You must be signed in to change notification settings - Fork 4
158 lines (140 loc) · 4.99 KB
/
Copy pathrelease.yml
File metadata and controls
158 lines (140 loc) · 4.99 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
# Build platform-specific packages and create a GitHub release with artifacts
name: Release
on:
push:
tags: ['v*']
workflow_dispatch:
env:
PYTHON_VERSION: '3.14'
jobs:
build-app-packages:
strategy:
matrix:
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:
shell: bash
runs-on: ${{ matrix.os }}
steps:
# Install binary dependencies
- name: Install system packages
if: startsWith(matrix.os, 'ubuntu')
run: |
sudo apt-get update
sudo apt-get install -y '^libxcb.*-dev' libegl-dev libwebp-dev libpng16-16 libx11-xcb-dev rpm
# Install dependencies, with caching
- uses: actions/checkout@v6
- uses: astral-sh/setup-uv@v7
with:
enable-cache: true
cache-dependency-glob: uv.lock
- name: Install python + dependencies
run: |
uv python install ${{ env.PYTHON_VERSION }}
uv sync --no-dev
- name: Build pyinstaller package
run: uv run pyinstaller -y packaging/naturtag.spec
# Include taxon FTS db, compress, and set platform name
- name: Finish pyinstaller package
run: |
ASSETS=${{ matrix.assets_path }}
tar -xvzf $ASSETS/taxonomy.tar.gz --directory $ASSETS/
rm $ASSETS/taxonomy.tar.gz
tar -C dist/naturtag/ -czvf naturtag-${{ matrix.dist_name }}.tar.gz .
# 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: |
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
if: startsWith(matrix.os, 'ubuntu')
run: |
export GEM_HOME="$(ruby -e 'puts Gem.user_dir')"
export PATH="$PATH:$GEM_HOME/bin"
gem install fpm --user-install
./packaging/build_fpm.sh
# Build AppImage
- name: Build AppImage (Linux)
if: startsWith(matrix.os, 'ubuntu')
run: ./packaging/build_appimage.sh
# Inspect app bundle before signing
- name: Inspect app bundle (macOS)
if: startsWith(matrix.os, 'macos')
run: |
ls -la dist/naturtag.app/Contents/
cat dist/naturtag.app/Contents/Info.plist
codesign --verify --verbose=4 dist/naturtag.app 2>&1 || true
codesign -dvvv dist/naturtag.app 2>&1 || true
# Build dmg package
- name: Build disk image (macOS)
if: startsWith(matrix.os, 'macos')
run: |
brew install create-dmg
./packaging/build_dmg.sh
# Upload workflow artifacts
- name: Upload pyinstaller package
uses: actions/upload-artifact@v7
with:
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@v7
with:
name: naturtag.dmg
path: dist/naturtag.dmg
- name: Upload FPM workflow artifacts (Linux)
if: startsWith(matrix.os, 'ubuntu')
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@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
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: '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
draft: true