Skip to content

Commit 9e4d254

Browse files
committed
Build with GH Actions
1 parent d53e3b7 commit 9e4d254

File tree

3 files changed

+119
-0
lines changed

3 files changed

+119
-0
lines changed

.github/FUNDING.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# These are supported funding model platforms
2+
3+
github: [castle-engine, michaliskambi] # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
4+
patreon: castleengine # Replace with a single Patreon username
5+
open_collective: castle-engine # Replace with a single Open Collective username
6+
# ko_fi: # Replace with a single Ko-fi username
7+
# tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
8+
# community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
9+
# liberapay: # Replace with a single Liberapay username
10+
# issuehunt: # Replace with a single IssueHunt username
11+
# otechie: # Replace with a single Otechie username
12+
# custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']

.github/dependabot.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Check that GitHub Actions use latest versions of plugins.
2+
# See https://docs.github.com/en/code-security/dependabot/working-with-dependabot/keeping-your-actions-up-to-date-with-dependabot .
3+
4+
version: 2
5+
updates:
6+
# Maintain dependencies for GitHub Actions
7+
- package-ecosystem: "github-actions"
8+
directory: "/"
9+
schedule:
10+
interval: "weekly"

.github/workflows/build.yml

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
# ----------------------------------------------------------------------------
2+
# GitHub Actions workflow to build this application.
3+
# Using latest Castle Game Engine ( https://castle-engine.io/ ) snapshot.
4+
# For multiple platforms (Linux, Windows, macOS, Android).
5+
#
6+
# This uses GitHub-hosted runners, that is: you don't need to set up any server
7+
# infrastructure, GitHub provides it all for free for open-source projects.
8+
#
9+
# See docs:
10+
# - https://castle-engine.io/github_actions
11+
# - https://docs.github.com/en/actions
12+
# ----------------------------------------------------------------------------
13+
14+
name: Build
15+
on: [push, pull_request]
16+
17+
jobs:
18+
# Build for platforms supported by
19+
# CGE Docker image https://hub.docker.com/r/kambi/castle-engine-cloud-builds-tools/ .
20+
#
21+
# Since setting up Docker image takes majority of time (5-6 mins)
22+
# compared to actually getting and compiling CGE (1 min)
23+
# and building application (~1 min for each platform),
24+
# we build all platforms possible within one job.
25+
build-using-docker:
26+
name: Build Using Docker
27+
runs-on: ubuntu-latest
28+
container: kambi/castle-engine-cloud-builds-tools:cge-none
29+
steps:
30+
- uses: actions/checkout@v4
31+
# Set env CASTLE_ENGINE_PATH following
32+
# https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#environment-files
33+
# https://brandur.org/fragments/github-actions-env-vars-in-env-vars
34+
- name: Castle Game Engine - Setup environment
35+
run: echo "CASTLE_ENGINE_PATH=$GITHUB_WORKSPACE/castle-engine" >> $GITHUB_ENV
36+
- name: Castle Game Engine - Clone snapshot
37+
run: git clone --depth 1 --single-branch --branch snapshot https://github.com/castle-engine/castle-engine/
38+
- name: Castle Game Engine - Build
39+
run: cd $CASTLE_ENGINE_PATH/tools/build-tool/ && ./castle-engine_compile.sh
40+
41+
- name: Package Windows
42+
run: $CASTLE_ENGINE_PATH/tools/build-tool/castle-engine package --os=win64 --cpu=x86_64 --verbose
43+
- name: Archive Artifacts
44+
# See https://github.com/actions/upload-artifact
45+
uses: actions/upload-artifact@v4
46+
with:
47+
name: windows-build
48+
# Note: Keep paths that start with asterisk in double qoutes, to avoid misinterpreting as YAML reference.
49+
# See https://stackoverflow.com/questions/19109912/yaml-do-i-need-quotes-for-strings-in-yaml
50+
# https://yamlchecker.com/
51+
path: "*-win64-x86_64.zip"
52+
if-no-files-found: error
53+
54+
- name: Package Linux
55+
run: $CASTLE_ENGINE_PATH/tools/build-tool/castle-engine package --os=linux --cpu=x86_64 --verbose
56+
- name: Archive Artifacts
57+
uses: actions/upload-artifact@v4
58+
with:
59+
name: linux-build
60+
path: "*-linux-x86_64.tar.gz"
61+
if-no-files-found: error
62+
63+
- name: Package Android
64+
run: $CASTLE_ENGINE_PATH/tools/build-tool/castle-engine package --target=android --verbose
65+
- name: Archive Artifacts
66+
uses: actions/upload-artifact@v4
67+
with:
68+
name: android-build
69+
path: "*.apk"
70+
if-no-files-found: error
71+
72+
# Build for platforms supported from macOS.
73+
# This means to build for macOS and (maybe in the future) iOS.
74+
build-macos:
75+
name: Build Using macOS
76+
runs-on: macos-latest
77+
steps:
78+
- uses: actions/checkout@v4
79+
- name: Install FPC+Lazarus
80+
uses: gcarreno/[email protected]
81+
with:
82+
lazarus-version: stable
83+
- name: Castle Game Engine - Setup environment
84+
run: echo "CASTLE_ENGINE_PATH=$GITHUB_WORKSPACE/castle-engine" >> $GITHUB_ENV
85+
- name: Castle Game Engine - Clone snapshot
86+
run: git clone --depth 1 --single-branch --branch snapshot https://github.com/castle-engine/castle-engine/
87+
- name: Castle Game Engine - Build
88+
run: cd $CASTLE_ENGINE_PATH/tools/build-tool/ && ./castle-engine_compile.sh
89+
90+
- name: Package macOS
91+
run: $CASTLE_ENGINE_PATH/tools/build-tool/castle-engine package --os=darwin --cpu=x86_64 --verbose
92+
- name: Archive Artifacts
93+
uses: actions/upload-artifact@v4
94+
with:
95+
name: macos-build
96+
path: "*-darwin-x86_64.zip"
97+
if-no-files-found: error

0 commit comments

Comments
 (0)