-
Notifications
You must be signed in to change notification settings - Fork 4
226 lines (203 loc) · 8.74 KB
/
godot-export.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
223
224
225
226
name: "godot export"
on:
push:
branches:
- "main"
- "4.0"
- "v*"
# on:
# push:
# tags:
# - 'v*'
jobs:
# job id, can be anything
export:
# Always use ubuntu-latest for this action
runs-on: ubuntu-latest
# Job name, can be anything
name: Export Job
steps:
# Always include the checkout step so that
# your project is available for Godot to export
- name: checkout
uses: actions/[email protected]
# Ensure that you get the entire project history
with:
fetch-depth: 0
# multiarch needs to be enabled first - add i386 arch
- name: Update apt
run: |
# sudo dpkg --add-architecture i386
sudo apt-get update
# breaks windows app, does not change icon
- name: install wine
id: wine_install
run: |
# sudo apt install -y wine64 wine32:i386 libwine:i386
sudo apt install -y wine64
echo ::set-output name=WINE_PATH::$(which wine64)
- name: Install additional software
run: |
sudo apt install -y rsync crudini
- name: Skip Android export
env:
ANDROID_KEYSTORE: ${{ secrets.ANDROID_KEYSTORE }}
if: ${{ env.ANDROID_KEYSTORE == '' }}
run: |
crudini --del godot/export_presets.cfg $(for id in {0..10}; do crudini --get --format=lines godot/export_presets.cfg preset.$id platform 2> /dev/null ; done | grep Android | grep -o 'preset\.[0-9]*').options
crudini --del godot/export_presets.cfg $(for id in {0..10}; do crudini --get --format=lines godot/export_presets.cfg preset.$id platform 2> /dev/null ; done | grep Android | grep -o 'preset\.[0-9]*')
- name: Set up JDK
uses: actions/setup-java@v2
env:
ANDROID_KEYSTORE: ${{ secrets.ANDROID_KEYSTORE }}
if: ${{ env.ANDROID_KEYSTORE != '' }}
with:
distribution: "temurin"
java-version: "17"
- name: Setup Android SDK
env:
ANDROID_KEYSTORE: ${{ secrets.ANDROID_KEYSTORE }}
if: ${{ env.ANDROID_KEYSTORE != '' }}
uses: android-actions/setup-android@v2
- name: Prepare keystore
env:
ANDROID_KEYSTORE: ${{ secrets.ANDROID_KEYSTORE }}
if: ${{ env.ANDROID_KEYSTORE != '' }}
run: |
echo "${{ secrets.ANDROID_KEYSTORE }}" >> android.keystore.asc
gpg -d --passphrase "${{ secrets.ANDROID_KEYSTORE_PASS }}" --batch android.keystore.asc > android.keystore
# ...above this line is the workflow job setup
- name: use custom editor settings and export credentials
run: |
mkdir -p ~/.config/godot
cp godot/editor_settings-3.tres ~/.config/godot/
mkdir -p godot/.godot/
cp godot/export_credentials.defaults godot/.godot/export_credentials.cfg
- name: export godot
# Use latest version (see releases for all versions)
uses: firebelley/[email protected]
with:
# Base version. Patch versions are incremented when this action runs.
# base_version: 0.0.1
# base_version: ${{ steps.tag_version.outputs.TAG_VERSION}}
# Defining all the required inputs
# I used the latest version of Godot in this example
godot_executable_download_url: https://downloads.tuxfamily.org/godotengine/4.2.2/Godot_v4.2.2-stable_linux.x86_64.zip
godot_export_templates_download_url: https://downloads.tuxfamily.org/godotengine/4.2.2/Godot_v4.2.2-stable_export_templates.tpz
# https://downloads.tuxfamily.org/godotengine/3.4.1/rc1/
relative_project_path: ./godot
cache: true
# archive_single_release_output: false
export_debug: false
archive_output: true
# generate_release_notes: true
# create_release: true
use_preset_export_path: true
# relative_export_path: "build"
wine_path: ${{ steps.wine_install.outputs.WINE_PATH }}
use_godot_3: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Workaround for SharedArrayBuffer support on GitHub Pages
# See: https://github.com/godotengine/godot-proposals/issues/6616
# See: https://github.com/godotengine/godot-docs/issues/7084
- run: |
cd /home/runner/.local/share/godot/builds/HTML5/
curl -fsSL https://github.com/gzuidhof/coi-serviceworker/raw/master/coi-serviceworker.js > coi-serviceworker.js
sed -i 's#\( <script src="index.js"></script>\)# <script src="coi-serviceworker.js"></script>\n\1#g' index.html
- name: create release
uses: ncipollo/[email protected]
with:
token: ${{ secrets.GITHUB_TOKEN }}
generateReleaseNotes: true
tag: ${{ github.ref_name }}
artifacts: ${{ steps.export.outputs.archive_directory }}/*
- name: Deploy to GitHub Pages 🚀
uses: JamesIves/github-pages-deploy-action@releases/v3
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BRANCH: gh-pages # The branch the action should deploy to.
FOLDER: /home/runner/.local/share/godot/builds/HTML5/ # The folder the action should deploy.
# - name: let me see those files
# run: |
# ls -lha /home/runner/.local/share/godot/builds
# ls -lha /home/runner/work/godot-boilerplate/godot-boilerplate/build
# pwd
# pwd: /home/runner/work/godot-boilerplate/godot-boilerplate
# Android
# HTML5
# LinuxX11
# Mac OSX
# Windows Desktop
- name: Create zips
run: |
mkdir -p ${{ github.workspace }}/build
cd /home/runner/.local/share/godot/builds/
cd "html5" ; zip -r ${{ github.workspace }}/build/html5.zip . ; cd ..
cd "linux" ; zip -r ${{ github.workspace }}/build/linux.zip . ; cd ..
cd "macosx" ; zip -r ${{ github.workspace }}/build/macosx.zip . ; cd ..
cd "windows" ; zip -r ${{ github.workspace }}/build/windows.zip . ; cd ..
- name: Create android zips
env:
ANDROID_KEYSTORE: ${{ secrets.ANDROID_KEYSTORE }}
if: ${{ env.ANDROID_KEYSTORE != '' }}
run: |
cd /home/runner/.local/share/godot/builds/
cd "Android" ; zip -r ${{ github.workspace }}/build/android.zip . ; cd ..
- id: get_version
name: Get git tag version
run: |
CURRENT_TAG=$(git describe --abbrev=0 --tags `git rev-list --tags --skip=0 --max-count=1`)
echo ${CURRENT_TAG}
echo ::set-output name=version::${CURRENT_TAG}
- name: Deploy itch.io - windows
env:
BUTLER_CREDENTIALS: ${{ secrets.ITCHIO_API_KEY }}
CHANNEL: windows
ITCH_GAME: ${{ secrets.ITCHIO_GAME }}
ITCH_USER: ${{ secrets.ITCHIO_USER }}
PACKAGE: build/windows.zip
VERSION: ${{ steps.get_version.outputs.version }}
if: ${{ env.ITCH_USER != '' }}
uses: josephbmanley/butler-publish-itchio-action@master
- name: Deploy itch.io - html5
env:
BUTLER_CREDENTIALS: ${{ secrets.ITCHIO_API_KEY }}
CHANNEL: HTML
ITCH_GAME: ${{ secrets.ITCHIO_GAME }}
ITCH_USER: ${{ secrets.ITCHIO_USER }}
PACKAGE: build/html5.zip
VERSION: ${{ steps.get_version.outputs.version }}
if: ${{ env.ITCH_USER != '' }}
uses: josephbmanley/butler-publish-itchio-action@master
- name: Deploy itch.io - linux
env:
BUTLER_CREDENTIALS: ${{ secrets.ITCHIO_API_KEY }}
CHANNEL: linux
ITCH_GAME: ${{ secrets.ITCHIO_GAME }}
ITCH_USER: ${{ secrets.ITCHIO_USER }}
PACKAGE: build/linux.zip
VERSION: ${{ steps.get_version.outputs.version }}
if: ${{ env.ITCH_USER != '' }}
uses: josephbmanley/butler-publish-itchio-action@master
- name: Deploy itch.io - macosx
env:
BUTLER_CREDENTIALS: ${{ secrets.ITCHIO_API_KEY }}
CHANNEL: mac
ITCH_GAME: ${{ secrets.ITCHIO_GAME }}
ITCH_USER: ${{ secrets.ITCHIO_USER }}
PACKAGE: build/macosx.zip
VERSION: ${{ steps.get_version.outputs.version }}
if: ${{ env.ITCH_USER != '' }}
uses: josephbmanley/butler-publish-itchio-action@master
- name: Deploy itch.io - android
env:
BUTLER_CREDENTIALS: ${{ secrets.ITCHIO_API_KEY }}
CHANNEL: android
ITCH_GAME: ${{ secrets.ITCHIO_GAME }}
ITCH_USER: ${{ secrets.ITCHIO_USER }}
PACKAGE: build/android.zip
VERSION: ${{ steps.get_version.outputs.version }}
ANDROID_KEYSTORE: ${{ secrets.ANDROID_KEYSTORE }}
if: ${{ env.ITCH_USER != '' && env.ANDROID_KEYSTORE != '' }}
uses: josephbmanley/butler-publish-itchio-action@master