forked from Orama-Interactive/Pixelorama
-
Notifications
You must be signed in to change notification settings - Fork 0
222 lines (216 loc) · 10.8 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
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
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
name: Stable release builds
on:
push:
branches: [ release ]
env:
GODOT_VERSION: 4.3
EXPORT_NAME: Pixelorama
TAG: v1.0.4
BUTLER_API_KEY: ${{ secrets.BUTLER_API_KEY }}
jobs:
export-windows:
name: Windows Export 🗔
runs-on: ubuntu-latest
container:
image: docker://barichello/godot-ci:4.3
steps:
- name: Setup WINE and rcedit 🍷
run: |
chown root:root -R ~
godot --headless --quit
echo 'export/windows/wine = "/usr/bin/wine64-stable"' >> ~/.config/godot/editor_settings-4.3.tres
echo 'export/windows/rcedit = "/opt/rcedit.exe"' >> ~/.config/godot/editor_settings-4.3.tres
- name: Checkout 🛎️
uses: actions/checkout@v4
with:
submodules: true
- name: Setup 💻
run: |
mkdir -v -p build/${EXPORT_NAME}-Windows-64bit build/${EXPORT_NAME}-Windows-32bit ~/.local/share/godot/export_templates
mv /root/.local/share/godot/export_templates/${GODOT_VERSION}.stable ~/.local/share/godot/export_templates/${GODOT_VERSION}.stable
- name: Import resources once 📦
continue-on-error: true
run: godot --headless -v --import
- name: Windows Build 🔧
run: |
godot --headless -v --export-release "Windows Desktop 64-bit" ./build/${EXPORT_NAME}-Windows-64bit/${EXPORT_NAME}.exe
godot --headless -v --export-release "Windows Desktop 32-bit" ./build/${EXPORT_NAME}-Windows-32bit/${EXPORT_NAME}.exe
- name: Copy pixelorama_data folder 📁
run: |
rm ./pixelorama_data/.gdignore
cp -R ./pixelorama_data ./build/${EXPORT_NAME}-Windows-64bit
cp -R ./pixelorama_data ./build/${EXPORT_NAME}-Windows-32bit
cp -R ./pixelorama_data ./build
- name: Zip 🗜️
working-directory: ./build
run: |
zip -r ${EXPORT_NAME}-Windows-64bit.zip ${EXPORT_NAME}-Windows-64bit
zip -r ${EXPORT_NAME}-Windows-32bit.zip ${EXPORT_NAME}-Windows-32bit
- name: Build installer 🔧
run: |
apt-get update && apt-get install -y python3 && apt-get install -y nsis
python3 ./installer/utils/po2nsi.py -i ./installer/pixelorama.nsi -o ./installer/pixelorama_loc.nsi -p ./installer/po -l "English" -v
makensis ./installer/pixelorama_loc.nsi
mkdir ./build/installer
mv ./installer/${EXPORT_NAME}_${TAG}_setup.exe ./build
- name: Upload Release Assets to itch.io 🎮
run: |
butler push ./build/${EXPORT_NAME}-Windows-64bit ${{ secrets.ITCHIO_USERNAME }}/${{ secrets.ITCHIO_GAME }}:windows-64 --userversion ${TAG}
butler push ./build/${EXPORT_NAME}-Windows-32bit ${{ secrets.ITCHIO_USERNAME }}/${{ secrets.ITCHIO_GAME }}:windows-32 --userversion ${TAG}
butler push ./build/${EXPORT_NAME}_${TAG}_setup.exe ${{ secrets.ITCHIO_USERNAME }}/${{ secrets.ITCHIO_GAME }}:windows-installer --userversion ${TAG}
- name: Upload Release Asset 🚀
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ./build/*
tag: ${{env.TAG}}
overwrite: true
file_glob: true
export-linux:
name: Linux Export 🐧
runs-on: ubuntu-latest
container:
image: docker://barichello/godot-ci:4.3
steps:
- name: Checkout 🛎️
uses: actions/checkout@v4
with:
submodules: true
- name: Setup 💻
run: |
mkdir -v -p build/${EXPORT_NAME}-Linux-64bit build/${EXPORT_NAME}-Linux-32bit build/${EXPORT_NAME}-Linux-ARM64 build/${EXPORT_NAME}-Linux-ARM32 ~/.local/share/godot/export_templates
mv /root/.local/share/godot/export_templates/${GODOT_VERSION}.stable ~/.local/share/godot/export_templates/${GODOT_VERSION}.stable
- name: Import resources once 📦
continue-on-error: true
run: godot --headless -v --import
- name: Linux Build 🔧
run: |
godot --headless -v --export-release "Linux 64-bit" ./build/${EXPORT_NAME}-Linux-64bit/${EXPORT_NAME}.x86_64
godot --headless -v --export-release "Linux 32-bit" ./build/${EXPORT_NAME}-Linux-32bit/${EXPORT_NAME}.x86_32
godot --headless -v --export-release "Linux ARM64" ./build/${EXPORT_NAME}-Linux-ARM64/${EXPORT_NAME}.arm64
godot --headless -v --export-release "Linux ARM32" ./build/${EXPORT_NAME}-Linux-ARM32/${EXPORT_NAME}.arm32
- name: Give execute permission ☑️
run: |
chmod +x ./build/${EXPORT_NAME}-Linux-64bit/${EXPORT_NAME}.x86_64
chmod +x ./build/${EXPORT_NAME}-Linux-32bit/${EXPORT_NAME}.x86_32
chmod +x ./build/${EXPORT_NAME}-Linux-ARM64/${EXPORT_NAME}.arm64
chmod +x ./build/${EXPORT_NAME}-Linux-ARM32/${EXPORT_NAME}.arm32
- name: Copy pixelorama_data folder 📁
run: |
rm ./pixelorama_data/.gdignore
cp -R ./pixelorama_data ./build/${EXPORT_NAME}-Linux-64bit
cp -R ./pixelorama_data ./build/${EXPORT_NAME}-Linux-32bit
cp -R ./pixelorama_data ./build/${EXPORT_NAME}-Linux-ARM64
cp -R ./pixelorama_data ./build/${EXPORT_NAME}-Linux-ARM32
- name: Create tar.gz archive 🗜️
run: |
cd build
tar zcvf ${EXPORT_NAME}-Linux-64bit.tar.gz ${EXPORT_NAME}-Linux-64bit
tar zcvf ${EXPORT_NAME}-Linux-32bit.tar.gz ${EXPORT_NAME}-Linux-32bit
tar zcvf ${EXPORT_NAME}-Linux-ARM64.tar.gz ${EXPORT_NAME}-Linux-ARM64
tar zcvf ${EXPORT_NAME}-Linux-ARM32.tar.gz ${EXPORT_NAME}-Linux-ARM32
- name: Upload Release Assets to itch.io 🎮
run: |
butler push ./build/${{env.EXPORT_NAME}}-Linux-64bit.tar.gz ${{ secrets.ITCHIO_USERNAME }}/${{ secrets.ITCHIO_GAME }}:linux-x86_64 --userversion ${{env.TAG}}
butler push ./build/${{env.EXPORT_NAME}}-Linux-32bit.tar.gz ${{ secrets.ITCHIO_USERNAME }}/${{ secrets.ITCHIO_GAME }}:linux-x86_32 --userversion ${{env.TAG}}
butler push ./build/${{env.EXPORT_NAME}}-Linux-ARM64.tar.gz ${{ secrets.ITCHIO_USERNAME }}/${{ secrets.ITCHIO_GAME }}:linux-arm64 --userversion ${{env.TAG}}
butler push ./build/${{env.EXPORT_NAME}}-Linux-ARM32.tar.gz ${{ secrets.ITCHIO_USERNAME }}/${{ secrets.ITCHIO_GAME }}:linux-arm32 --userversion ${{env.TAG}}
- name: Upload Release Asset 🚀
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ./build/${{env.EXPORT_NAME}}-Linux-*.tar.gz
tag: ${{env.TAG}}
overwrite: true
file_glob: true
export-mac:
name: Mac Export 🍎
runs-on: macos-latest
steps:
- name: Checkout 🛎️
uses: actions/checkout@v4
with:
submodules: true
- name: Setup environment 🔧
run: |
export GODOT_VERSION=${GODOT_VERSION}
export EXPORT_NAME=Pixelorama
- name: Download and extract export templates 💾
run: |
mkdir -v -p "/Users/runner/Library/Application Support/Godot/export_templates/${GODOT_VERSION}.stable"
wget https://github.com/godotengine/godot-builds/releases/download/${GODOT_VERSION}-stable/Godot_v${GODOT_VERSION}-stable_export_templates.tpz
unzip -a Godot_v${GODOT_VERSION}-stable_export_templates.tpz
mv ./templates/* "/Users/runner/Library/Application Support/Godot/export_templates/${GODOT_VERSION}.stable"
- name: Download Godot headless binary 🤖
run: |
wget https://github.com/godotengine/godot/releases/download/${GODOT_VERSION}-stable/Godot_v${GODOT_VERSION}-stable_macos.universal.zip
unzip -a Godot_v${GODOT_VERSION}-stable_macos.universal.zip
- name: Setup 💻
run: mkdir -v -p ./build/mac
- name: Import resources once 📦
continue-on-error: true
run: ./Godot.app/Contents/MacOS/Godot --headless -v --import
- name: Mac Build 🔧
run: |
chown runner ./Godot.app/Contents/MacOS/Godot
chmod +x ./Godot.app/Contents/MacOS/Godot
./Godot.app/Contents/MacOS/Godot --headless -v --export-release "macOS" ./build/mac/${EXPORT_NAME}.zip
- name: Make application executable 🔧
run: |
unzip -a ./build/mac/${EXPORT_NAME}.zip -d ./build/mac
chmod +x ./build/mac/${EXPORT_NAME}.app/Contents/MacOS/${EXPORT_NAME}
rm ./build/mac/${EXPORT_NAME}.zip
- name: Fix application icon 🖼
run: sips -s format icns ./build/mac/${EXPORT_NAME}.app/Contents/Resources/icon.icns --out ./build/mac/${EXPORT_NAME}.app/Contents/Resources/icon.icns
- name: Copy pixelorama_data folder 📁
run: |
cp -R ./pixelorama_data ./build/mac/${EXPORT_NAME}.app/Contents/Resources
rm ./build/mac/${EXPORT_NAME}.app/Contents/Resources/pixelorama_data/.gdignore
- name: Ad-hoc signing ✍️
run: codesign -s - --force --deep ./build/mac/${EXPORT_NAME}.app
- name: Create DMG archive 🔧
run: hdiutil create -srcfolder ./build/mac -fs HFS+ -volname ${EXPORT_NAME} ./build/mac/${EXPORT_NAME}-Mac.dmg
- name: Upload Release Assets to itch.io 🎮
run: |
curl -L -o butler.zip https://broth.itch.ovh/butler/darwin-amd64/LATEST/archive/default
unzip butler.zip
chmod +x butler
./butler push ./build/mac/${{env.EXPORT_NAME}}-Mac.dmg ${{ secrets.ITCHIO_USERNAME }}/${{ secrets.ITCHIO_GAME }}:mac --userversion ${{env.TAG}}
- name: Upload Release Asset 🚀
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ./build/mac/${{env.EXPORT_NAME}}-Mac.dmg
tag: ${{env.TAG}}
overwrite: true
export-web:
name: Web Export 🌐
runs-on: ubuntu-latest
container:
image: docker://barichello/godot-ci:4.3
steps:
- name: Checkout 🛎️
uses: actions/checkout@v4
with:
submodules: true
- name: Setup 💻
run: |
mkdir -v -p build/web ~/.local/share/godot/export_templates
mv /root/.local/share/godot/export_templates/${GODOT_VERSION}.stable ~/.local/share/godot/export_templates/${GODOT_VERSION}.stable
- name: Import resources once 📦
continue-on-error: true
run: godot --headless -v --import
- name: Web Build 🔧
run: godot --headless -v --export-release "Web" ./build/web/index.html
- name: Install rsync 📚
run: |
apt-get update && apt-get install -y rsync
- name: Upload Release Assets to itch.io 🎮
run: |
butler push ./build/web ${{ secrets.ITCHIO_USERNAME }}/${{ secrets.ITCHIO_GAME }}:web --userversion ${{env.TAG}}
- name: Deploy 🚀
uses: JamesIves/github-pages-deploy-action@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
single-commit: true
folder: build/web # The folder the action should deploy.