-
Notifications
You must be signed in to change notification settings - Fork 0
134 lines (109 loc) · 4.07 KB
/
compile-executable.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
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
name: Compile Executable
on:
release:
types: [published]
workflow_dispatch:
inputs:
version:
description: "Version of Release to upload to"
required: true
type: string
permissions:
contents: write
jobs:
windows:
strategy:
matrix:
spec-file: [nott-your-timetable.spec, nott-your-timetable-folder.spec]
include:
- spec-file: nott-your-timetable.spec
extension: .exe
- spec-file: nott-your-timetable-folder.spec
extension: .zip
runs-on: windows-latest
env:
version: ${{ inputs.version || github.event.release.tag_name }}
defaults:
run:
shell: msys2 {0}
steps:
- name: Installing msys2
uses: msys2/setup-msys2@v2
with:
update: true
msystem: mingw64
install: >-
zip
mingw-w64-x86_64-gtk4
mingw-w64-x86_64-python3-gobject
mingw-w64-x86_64-python3-pip
- uses: actions/checkout@v3
with:
ref: ${{ env.version }}
- name: Installing nott-your-timetable and pyinstaller
run: |
python -m pip install -e .
python -m pip install pyinstaller
- name: Compiling Executable
run: pyinstaller ${{ matrix.spec-file }}
- name: Zipping Folder
if: (matrix.spec-file == 'nott-your-timetable-folder.spec')
run: |
cd dist/
zip -r nott-your-timetable.zip nott-your-timetable
- name: Uploading Executable
run: gh release upload ${{ env.version }} dist/nott-your-timetable${{ matrix.extension }}
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
shell: bash
macos:
runs-on: macos-latest
strategy:
matrix:
spec-file: [nott-your-timetable.spec, nott-your-timetable-folder.spec]
include:
- spec-file: nott-your-timetable-folder.spec
name: -folder
env:
version: ${{ inputs.version || github.event.release.tag_name }}
steps:
- uses: actions/checkout@v3
with:
ref: ${{ env.version }}
- name: Installing System Dependencies
run: brew install pygobject3 gtk4
- name: Set up Python "3.10"
uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Installing nott-your-timetable and pyinstaller
run: |
python -m pip install -e .
python -m pip install pyinstaller
- name: Compiling Executable
run: pyinstaller ${{ matrix.spec-file }}
# - name: Setup Node
# uses: actions/setup-node@v3
# with:
# node-version: latest
# - name: Installing create-dmg
# run: npm install --global create-dmg
- name: Zipping App Bundles
run: |
cd dist/
zip -r nott-your-timetable-macos${{ matrix.name }}.zip nott-your-timetable.app
# - name: Making dmg
# https://stackoverflow.com/questions/286419/how-to-build-a-dmg-mac-os-x-file-on-a-non-mac-platform
# https://stackoverflow.com/questions/96882/how-do-i-create-a-nice-looking-dmg-for-mac-os-x-using-command-line-tools
# Code Signing
# https://developer.apple.com/library/archive/documentation/Security/Conceptual/CodeSigningGuide/Procedures/Procedures.html
# https://github.com/pyinstaller/pyinstaller/wiki/Recipe-OSX-Code-Signing
# https://developer.apple.com/library/archive/technotes/tn2206/_index.html
# https://stackoverflow.com/questions/66693435/step-by-step-recipe-for-signing-mac-installers-dmg
# run: |
# cd dist/
# create-dmg 'nott-your-timetable.app' --dmg-title='nott-your-timetable-${{ matrix.name }}' --identity='io.github.nott-your-timetable'
- name: Uploading Executable
run: gh release upload ${{ env.version }} dist/nott-your-timetable-macos${{ matrix.name }}.zip
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}