-
-
Notifications
You must be signed in to change notification settings - Fork 38
executable file
·234 lines (202 loc) · 8.15 KB
/
Publish-Godot-Project.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
227
228
229
230
231
232
233
234
name: Publish AMSG
on:
workflow_dispatch:
inputs:
export_version:
description: "Export Version"
required: true
default: "0.x"
release_github_page:
description: "Upload To Github Pages"
required: false
default: "false"
itch_io:
description: "Itch.io Build"
required: false
default: "false"
push:
branches:
- master
pull_request:
branches:
- master
env:
BUTLER_API_KEY: ${{ secrets.BUTLER_API_KEY }} # Needs to be added through github
DISCORD_WEBHOOK: ${{secrets.DISCORD_WEBHOOK}} # Needs to be added through github
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
IS_MAIN: ${{ contains(github.ref, 'master') }}
PROJECT_NAME: "AMSG" # Needs to be added, PLEASE DON'T USE SPACES
ITCH_PROJECT_NAME: "amsg" # Needs to be added
ITCH_USER_NAME: "ywmaa" # Needs to be added
GODOT_VERSION: 4.3 # Needs to be added
jobs:
#CleanArtifacts:
# This job clears out the previous artifacts made so you don't run out of space in your github account
#runs-on: ubuntu-latest
#steps:
#- uses: kolpav/purge-artifacts-action@v1
# with:
# token: ${{ secrets.GITHUB_TOKEN }}
# expire-in: 1hr
Export:
needs: CleanArtifacts # wait for artifacts to clean before making a new one
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Download + Authorize Godot
run: |
curl -L -o godot.zip https://downloads.tuxfamily.org/godotengine/${{ env.GODOT_VERSION }}/Godot_v${{ env.GODOT_VERSION }}-stable_linux.x86_64.zip
unzip godot.zip
mv Godot_v${{ env.GODOT_VERSION }}-stable_linux.x86_64 godot
ls
chmod +x godot
mkdir ~/.config/godot/
cat <<EOT >> ~/.config/godot/editor_settings-4.tres
[gd_resource type="EditorSettings" format=3]
[resource]
export/android/android_sdk_path = "/usr/local/lib/android/sdk"
EOT
- name: Download Export Templates
run: |
curl -L -o export_templates.zip https://downloads.tuxfamily.org/godotengine/${{ env.GODOT_VERSION }}/Godot_v${{ env.GODOT_VERSION }}-stable_export_templates.tpz
unzip export_templates.zip
- name: Install Export Templates
run: |
mkdir -p ~/.local/share/godot/export_templates/${{ env.GODOT_VERSION }}.stable
mv ./templates/* ~/.local/share/godot/export_templates/${{ env.GODOT_VERSION }}.stable
- name: Import Project
run: |
./godot --headless -e --quit --path ./
- name: Export Windows Desktop
run: |
mkdir -p ./exports
./godot --headless --path ./ --export-release "windows" ./exports/${{ env.PROJECT_NAME }}.x86_64.exe
- name: Export macOS
run: |
mkdir -p ./exports
./godot --headless --path ./ --export-release "mac" ./exports/${{ env.PROJECT_NAME }}.app.zip
- name: Export Linux/X11
run: |
mkdir -p ./exports
./godot --headless --path ./ --export-release "Linux/X11" ./exports/${{ env.PROJECT_NAME }}.x86_64
- uses: actions/upload-artifact@v4
with:
name: exports
path: exports
overwrite: true
Release:
needs: Export
if: github.event_name == 'workflow_dispatch' && github.event.inputs.release_github_page
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Version
id: tag_version
uses: mathieudutour/github-tag-action@v5.6
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Verify Tag
if: ${{ !github.event.inputs.export_version }}
run: exit 1
- name: Download Exports
uses: actions/download-artifact@v4
with:
name: exports
path: exports
- name: Move Out Of Export Folder
run: |
mv exports/${{ env.PROJECT_NAME }}.x86_64.exe ${{ env.PROJECT_NAME }}.x86_64.exe
mv exports/${{ env.PROJECT_NAME }}.x86_64 ${{ env.PROJECT_NAME }}.x86_64
mv exports/${{ env.PROJECT_NAME }}.app.zip ${{ env.PROJECT_NAME }}.app.zip
- name: Zip
run: |
chmod +x ${{ env.PROJECT_NAME }}.x86_64
zip -r ${{ env.PROJECT_NAME }}-windows-release-v${{ github.event.inputs.export_version }}.zip ${{ env.PROJECT_NAME }}.x86_64.exe
zip -r ${{ env.PROJECT_NAME }}-linux-release-v${{ github.event.inputs.export_version }}.zip ${{ env.PROJECT_NAME }}.x86_64
zip -r ${{ env.PROJECT_NAME }}-macos-release-v${{ github.event.inputs.export_version }}.zip ${{ env.PROJECT_NAME }}.app.zip
- name: Create Github Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v${{ github.event.inputs.export_version }}
release_name: Release v${{ github.event.inputs.export_version }}
body: ${{ steps.tag_version.outputs.changelog }}
- name: Upload Linux Artifact
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./${{ env.PROJECT_NAME }}-linux-release-v${{ github.event.inputs.export_version }}.zip
asset_name: ${{ env.PROJECT_NAME }}-linux-release-v${{ github.event.inputs.export_version }}.zip
asset_content_type: application/zip
- name: Upload Windows Artifact
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./${{ env.PROJECT_NAME }}-windows-release-v${{ github.event.inputs.export_version }}.zip
asset_name: ${{ env.PROJECT_NAME }}-windows-release-v${{ github.event.inputs.export_version }}.zip
asset_content_type: application/zip
- name: Upload MacOS Artifact
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./${{ env.PROJECT_NAME }}-macos-release-v${{ github.event.inputs.export_version }}.zip
asset_name: ${{ env.PROJECT_NAME }}-macos-release-v${{ github.event.inputs.export_version }}.zip
asset_content_type: application/zip
- uses: frdrwrt/write-to-file@v1.3
with:
filepath: ./VERSION.txt
content: v${{ github.event.inputs.export_version }}
mode: 0655
- uses: actions/upload-artifact@v4
with:
name: VERSION
path: ./VERSION.txt
Publish:
needs: Release
if: github.event_name == 'workflow_dispatch' && github.event.inputs.itch_io
runs-on: ubuntu-latest
steps:
- name: Download Exports
uses: actions/download-artifact@v4
with:
name: exports
path: exports
- name: Move Out Of Export Folder
run: |
mv exports/${{ env.PROJECT_NAME }}.x86_64.exe ${{ env.PROJECT_NAME }}.x86_64.exe
mv exports/${{ env.PROJECT_NAME }}.x86_64 ${{ env.PROJECT_NAME }}.x86_64
mv exports/${{ env.PROJECT_NAME }}.app.zip ${{ env.PROJECT_NAME }}.app.zip
- name: Zip
run: |
chmod +x ${{ env.PROJECT_NAME }}.x86_64
zip -r windows-release-v${{ github.event.inputs.export_version }}.zip ${{ env.PROJECT_NAME }}.x86_64.exe
zip -r linux-release-v${{ github.event.inputs.export_version }}.zip ${{ env.PROJECT_NAME }}.x86_64
zip -r mac-release-v${{ github.event.inputs.export_version }}.zip ${{ env.PROJECT_NAME }}.app.zip
- name: Download + Authorize Butler
run: |
curl -L -o butler.zip https://broth.itch.ovh/butler/linux-amd64/LATEST/archive/default
unzip butler.zip
chmod +x butler
./butler -V
- name: Login To Butler
run: ./butler login
- name: Butler Push
run: |
./butler push windows-release-v${{ github.event.inputs.export_version }}.zip ${{env.ITCH_USER_NAME}}/${{env.ITCH_PROJECT_NAME}}:windows-release
./butler push linux-release-v${{ github.event.inputs.export_version }}.zip ${{env.ITCH_USER_NAME}}/${{env.ITCH_PROJECT_NAME}}:linux-release
./butler push mac-release-v${{ github.event.inputs.export_version }}.zip ${{env.ITCH_USER_NAME}}/${{env.ITCH_PROJECT_NAME}}:mac-release
# Cleanup:
# needs: [Export, Release, Publish]
# runs-on: ubuntu-latest
# steps:
# - uses: geekyeggo/delete-artifact@v1
# with:
# name: VERSION