-
-
Notifications
You must be signed in to change notification settings - Fork 1
106 lines (103 loc) · 4.49 KB
/
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
103
104
105
106
name: Build release
on:
push:
tags:
- "v*"
jobs:
source-release:
name: Make source release
runs-on: ubuntu-20.04
env:
GH_TOKEN: ${{ github.token }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install non-Python build dependencies
run: sudo apt-get -y install gettext
- name: Install Python dependencies
run: pip install tox build pygame i18nparse importlib-resources typing-extensions platformdirs pyscroll pytmx
- name: Build
run: make dist
- name: Make the release
run: gh release create ${{ github.ref_name }} --title "Release ${{ github.ref_name}}" dist/*
binary-release:
name: Make binary release
needs: source-release
strategy:
matrix:
# Use oldest available macOS for greatest compatibility of resulting binary.
os: [ubuntu-20.04, macos-13, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
env:
GH_TOKEN: ${{ github.token }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install non-Python build dependencies (Ubuntu)
if: ${{ matrix.os == 'ubuntu-20.04' }}
run: sudo apt-get -y install gettext
- name: Install non-Python build dependencies (Windows)
if: ${{ matrix.os == 'windows-latest' }}
run: |
nuget install Gettext.Tools -Version 0.22.4 -OutputDirectory c:\nuget;
Add-Content $env:GITHUB_PATH "C:\nuget\Gettext.Tools.0.22.4\tools\bin"
- name: Install Python dependencies
run: pip install tox build setuptools pygame i18nparse importlib-resources typing-extensions platformdirs pyscroll pytmx
- name: Install additional dependencies for binary builds
run: pip install pyinstaller
- name: Build
run: make dist
- name: Build the executable (Ubuntu)
if: ${{ matrix.os == 'ubuntu-20.04' }}
run: |
pyinstaller --noconfirm --onefile --windowed --name wincoll-${{ runner.os }}-${{ runner.arch }} --add-data "wincoll/*.wav:wincoll/" --add-data "wincoll/*.png:wincoll/" --add-data "wincoll/*.ttf:wincoll/" --add-data "wincoll/levels:wincoll/levels" --add-data "wincoll/locale:wincoll/locale" wincoll/__main__.py
./dist/wincoll-${{ runner.os }}-${{ runner.arch }} --help
- name: Build the executable (macOS)
if: ${{ matrix.os == 'macos-13' || matrix.os == 'macos-latest' }}
run: |
./make-macos-icns ./wincoll/levels/Win.png wincoll.iconset
pyi-makespec --windowed --name WinColl --icon wincoll.icns --add-data "wincoll/*.wav:wincoll/" --add-data "wincoll/*.png:wincoll/" --add-data "wincoll/*.ttf:wincoll/" --add-data "wincoll/levels:wincoll/levels" --add-data "wincoll/locale:wincoll/locale" wincoll/__main__.py
export version=$(grep version pyproject.toml)
sed -i '' -e "s/\(name='WinColl.app'\)/\1,\n $version/" wincoll.spec
pyinstaller --noconfirm wincoll.spec
brew install create-dmg
mkdir dmg-folder
mv dist/wincoll.app dmg-folder/
create-dmg --volname "WinColl ${{ github.ref_name }}" ./dist/wincoll-${{ runner.os }}-${{ runner.arch }}.dmg dmg-folder/
- name: Build the executable (Windows)
if: ${{ matrix.os == 'windows-latest' }}
run: |
pip install cx_Freeze
cxfreeze bdist_msi
- name: Upload the binary (Ubuntu and macOS)
if: ${{ matrix.os != 'windows-latest' }}
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ github.token }}
tag: ${{ github.ref }}
file: ./dist/wincoll-${{ runner.os }}-${{ runner.arch }}*
file_glob: true
- name: Upload the binary (Windows)
if: ${{ matrix.os == 'windows-latest' }}
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ github.token }}
tag: ${{ github.ref }}
file: ./dist/wincoll*.msi
file_glob: true
- name: Build the RISC OS distribution
if: ${{ matrix.os == 'ubuntu-20.04' }}
run: ./dist-riscos
- name: Upload the RISC OS distribution
if: ${{ matrix.os == 'ubuntu-20.04' }}
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ github.token }}
tag: ${{ github.ref }}
file: ./dist/wincoll-riscos.zip
file_glob: true