2
2
3
3
name : Build
4
4
5
- on : workflow_dispatch
5
+ on :
6
+ push :
7
+ paths :
8
+ - ' .github/workflows/build.yml'
9
+ - ' setup.py'
10
+ - ' requirements.txt'
11
+ - ' *.iss'
12
+ pull_request :
13
+ paths :
14
+ - ' .github/workflows/build.yml'
15
+ - ' setup.py'
16
+ - ' requirements.txt'
17
+ - ' *.iss'
18
+ workflow_dispatch :
6
19
7
20
env :
8
- SNI_VERSION : v0.0.88
9
21
ENEMIZER_VERSION : 7.1
10
22
APPIMAGETOOL_VERSION : 13
11
23
12
24
jobs :
13
25
# build-release-macos: # LF volunteer
14
26
15
- build-win-py38 : # RCs will still be built and signed by hand
27
+ build-win : # RCs will still be built and signed by hand
16
28
runs-on : windows-latest
17
29
steps :
18
- - uses : actions/checkout@v2
30
+ - uses : actions/checkout@v4
19
31
- name : Install python
20
- uses : actions/setup-python@v3
32
+ uses : actions/setup-python@v5
21
33
with :
22
- python-version : ' 3.8'
34
+ python-version : ' ~3.12.7'
35
+ check-latest : true
23
36
- name : Download run-time dependencies
24
37
run : |
25
- Invoke-WebRequest -Uri https://github.com/alttpo/sni/releases/download/${Env:SNI_VERSION}/sni-${Env:SNI_VERSION}-windows-amd64.zip -OutFile sni.zip
26
- Expand-Archive -Path sni.zip -DestinationPath SNI -Force
27
38
Invoke-WebRequest -Uri https://github.com/Ijwu/Enemizer/releases/download/${Env:ENEMIZER_VERSION}/win-x64.zip -OutFile enemizer.zip
28
39
Expand-Archive -Path enemizer.zip -DestinationPath EnemizerCLI -Force
40
+ choco install innosetup --version=6.2.2 --allow-downgrade
29
41
- name : Build
30
42
run : |
31
- python -m pip install --upgrade pip setuptools
32
- pip install -r requirements.txt
43
+ python -m pip install --upgrade pip
33
44
python setup.py build_exe --yes
34
- $NAME="$(ls build)".Split('.',2)[1]
45
+ if ( $? -eq $false ) {
46
+ Write-Error "setup.py failed!"
47
+ exit 1
48
+ }
49
+ $NAME="$(ls build | Select-String -Pattern 'exe')".Split('.',2)[1]
35
50
$ZIP_NAME="Archipelago_$NAME.7z"
51
+ echo "$NAME -> $ZIP_NAME"
36
52
echo "ZIP_NAME=$ZIP_NAME" >> $Env:GITHUB_ENV
37
53
New-Item -Path dist -ItemType Directory -Force
38
54
cd build
39
- Rename-Item exe.$NAME Archipelago
55
+ Rename-Item " exe.$NAME" Archipelago
40
56
7z a -mx=9 -mhe=on -ms "../dist/$ZIP_NAME" Archipelago
57
+ Rename-Item Archipelago "exe.$NAME" # inno_setup.iss expects the original name
58
+ - name : Build Setup
59
+ run : |
60
+ & "${env:ProgramFiles(x86)}\Inno Setup 6\iscc.exe" inno_setup.iss /DNO_SIGNTOOL
61
+ if ( $? -eq $false ) {
62
+ Write-Error "Building setup failed!"
63
+ exit 1
64
+ }
65
+ $contents = Get-ChildItem -Path setups/*.exe -Force -Recurse
66
+ $SETUP_NAME=$contents[0].Name
67
+ echo "SETUP_NAME=$SETUP_NAME" >> $Env:GITHUB_ENV
68
+ - name : Check build loads expected worlds
69
+ shell : bash
70
+ run : |
71
+ cd build/exe*
72
+ mv Players/Templates/meta.yaml .
73
+ ls -1 Players/Templates | sort > setup-player-templates.txt
74
+ rm -R Players/Templates
75
+ timeout 30 ./ArchipelagoLauncher "Generate Template Options" || true
76
+ ls -1 Players/Templates | sort > generated-player-templates.txt
77
+ cmp setup-player-templates.txt generated-player-templates.txt \
78
+ || diff setup-player-templates.txt generated-player-templates.txt
79
+ mv meta.yaml Players/Templates/
80
+ - name : Test Generate
81
+ shell : bash
82
+ run : |
83
+ cd build/exe*
84
+ cp Players/Templates/Clique.yaml Players/
85
+ timeout 30 ./ArchipelagoGenerate
41
86
- name : Store 7z
42
- uses : actions/upload-artifact@v2
87
+ uses : actions/upload-artifact@v4
43
88
with :
44
89
name : ${{ env.ZIP_NAME }}
45
90
path : dist/${{ env.ZIP_NAME }}
91
+ compression-level : 0 # .7z is incompressible by zip
92
+ if-no-files-found : error
93
+ retention-days : 7 # keep for 7 days, should be enough
94
+ - name : Store Setup
95
+ uses : actions/upload-artifact@v4
96
+ with :
97
+ name : ${{ env.SETUP_NAME }}
98
+ path : setups/${{ env.SETUP_NAME }}
99
+ if-no-files-found : error
46
100
retention-days : 7 # keep for 7 days, should be enough
47
101
48
- build-ubuntu1804 :
49
- runs-on : ubuntu-18 .04
102
+ build-ubuntu2004 :
103
+ runs-on : ubuntu-20 .04
50
104
steps :
51
105
# - copy code below to release.yml -
52
- - uses : actions/checkout@v2
106
+ - uses : actions/checkout@v4
53
107
- name : Install base dependencies
54
108
run : |
55
109
sudo apt update
56
110
sudo apt -y install build-essential p7zip xz-utils wget libglib2.0-0
57
111
sudo apt -y install python3-gi libgirepository1.0-dev # should pull dependencies for gi installation below
58
112
- name : Get a recent python
59
- uses : actions/setup-python@v3
113
+ uses : actions/setup-python@v5
60
114
with :
61
- python-version : ' 3.9'
115
+ python-version : ' ~3.12.7'
116
+ check-latest : true
62
117
- name : Install build-time dependencies
63
118
run : |
64
- echo "PYTHON=python3.9 " >> $GITHUB_ENV
119
+ echo "PYTHON=python3.12 " >> $GITHUB_ENV
65
120
wget -nv https://github.com/AppImage/AppImageKit/releases/download/$APPIMAGETOOL_VERSION/appimagetool-x86_64.AppImage
66
121
chmod a+rx appimagetool-x86_64.AppImage
67
122
./appimagetool-x86_64.AppImage --appimage-extract
68
123
echo -e '#/bin/sh\n./squashfs-root/AppRun "$@"' > appimagetool
69
124
chmod a+rx appimagetool
70
125
- name : Download run-time dependencies
71
126
run : |
72
- wget -nv https://github.com/alttpo/sni/releases/download/$SNI_VERSION/sni-$SNI_VERSION-manylinux2014-amd64.tar.xz
73
- tar xf sni-*.tar.xz
74
- rm sni-*.tar.xz
75
- mv sni-* SNI
76
127
wget -nv https://github.com/Ijwu/Enemizer/releases/download/$ENEMIZER_VERSION/ubuntu.16.04-x64.7z
77
128
7za x -oEnemizerCLI/ ubuntu.16.04-x64.7z
78
129
- name : Build
@@ -81,26 +132,50 @@ jobs:
81
132
# charset-normalizer was somehow incomplete in the github runner
82
133
"${{ env.PYTHON }}" -m venv venv
83
134
source venv/bin/activate
84
- "${{ env.PYTHON }}" -m pip install --upgrade pip PyGObject setuptools charset-normalizer
85
- pip install -r requirements.txt
135
+ "${{ env.PYTHON }}" -m pip install --upgrade pip PyGObject charset-normalizer
86
136
python setup.py build_exe --yes bdist_appimage --yes
87
137
echo -e "setup.py build output:\n `ls build`"
88
138
echo -e "setup.py dist output:\n `ls dist`"
89
139
cd dist && export APPIMAGE_NAME="`ls *.AppImage`" && cd ..
90
140
export TAR_NAME="${APPIMAGE_NAME%.AppImage}.tar.gz"
91
- (cd build && DIR_NAME="`ls | grep exe`" && mv "$DIR_NAME" Archipelago && tar -czvf ../dist/$TAR_NAME Archipelago && mv Archipelago "$DIR_NAME")
141
+ (cd build && DIR_NAME="`ls | grep exe`" && mv "$DIR_NAME" Archipelago && tar -cv Archipelago | gzip -8 > ../dist/$TAR_NAME && mv Archipelago "$DIR_NAME")
92
142
echo "APPIMAGE_NAME=$APPIMAGE_NAME" >> $GITHUB_ENV
93
143
echo "TAR_NAME=$TAR_NAME" >> $GITHUB_ENV
94
144
# - copy code above to release.yml -
145
+ - name : Build Again
146
+ run : |
147
+ source venv/bin/activate
148
+ python setup.py build_exe --yes
149
+ - name : Check build loads expected worlds
150
+ shell : bash
151
+ run : |
152
+ cd build/exe*
153
+ mv Players/Templates/meta.yaml .
154
+ ls -1 Players/Templates | sort > setup-player-templates.txt
155
+ rm -R Players/Templates
156
+ timeout 30 ./ArchipelagoLauncher "Generate Template Options" || true
157
+ ls -1 Players/Templates | sort > generated-player-templates.txt
158
+ cmp setup-player-templates.txt generated-player-templates.txt \
159
+ || diff setup-player-templates.txt generated-player-templates.txt
160
+ mv meta.yaml Players/Templates/
161
+ - name : Test Generate
162
+ shell : bash
163
+ run : |
164
+ cd build/exe*
165
+ cp Players/Templates/Clique.yaml Players/
166
+ timeout 30 ./ArchipelagoGenerate
95
167
- name : Store AppImage
96
- uses : actions/upload-artifact@v2
168
+ uses : actions/upload-artifact@v4
97
169
with :
98
170
name : ${{ env.APPIMAGE_NAME }}
99
171
path : dist/${{ env.APPIMAGE_NAME }}
172
+ if-no-files-found : error
100
173
retention-days : 7
101
174
- name : Store .tar.gz
102
- uses : actions/upload-artifact@v2
175
+ uses : actions/upload-artifact@v4
103
176
with :
104
177
name : ${{ env.TAR_NAME }}
105
178
path : dist/${{ env.TAR_NAME }}
179
+ compression-level : 0 # .gz is incompressible by zip
180
+ if-no-files-found : error
106
181
retention-days : 7
0 commit comments