Skip to content

Commit 4e6d080

Browse files
committed
Implement CI and CLI builds
For local development earthly can be used to build one or more platforms. Github Actions builds all platform and uploads a snapshot of each. Gitignore currently ignores export_presets.cfg. Automation however requires some settings. I think it might be beneficial to provide multiple profiles of those presets. As such this version embraces the gitignore.
1 parent 873d57f commit 4e6d080

File tree

4 files changed

+185
-0
lines changed

4 files changed

+185
-0
lines changed

.github/workflows/snapshot.yml

+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Builds a Snapshot
2+
3+
on:
4+
# Triggers the workflow on push or pull request
5+
push:
6+
pull_request:
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- uses: actions/checkout@v2
14+
15+
- name: Download latest earthly
16+
run: "sudo /bin/sh -c 'wget https://github.com/earthly/earthly/releases/latest/download/earthly-linux-amd64 -O /usr/local/bin/earthly && chmod +x /usr/local/bin/earthly'"
17+
18+
- name: Earthly version
19+
run: earthly --version
20+
21+
- name: Run build
22+
run: |
23+
cd game
24+
mv export_presets.snapshot.cfg export_presets.cfg
25+
cd ..
26+
earthly +build
27+
28+
# Publish Artifacts for download
29+
- name: Publish Windows
30+
uses: actions/upload-artifact@v3
31+
with:
32+
name: windows
33+
path: builds/windows
34+
35+
- name: Publish Linux
36+
uses: actions/upload-artifact@v3
37+
with:
38+
name: linux
39+
path: builds/linux
40+
41+
- name: Publish HTMl5
42+
uses: actions/upload-artifact@v3
43+
with:
44+
name: html5
45+
path: builds/html5

Earthfile

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
build-base:
2+
FROM barichello/godot-ci:3.4.4
3+
4+
WORKDIR game
5+
COPY ./game .
6+
RUN mkdir -p /builds
7+
8+
build-linux:
9+
FROM +build-base
10+
RUN godot -v --export "Linux" /builds/suffragium
11+
12+
SAVE ARTIFACT /builds/*
13+
14+
build-html5:
15+
FROM +build-base
16+
RUN godot -v --export "HTML5" /builds/suffragium.html
17+
18+
SAVE ARTIFACT /builds/*
19+
20+
build-windows:
21+
FROM +build-base
22+
RUN godot -v --export "Windows" /builds/suffragium.exe
23+
24+
SAVE ARTIFACT /builds/*
25+
26+
build:
27+
FROM busybox
28+
29+
WORKDIR builds
30+
COPY builds/.gitignore .
31+
COPY +build-windows/ windows
32+
COPY +build-linux/ linux
33+
COPY +build-html5/ html5
34+
35+
SAVE ARTIFACT . AS LOCAL ./builds

builds/.gitignore

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# This directory contains build artifacts, that are not version controlled.
2+
# For documentation purposes this directory is empty
3+
*
4+
!.gitignore

game/export_presets.snapshot.cfg

+101
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
[preset.0]
2+
3+
name="Windows"
4+
platform="Windows Desktop"
5+
runnable=false
6+
custom_features=""
7+
export_filter="all_resources"
8+
include_filter=""
9+
exclude_filter=""
10+
export_path=""
11+
script_export_mode=1
12+
script_encryption_key=""
13+
14+
[preset.0.options]
15+
16+
custom_template/debug=""
17+
custom_template/release=""
18+
binary_format/64_bits=true
19+
binary_format/embed_pck=false
20+
texture_format/bptc=false
21+
texture_format/s3tc=true
22+
texture_format/etc=false
23+
texture_format/etc2=false
24+
texture_format/no_bptc_fallbacks=true
25+
codesign/enable=false
26+
codesign/identity_type=0
27+
codesign/identity=""
28+
codesign/password=""
29+
codesign/timestamp=true
30+
codesign/timestamp_server_url=""
31+
codesign/digest_algorithm=1
32+
codesign/description=""
33+
codesign/custom_options=PoolStringArray( )
34+
application/icon=""
35+
application/file_version="0.0.1"
36+
application/product_version="0.0.1"
37+
application/company_name="Suffragium Community"
38+
application/product_name="Suffragium"
39+
application/file_description=""
40+
application/copyright="Suffragium Contributors"
41+
application/trademarks=""
42+
43+
[preset.1]
44+
45+
name="Linux"
46+
platform="Linux/X11"
47+
runnable=false
48+
custom_features=""
49+
export_filter="all_resources"
50+
include_filter=""
51+
exclude_filter=""
52+
export_path=""
53+
script_export_mode=1
54+
script_encryption_key=""
55+
56+
[preset.1.options]
57+
58+
custom_template/debug=""
59+
custom_template/release=""
60+
binary_format/64_bits=true
61+
binary_format/embed_pck=false
62+
texture_format/bptc=false
63+
texture_format/s3tc=true
64+
texture_format/etc=false
65+
texture_format/etc2=false
66+
texture_format/no_bptc_fallbacks=true
67+
68+
[preset.2]
69+
70+
name="HTML5"
71+
platform="HTML5"
72+
runnable=false
73+
custom_features=""
74+
export_filter="all_resources"
75+
include_filter=""
76+
exclude_filter=""
77+
export_path=""
78+
script_export_mode=1
79+
script_encryption_key=""
80+
81+
[preset.2.options]
82+
83+
custom_template/debug=""
84+
custom_template/release=""
85+
variant/export_type=0
86+
vram_texture_compression/for_desktop=true
87+
vram_texture_compression/for_mobile=false
88+
html/export_icon=true
89+
html/custom_html_shell=""
90+
html/head_include=""
91+
html/canvas_resize_policy=2
92+
html/focus_canvas_on_start=true
93+
html/experimental_virtual_keyboard=false
94+
progressive_web_app/enabled=false
95+
progressive_web_app/offline_page=""
96+
progressive_web_app/display=1
97+
progressive_web_app/orientation=0
98+
progressive_web_app/icon_144x144=""
99+
progressive_web_app/icon_180x180=""
100+
progressive_web_app/icon_512x512=""
101+
progressive_web_app/background_color=Color( 0, 0, 0, 1 )

0 commit comments

Comments
 (0)