Skip to content

Commit 8780063

Browse files
committed
2 parents c6d2a89 + ecea6ef commit 8780063

File tree

3 files changed

+191
-0
lines changed

3 files changed

+191
-0
lines changed

.github/workflows/release.yml

Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- v[0-9]+.[0-9]+.[0-9]+*
7+
8+
jobs:
9+
linux:
10+
strategy:
11+
matrix:
12+
build-type: ['', portable]
13+
include:
14+
- build-type: ''
15+
build-flag: ''
16+
suffix: ''
17+
- build-type: portable
18+
build-flag: --portable
19+
suffix: _portable
20+
runs-on: ubuntu-22.04
21+
steps:
22+
- uses: actions/checkout@v4
23+
- uses: actions/setup-python@v5
24+
with:
25+
python-version: '3.12'
26+
- run: pip install -Ur requirements.txt pyinstaller
27+
- run: pyinstaller tagstudio.spec -- ${{ matrix.build-flag }}
28+
- run: tar czfC dist/tagstudio_linux_x86_64${{ matrix.suffix }}.tar.gz dist tagstudio
29+
- uses: actions/upload-artifact@v4
30+
with:
31+
name: tagstudio_linux_x86_64${{ matrix.suffix }}
32+
path: dist/tagstudio_linux_x86_64${{ matrix.suffix }}.tar.gz
33+
34+
macos:
35+
strategy:
36+
matrix:
37+
os-version: ['11', '14']
38+
include:
39+
- os-version: '11'
40+
arch: x86_64
41+
- os-version: '14'
42+
arch: aarch64
43+
runs-on: macos-${{ matrix.os-version }}
44+
env:
45+
MACOSX_DEPLOYMENT_TARGET: '11.0'
46+
steps:
47+
- uses: actions/checkout@v4
48+
- uses: actions/setup-python@v5
49+
with:
50+
python-version: '3.12'
51+
- run: pip install -Ur requirements.txt pyinstaller
52+
- run: pyinstaller tagstudio.spec
53+
- run: tar czfC dist/tagstudio_macos_${{ matrix.arch }}.tar.gz dist TagStudio.app
54+
- uses: actions/upload-artifact@v4
55+
with:
56+
name: tagstudio_macos_${{ matrix.arch }}
57+
path: dist/tagstudio_macos_${{ matrix.arch }}.tar.gz
58+
59+
windows:
60+
strategy:
61+
matrix:
62+
build-type: ['', portable]
63+
include:
64+
- build-type: ''
65+
build-flag: ''
66+
suffix: ''
67+
file-end: ''
68+
- build-type: portable
69+
build-flag: --portable
70+
suffix: _portable
71+
file-end: .exe
72+
runs-on: windows-2019
73+
steps:
74+
- uses: actions/checkout@v4
75+
- uses: actions/setup-python@v5
76+
with:
77+
python-version: '3.12'
78+
- run: pip install -Ur requirements.txt pyinstaller
79+
- run: PyInstaller tagstudio.spec -- ${{ matrix.build-flag }}
80+
- run: Compress-Archive -Path dist/TagStudio${{ matrix.file-end }} -DestinationPath dist/tagstudio_windows_x86_64${{ matrix.suffix }}.zip
81+
- uses: actions/upload-artifact@v4
82+
with:
83+
name: tagstudio_windows_x86_64${{ matrix.suffix }}
84+
path: dist/tagstudio_windows_x86_64${{ matrix.suffix }}.zip
85+
86+
publish:
87+
needs: [linux, macos, windows]
88+
runs-on: ubuntu-latest
89+
permissions:
90+
contents: write
91+
steps:
92+
- uses: actions/checkout@v4
93+
- uses: actions/download-artifact@v4
94+
- uses: softprops/action-gh-release@v2
95+
with:
96+
files: |
97+
tagstudio_linux_x86_64/*
98+
tagstudio_linux_x86_64_portable/*
99+
tagstudio_macos_x86_64/*
100+
tagstudio_macos_x86_64_portable/*
101+
tagstudio_macos_arm64/*
102+
tagstudio_macos_arm64_portable/*
103+
tagstudio_windows_x86_64/*
104+
tagstudio_windows_x86_64_portable/*

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ MANIFEST
3535
# before PyInstaller builds the exe, so as to inject date/other infos into it.
3636
*.manifest
3737
*.spec
38+
!tagstudio.spec
3839

3940
# Installer logs
4041
pip-log.txt

tagstudio.spec

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
# -*- mode: python ; coding: utf-8 -*-
2+
# vi: ft=python
3+
4+
5+
from argparse import ArgumentParser
6+
import sys
7+
from PyInstaller.building.api import COLLECT, EXE, PYZ
8+
from PyInstaller.building.build_main import Analysis
9+
from PyInstaller.building.osx import BUNDLE
10+
11+
12+
parser = ArgumentParser()
13+
parser.add_argument('--portable', action='store_true')
14+
options = parser.parse_args()
15+
16+
17+
name = 'TagStudio' if sys.platform == 'win32' else 'tagstudio'
18+
icon = None
19+
if sys.platform == 'win32':
20+
icon = 'tagstudio/resources/icon.ico'
21+
elif sys.platform == 'darwin':
22+
icon = 'tagstudio/resources/icon.icns'
23+
24+
25+
a = Analysis(
26+
['tagstudio/tag_studio.py'],
27+
pathex=[],
28+
binaries=[],
29+
datas=[('tagstudio/resources', 'resources')],
30+
hiddenimports=[],
31+
hookspath=[],
32+
hooksconfig={},
33+
excludes=[],
34+
runtime_hooks=[],
35+
noarchive=False,
36+
optimize=0,
37+
)
38+
39+
pyz = PYZ(a.pure)
40+
41+
include = [a.scripts]
42+
if options.portable:
43+
include += (a.binaries, a.datas)
44+
exe = EXE(
45+
pyz,
46+
*include,
47+
[],
48+
bootloader_ignore_signals=False,
49+
console=False,
50+
hide_console='hide-early',
51+
disable_windowed_traceback=False,
52+
debug=False,
53+
name=name,
54+
exclude_binaries=not options.portable,
55+
icon=icon,
56+
argv_emulation=False,
57+
target_arch=None,
58+
codesign_identity=None,
59+
entitlements_file=None,
60+
strip=False,
61+
upx=True,
62+
upx_exclude=[],
63+
runtime_tmpdir=None
64+
)
65+
66+
coll = None if options.portable else COLLECT(
67+
exe,
68+
a.binaries,
69+
a.datas,
70+
name=name,
71+
strip=False,
72+
upx=True,
73+
upx_exclude=[],
74+
)
75+
76+
app = BUNDLE(
77+
exe if coll is None else coll,
78+
name='TagStudio.app',
79+
icon=icon,
80+
bundle_identifier='com.github.tagstudiodev',
81+
version='0.0.0',
82+
info_plist={
83+
'NSAppleScriptEnabled': False,
84+
'NSPrincipalClass': 'NSApplication',
85+
}
86+
)

0 commit comments

Comments
 (0)