-
Notifications
You must be signed in to change notification settings - Fork 185
88 lines (80 loc) · 2.93 KB
/
build-and-publish.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
# this file handles all the messy business of auto-building the game when changes are pushed and publishing the latest build to itch.io, where it can be enjoyed publicly.
# please do not modify this file unless you have very good reason to do so, as it will likely break the game for everyone else.
name: build and publish
on:
push:
branches:
- main
paths-ignore: # do not build for game-irrelvant changes
- '.**'
- 'LICENSE'
- 'ACKNOWLEDGEMENTS'
- '**.md'
jobs:
format_code:
runs-on: ubuntu-latest
# To prevent infinite loops
if: "!contains(github.event.head_commit.message, 'Auto-Format GDScript')"
steps:
- uses: actions/checkout@v3
with:
token: ${{ secrets.BOT_PAT }}
- uses: actions/setup-python@v3
with:
python-version: 3.x
- run: pip3 install 'gdtoolkit==3.*'
- run: gdformat **/*.gd
- uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: Auto-Format GDScript
file_pattern: "**/*.gd"
build_game:
name: Build Game
if: ${{ github.event.label.name != 'skip release' && !contains(github.event.head_commit.message, 'Auto-Format GDScript') }}
runs-on: ubuntu-latest
steps:
- name: checkout latest code
uses: actions/checkout@v2.3.1
with:
fetch-depth: 0
- name: update credits
uses: actions/github-script@v3
with:
script: |
const path = require('path');
const script = require(path.resolve('.github/workflows/update-credits.js'));
await script(github, context)
- name: Add credits.txt to build artifacts list
uses: actions/upload-artifact@v3
with:
name: credits
path: credits.txt
- name: export with Godot Engine and release on GitHub
uses: firebelley/godot-export@v3.0.0
with:
godot_executable_download_url: https://downloads.tuxfamily.org/godotengine/3.4.4/Godot_v3.4.4-stable_linux_headless.64.zip
godot_export_templates_download_url: https://downloads.tuxfamily.org/godotengine/3.4.4/Godot_v3.4.4-stable_export_templates.tpz
relative_project_path: .
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
upload_game:
runs-on: ubuntu-latest
name: Publish Game
needs: [build_game]
steps:
- name: download latest HTML5 build
id: download-html
uses: dsaltares/fetch-gh-release-asset@master
with:
version: "latest"
file: HTML5.zip
token: "${{ secrets.GITHUB_TOKEN }}"
- name: deploy to itch.io
uses: josephbmanley/butler-publish-itchio-action@master
env:
BUTLER_CREDENTIALS: ${{ secrets.ITCH_API_KEY }}
CHANNEL: html
ITCH_GAME: a-little-game-called-mario
ITCH_USER: iznaut
PACKAGE: HTML5.zip
VERSION: ${{ steps.download-html.outputs.version }}