generated from sakkaku-dev/godot-template
-
Notifications
You must be signed in to change notification settings - Fork 0
164 lines (146 loc) · 5.11 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
# Release workflow for games on steam
# - Itch used for uploading demo build (only web)
# - Github release for internal testing
name: Steam Releases
on:
workflow_dispatch:
inputs:
demo:
description: 'Release demo'
type: boolean
default: false
release-steam:
description: 'Release for steam'
type: boolean
default: false
release-github:
description: 'Release for github'
type: boolean
default: false
release-itch:
description: 'Release for itch.io'
type: boolean
default: false
env:
STEAM_APP: 430
STEAM_DEMO_APP: 430
jobs:
build-info:
runs-on: ubuntu-latest
outputs:
steam_id: ${{ steps.build-data.outputs.steam_id }}
channels: ${{ steps.build-data.outputs.channels }}
steps:
- id: build-data
run: |
STEAM_ID=${STEAM_APP:-430}
IS_DEMO=${DEMO:-false}
CHANNELS='"windows", "linux"'
if [ $RELEASE_STEAM = false ] && [ $RELEASE_GITHUB = false ]; then
CHANNELS=''
if [ $RELEASE_ITCH = true ]; then
CHANNELS='"web"'
fi
elif [ $RELEASE_ITCH = true ]; then
CHANNELS+=', "web"'
fi
if [ $IS_DEMO = true ] || [[ "$REF" =~ "-demo" ]]; then
STEAM_ID=$STEAM_DEMO_APP
fi
echo "::debug::Steam App ID: $STEAM_ID"
echo "steam_id=$STEAM_ID" >> $GITHUB_OUTPUT
echo "channels=[$CHANNELS]" >> $GITHUB_OUTPUT
env:
DEMO: ${{ inputs.demo }}
REF: ${{ github.ref_name }}
RELEASE_ITCH: ${{ inputs.release-itch }}
RELEASE_STEAM: ${{ inputs.release-steam }}
RELEASE_GITHUB: ${{ inputs.release-github }}
# build-godot:
# uses: kuma-gee/actions/.github/workflows/godot-build.yml@main
# needs: build-info
# if: ${{ needs.build-info.outputs.channels != '[]' }}
# with:
# channels: ${{ needs.build-info.outputs.channels }}
# steam-app: ${{ fromJSON(needs.build-info.outputs.steam_id) }}
# godot-version: 4.3
# project-path: godot
# secrets: inherit
build-game:
runs-on: ubuntu-latest
container: barichello/godot-ci:${{ inputs.godot-version }}
# strategy:
# matrix:
# channel: ${{ fromJson(inputs.channels) }}
outputs:
game: ${{ steps.build.outputs.game }}
steps:
- uses: actions/checkout@v4
- name: Unpack protected assets
if: env.ASSETS_PASSWORD
uses: kuma-gee/action-protect-assets@v1
with:
path: ${{ inputs.project-path }}/${{ inputs.assets-path }}
password: ${{ secrets.ASSETS_PASSWORD }}
env:
ASSETS_PASSWORD: ${{ secrets.ASSETS_PASSWORD }}
- name: Create Godot Environment File
uses: kuma-gee/action-godot/godot-env@main
with:
output: ${{ inputs.project-path }}/${{ inputs.env-build-file }}
code: ${{ secrets.GAME_CODE }}
version: ${{ github.ref_name }}
steam-app: ${{ inputs.steam-app }}
- name: Setup Templates
uses: kuma-gee/action-godot-template/setup@v1
with:
version: ${{ inputs.godot-version }}
channel: ${{ matrix.channel }}
encryption-key: ${{ secrets.ENCRYPTION_KEY }}
game-folder: ${{ inputs.project-path }}
repo: ${{ inputs.template-repo }}
- run: |
mkdir -p build/windows
godot --verbose --headless --path godot --export-release windows build/windows/main.exe
# - uses: kuma-gee/action-godot/godot-build@main
# with:
# channel: ${{ matrix.channel }}
# output: build
# game-folder: ${{ inputs.project-path }}
# password: ${{ needs.generate-password.outputs.password }}
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: release-${{ matrix.channel }}
path: build/*.zip
# release-itch:
# uses: kuma-gee/actions/.github/workflows/itch-release.yml@main
# needs: build-godot
# if: ${{ inputs.release-itch }}
# with:
# channels: '["web"]'
# game: ${{ needs.build-godot.outputs.game }}
# itch-user: kuma-gee
# secrets:
# BUTLER_API_KEY: ${{ secrets.BUTLER_API_KEY }}
# PASSWORD: ${{ needs.build-godot.outputs.password }}
# release-steam:
# uses: kuma-gee/actions/.github/workflows/steam-release.yml@main
# needs: [build-godot, build-info]
# if: ${{ inputs.release-steam }}
# with:
# steam-app: ${{ fromJSON(needs.build-info.outputs.steam_id) }}
# branch: beta
# secrets:
# STEAM_USERNAME: ${{ secrets.STEAM_USERNAME }}
# STEAM_CONFIG_VDF: ${{ secrets.STEAM_CONFIG_VDF }}
# PASSWORD: ${{ needs.build-godot.outputs.password }}
# release-github:
# uses: kuma-gee/actions/.github/workflows/github-release.yml@main
# needs: build-godot
# if: ${{ inputs.release-github }}
# with:
# demo: ${{ inputs.demo }}
# secrets:
# discord-webhook: ${{ secrets.DISCORD_RELEASE_HOOK }}
# password: ${{ needs.build-godot.outputs.password }}