-
Notifications
You must be signed in to change notification settings - Fork 10
190 lines (187 loc) · 9.96 KB
/
main.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
name: Prepare New Release
on:
push:
branches:
- main
jobs:
GUT:
runs-on: ubuntu-latest
name: Unit & Integration Tests
steps:
- name: "✔️ Checkout"
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Check out personal godot-tester repository
uses: actions/checkout@v3
with:
repository: db0/godot-tester
path: ./.github/actions/godot-tester
# Runs a single command using the runners shell
- name: ⚙ Run Tests
uses: ./.github/actions/godot-tester
with:
version: 3.5
# should be long enough for asset import files to get generated
import-time: 300
assert-check: true
# Allowing some fails on push, as sometimes randomly some asserts might false negative and I haven't yet located the precice reason for this inconsistency
max-fails: 5
# How long the test should be run before it's timed out and fails
test-timeout: 3600
# Directory containing Gut tests
direct-scene: tests/cli/tests.tscn
version_and_release:
runs-on: ubuntu-latest
name: Export Game
needs: ["GUT"]
steps:
- name: "✔️ Checkout"
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: "📣 Release on push"
id: release
uses: rymndhng/release-on-push-action@master
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
bump_version_scheme: norelease
use_github_release_notes: true
# Always include the checkout step so that
# your project is available for Godot to export
- name: "✏️ Generate release changelog"
if: ${{ steps.release.outputs.version != '' }}
uses: heinrichreimer/[email protected]
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: "💾 Commit new version"
if: ${{ steps.release.outputs.version != '' }}
run: |
sed -i 's/GAME_VERSION := ".*"/GAME_VERSION := "${{ steps.release.outputs.version }}"/g' ./src/dreamscape/CFConst.gd
sed -i 's/Therapy through Nightmares \[.*\]/Therapy through Nightmares [${{ steps.release.outputs.version }}]/g' README.md
git config user.email [email protected]
git config user.name github-actions
git commit -am 'version incremented'
git push
- name: "🛠 Randomize which html music will be exported"
if: ${{ steps.release.outputs.version != '' }}
shell: bash
run: |
SCENE=ordeal; KEEP=6; cd assets/music/${SCENE} && ls *.ogg | tail -n+${KEEP} | shuf > oggs && cat oggs | xargs -I {} mv "{}" "html_ignore_{}" && cat oggs | xargs -I {} sed -i 's/{}/html_ignore_{}/g' "{}.import" && cat oggs | xargs -I {} sed -i "s|[a-z0-9]\+\.oggstr|$(sh -c 'echo -n html_ignore_{} | md5sum | awk "{print \$1}"').oggstr|g" "{}.import" && cat oggs | xargs -I {} mv "{}.import" "html_ignore_{}.import" && rm oggs && ls -larth
SCENE=journal; KEEP=4; cd ../../../assets/music/${SCENE} && ls *.ogg | tail -n+${KEEP} | shuf > oggs && cat oggs | xargs -I {} mv "{}" "html_ignore_{}" && cat oggs | xargs -I {} sed -i 's/{}/html_ignore_{}/g' "{}.import" && cat oggs | xargs -I {} sed -i "s|[a-z0-9]\+\.oggstr|$(sh -c 'echo -n html_ignore_{} | md5sum | awk "{print \$1}"').oggstr|g" "{}.import" && cat oggs | xargs -I {} mv "{}.import" "html_ignore_{}.import" && rm oggs && ls -larth
SCENE=main; KEEP=2; cd ../../../assets/music/${SCENE} && ls *.ogg | tail -n+${KEEP} | shuf > oggs && cat oggs | xargs -I {} mv "{}" "html_ignore_{}" && cat oggs | xargs -I {} sed -i 's/{}/html_ignore_{}/g' "{}.import" && cat oggs | xargs -I {} sed -i "s|[a-z0-9]\+\.oggstr|$(sh -c 'echo -n html_ignore_{} | md5sum | awk "{print \$1}"').oggstr|g" "{}.import" && cat oggs | xargs -I {} mv "{}.import" "html_ignore_{}.import" && rm oggs && ls -larth
SCENE=shop; KEEP=2; cd ../../../assets/music/${SCENE} && ls *.ogg | tail -n+${KEEP} | shuf > oggs && cat oggs | xargs -I {} mv "{}" "html_ignore_{}" && cat oggs | xargs -I {} sed -i 's/{}/html_ignore_{}/g' "{}.import" && cat oggs | xargs -I {} sed -i "s|[a-z0-9]\+\.oggstr|$(sh -c 'echo -n html_ignore_{} | md5sum | awk "{print \$1}"').oggstr|g" "{}.import" && cat oggs | xargs -I {} mv "{}.import" "html_ignore_{}.import" && rm oggs && ls -larth
SCENE=boss; KEEP=4; cd ../../../assets/music/${SCENE} && ls *.ogg | tail -n+${KEEP} | shuf > oggs && cat oggs | xargs -I {} mv "{}" "html_ignore_{}" && cat oggs | xargs -I {} sed -i 's/{}/html_ignore_{}/g' "{}.import" && cat oggs | xargs -I {} sed -i "s|[a-z0-9]\+\.oggstr|$(sh -c 'echo -n html_ignore_{} | md5sum | awk "{print \$1}"').oggstr|g" "{}.import" && cat oggs | xargs -I {} mv "{}.import" "html_ignore_{}.import" && rm oggs && ls -larth
- name: "🤖 Export game"
if: ${{ steps.release.outputs.version != '' }}
uses: firebelley/[email protected]
with:
godot_executable_download_url: https://downloads.tuxfamily.org/godotengine/3.5/Godot_v3.5-stable_linux_headless.64.zip
godot_export_templates_download_url: https://downloads.tuxfamily.org/godotengine/3.5/Godot_v3.5-stable_export_templates.tpz
relative_project_path: ./
base_version: "${{ steps.release.outputs.version }}"
create_release: false
archive_export_output: true
export_debug: true
- name: "🛠 Prepare files for publishing"
if: ${{ steps.release.outputs.version != '' }}
shell: bash
run: |
cp -v /home/runner/.local/share/godot/dist/* .
mkdir -p build/StandaloneWindows64
mkdir -p build/StandaloneLinux64
mkdir -p build/StandaloneMacOS
cp '/home/runner/.local/share/godot/builds/LinuxX11/Hypnagonia_Linux.x86_64' .
cp '/home/runner/.local/share/godot/builds/LinuxX11/Hypnagonia_Linux.x86_64' build/StandaloneLinux64/
cp '/home/runner/.local/share/godot/builds/LinuxX11 Lite/Hypnagonia_Linux_Lite.x86_64' .
cp '/home/runner/.local/share/godot/builds/Windows Desktop/Hypnagonia_Windows.exe' .
cp '/home/runner/.local/share/godot/builds/Windows Desktop/Hypnagonia_Windows.exe' build/StandaloneWindows64/
cp '/home/runner/.local/share/godot/builds/Windows Desktop Lite/Hypnagonia_Windows_Lite.exe' .
cp '/home/runner/.local/share/godot/builds/Mac OSX/Hypnagonia_MacOSX.zip' .
cp '/home/runner/.local/share/godot/builds/Mac OSX/Hypnagonia_MacOSX.zip' build/StandaloneMacOS/
ls -larth
- name: "🚀 Upload HTML5 version to itch.io"
if: ${{ steps.release.outputs.version != '' }}
uses: josephbmanley/butler-publish-itchio-action@master
env:
BUTLER_CREDENTIALS: "${{ secrets.BUTLER_CREDENTIALS }}"
CHANNEL: HTML5
ITCH_GAME: hypnagonia
ITCH_USER: dbzer0
PACKAGE: HTML5.zip
VERSION: "${{ steps.release.outputs.version }}"
- name: "☢ Upload Windows Lite version to itch.io"
if: ${{ steps.release.outputs.version != '' }}
uses: josephbmanley/butler-publish-itchio-action@master
env:
BUTLER_CREDENTIALS: "${{ secrets.BUTLER_CREDENTIALS }}"
CHANNEL: windows_lite
ITCH_GAME: hypnagonia
ITCH_USER: dbzer0
PACKAGE: Hypnagonia_Windows_Lite.exe
VERSION: "${{ steps.release.outputs.version }}"
- name: "☢ Upload Windows version to itch.io"
if: ${{ steps.release.outputs.version != '' }}
uses: josephbmanley/butler-publish-itchio-action@master
env:
BUTLER_CREDENTIALS: "${{ secrets.BUTLER_CREDENTIALS }}"
CHANNEL: windows
ITCH_GAME: hypnagonia
ITCH_USER: dbzer0
PACKAGE: Hypnagonia_Windows.exe
VERSION: "${{ steps.release.outputs.version }}"
- name: "🐧 Upload Linux Lite version to itch.io"
if: ${{ steps.release.outputs.version != '' }}
uses: josephbmanley/butler-publish-itchio-action@master
env:
BUTLER_CREDENTIALS: ${{ secrets.BUTLER_CREDENTIALS }}
CHANNEL: linux_lite
ITCH_GAME: hypnagonia
ITCH_USER: dbzer0
PACKAGE: Hypnagonia_Linux_Lite.x86_64
VERSION: "${{ steps.release.outputs.version }}"
- name: "🐧 Upload Linux version to itch.io"
if: ${{ steps.release.outputs.version != '' }}
uses: josephbmanley/butler-publish-itchio-action@master
env:
BUTLER_CREDENTIALS: ${{ secrets.BUTLER_CREDENTIALS }}
CHANNEL: linux
ITCH_GAME: hypnagonia
ITCH_USER: dbzer0
PACKAGE: Hypnagonia_Linux.x86_64
VERSION: "${{ steps.release.outputs.version }}"
- name: "☣ Upload OSX version to itch.io"
if: ${{ steps.release.outputs.version != '' }}
uses: josephbmanley/butler-publish-itchio-action@master
env:
BUTLER_CREDENTIALS: ${{ secrets.BUTLER_CREDENTIALS }}
CHANNEL: osx
ITCH_GAME: hypnagonia
ITCH_USER: dbzer0
PACKAGE: Hypnagonia_MacOSX.zip
VERSION: "${{ steps.release.outputs.version }}"
- name: "🔧 Publish all versions with Steamworks"
if: ${{ steps.release.outputs.version != '' }}
uses: game-ci/steam-deploy@v1
with:
username: ${{ secrets.STEAM_USERNAME }}
password: ${{ secrets.STEAM_PASSWORD }}
configVdf: ${{ secrets.STEAM_CONFIG_VDF}}
ssfnFileName: ${{ secrets.STEAM_SSFN_FILE_NAME }}
ssfnFileContents: ${{ secrets.STEAM_SSFN_FILE_CONTENTS }}
appId: 1962610
buildDescription: "${{ steps.release.outputs.version }}"
rootPath: build
depot1Path: StandaloneWindows64
depot2Path: StandaloneLinux64
depot3Path: StandaloneMacOS
releaseBranch: prerelease
- name: 📨 Notify Matrix General Chat
uses: s3krit/[email protected]
with:
room_id: ${{ secrets.MATRIX_ROOM_ID }}
access_token: ${{ secrets.MATRIX_TOKEN }}
message: "New Release Available: [${{ steps.release.outputs.version }}](https://github.com/db0/hypnagonia/blob/main/CHANGELOG.md)"
server: "matrix.org"
if: ${{ steps.release.outputs.version != '' }}