-
Notifications
You must be signed in to change notification settings - Fork 2
102 lines (99 loc) · 3.94 KB
/
build-release.yml
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
name: Build and release
on:
push:
tags:
- '*'
jobs:
release-macos:
name: Release macOS app
runs-on: macos-12
steps:
- name: Checkout repo
uses: actions/checkout@v2
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: '3.9'
architecture: x64
- name: Install dependencies
run: pip install -r requirements-dev.txt
# see https://docs.github.com/en/actions/guides/building-and-testing-python#specifying-a-python-version
- name: Create app with pyinstaller
run: PYTHONOPTIMIZE=1 pyinstaller --windowed --name "Study Planner" --add-binary '/Users/runner/hostedtoolcache/Python/3.9.*/x64/lib/python3.9/site-packages/pymediainfo/libmediainfo*.dylib:.' --icon icons/icon_square_rounded.icns main.py
- name: Enable dark mode support and add info to app
run: python utils/edit_mac_app_info.py
# - name: Codesign app
# run: sudo codesign --deep -s "Study Planner" Study\ Planner.app
- name: Compress app to archive
run: |
cd dist
cp ../utils/RUNME.command .
zip -r StudyPlanner.zip Study\ Planner.app RUNME.command
cd ..
- name: Upload binaries to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: dist/StudyPlanner.zip
asset_name: study-planner-macos-x86_64-$tag.zip
tag: ${{ github.ref }}
release-windows:
name: Release Windows app
runs-on: windows-2022
steps:
- name: Checkout repo
uses: actions/checkout@v2
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: '3.9.0'
architecture: x64
- name: Install dependencies
run: pip install -r requirements-dev.txt
shell: cmd
# see https://docs.github.com/en/actions/guides/building-and-testing-python#specifying-a-python-version
- name: Create app with pyinstaller
run: set PYTHONOPTIMIZE=1 && pyinstaller --windowed --name "Study Planner" --add-binary C:\hostedtoolcache\windows\python\3.9.0\x64\lib\site-packages\pymediainfo\MediaInfo.dll;. --add-data icons;icons --icon icons\icon_round.ico --onefile main.py --version-file windows_version_file.py
shell: cmd
- name: Compress app to archive
run: |
cd dist
tar -a -c -f StudyPlanner.zip "Study Planner.exe"
cd ..
- name: Upload binaries to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: dist\StudyPlanner.zip
asset_name: study-planner-windows-x86_64-$tag.zip
tag: ${{ github.ref }}
release-gnulinux:
name: Release on GNU/Linux
runs-on: ubuntu-22.04
steps:
- name: Checkout repo
uses: actions/checkout@v2
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: '3.9'
architecture: x64
# see https://docs.github.com/en/actions/reference/specifications-for-github-hosted-runners#administrative-privileges-of-github-hosted-runners
- name: Install libmediainfo package
run: sudo apt-get install -y libmediainfo-dev
- name: Install dependencies
run: pip install -r requirements-dev.txt
- name: Create app with pyinstaller
run: PYTHONOPTIMIZE=1 pyinstaller --windowed --name "Study Planner" --add-data icons:icons --icon icons/icon_round.ico --onefile main.py
- name: Compress app to archive
run: |
cd dist
tar -czf StudyPlanner.tar.gz Study\ Planner
cd ..
- name: Upload binaries to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: dist/StudyPlanner.tar.gz
asset_name: study-planner-gnulinux-x86_64-$tag.tar.gz
tag: ${{ github.ref }}