Repository navigation
96 lines (84 loc) · 2.72 KB
/
Copy pathpython-app.yml
File metadata and controls
96 lines (84 loc) · 2.72 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
name: Build SmolSlimeConfigurator
on:
push:
branches: [main]
pull_request:
branches: [main]
workflow_dispatch:
release:
types: [published]
jobs:
build:
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
artifact: SmolSlime-Linux
executable: SmolSlimeConfigurator-Linux
- os: macos-latest
artifact: SmolSlime-macOS
executable: SmolSlimeConfigurator-macOS
- os: windows-latest
artifact: SmolSlime-Windows
executable: SmolSlimeConfigurator-Windows
runs-on: ${{ matrix.os }}
steps:
- name: Check out source
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install -r requirements.txt pyinstaller
- name: Build executable
shell: bash
run: |
icon_args=()
if [[ "$RUNNER_OS" == "macOS" ]]; then
icon_args+=(--icon icon.icns)
fi
pyinstaller --noconfirm --clean --onefile --windowed \
--name ${{ matrix.executable }} \
--collect-all PySide6 \
--add-data "Main.qml${{ runner.os == 'Windows' && ';' || ':' }}." \
--add-data "ActionButton.qml${{ runner.os == 'Windows' && ';' || ':' }}." \
--add-data "icon.png${{ runner.os == 'Windows' && ';' || ':' }}." \
"${icon_args[@]}" \
SmolSlimeConfiguratorV10.py
- name: Package macOS app
if: runner.os == 'macOS'
run: ditto -c -k --sequesterRsrc --keepParent "dist/${{ matrix.executable }}.app" "dist/${{ matrix.executable }}.zip"
- name: Upload executable
if: runner.os != 'macOS'
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.artifact }}
path: dist/${{ matrix.executable }}*
if-no-files-found: error
- name: Upload macOS app archive
if: runner.os == 'macOS'
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.artifact }}
path: dist/${{ matrix.executable }}.zip
if-no-files-found: error
publish-release:
if: github.event_name == 'release'
needs: build
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Download platform builds
uses: actions/download-artifact@v4
with:
pattern: SmolSlime-*
path: release-assets
- name: Attach builds to release
uses: softprops/action-gh-release@v2
with:
files: release-assets/**/*