Skip to content

Commit afd83ec

Browse files
committed
Build with GH Actions
1 parent 4d2291f commit afd83ec

File tree

4 files changed

+159
-2
lines changed

4 files changed

+159
-2
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: 132 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,132 @@
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).
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+
16+
on:
17+
pull_request:
18+
# Run on push to any branch, not on tags.
19+
# Checking tags is not useful for us (we check the commit when it happened
20+
# at branch) and we would waste 2x time to update on every "snapshpt" tag change.
21+
push:
22+
branches:
23+
- '**'
24+
25+
jobs:
26+
# Build for platforms supported by
27+
# CGE Docker image https://hub.docker.com/r/kambi/castle-engine-cloud-builds-tools/ .
28+
build-using-docker:
29+
name: Build Using Docker
30+
runs-on: ubuntu-latest
31+
container: kambi/castle-engine-cloud-builds-tools:cge-unstable
32+
steps:
33+
- uses: actions/checkout@v4
34+
35+
- name: Package Windows
36+
run: castle-engine package --os=win64 --cpu=x86_64 --verbose
37+
- name: Archive Artifacts
38+
uses: actions/upload-artifact@v4
39+
with:
40+
name: windows-build
41+
path: "*-win64-x86_64.zip"
42+
if-no-files-found: error
43+
44+
- name: Package Linux
45+
run: castle-engine package --os=linux --cpu=x86_64 --verbose
46+
- name: Archive Artifacts
47+
uses: actions/upload-artifact@v4
48+
with:
49+
name: linux-build
50+
path: "*-linux-x86_64.tar.gz"
51+
if-no-files-found: error
52+
53+
- name: Unpack Android Secrets
54+
env:
55+
ANDROID_KEYSTORE: ${{ secrets.ANDROID_KEYSTORE }}
56+
ANDROID_SIGNING_PROPERTIES: ${{ secrets.ANDROID_SIGNING_PROPERTIES }}
57+
run: |
58+
echo "$ANDROID_KEYSTORE" | base64 --decode > cge.keystore
59+
echo "$ANDROID_SIGNING_PROPERTIES" | sed -e "s|WORKSPACE|${GITHUB_WORKSPACE}|" - > AndroidSigningProperties.txt
60+
- name: Package Android
61+
run: castle-engine package --target=android --verbose
62+
- name: Archive Artifacts
63+
uses: actions/upload-artifact@v4
64+
with:
65+
name: android-build
66+
path: "*.apk"
67+
if-no-files-found: error
68+
69+
# Build for platforms supported from macOS.
70+
build-macos:
71+
name: Build Using macOS
72+
runs-on: macos-latest
73+
steps:
74+
- uses: actions/checkout@v4
75+
- name: Install FPC+Lazarus
76+
uses: gcarreno/setup-lazarus@v3.2.17
77+
with:
78+
lazarus-version: stable
79+
- name: Castle Game Engine - Env CASTLE_ENGINE_PATH
80+
run: echo "CASTLE_ENGINE_PATH=$GITHUB_WORKSPACE/castle-engine" >> $GITHUB_ENV
81+
- name: Castle Game Engine - Env PATH (non-Windows)
82+
run: echo "PATH=$PATH:$CASTLE_ENGINE_PATH/tools/build-tool/" >> $GITHUB_ENV
83+
- name: Castle Game Engine - Clone snapshot
84+
run: git clone --depth 1 --single-branch --branch snapshot https://github.com/castle-engine/castle-engine/
85+
- name: Castle Game Engine - Build
86+
run: cd $CASTLE_ENGINE_PATH/tools/build-tool/ && ./castle-engine_compile.sh
87+
88+
- name: Package macOS
89+
run: castle-engine package --os=darwin --cpu=x86_64 --verbose
90+
- name: Archive Artifacts
91+
uses: actions/upload-artifact@v4
92+
with:
93+
name: macos-build
94+
path: "*-darwin-x86_64.zip"
95+
if-no-files-found: error
96+
97+
release:
98+
name: Release
99+
runs-on: ubuntu-latest
100+
# Only upload release if all builds, on all runners, succeeded.
101+
needs: [build-using-docker, build-macos]
102+
steps:
103+
- name: Download packaged releases
104+
uses: actions/download-artifact@v4
105+
with:
106+
merge-multiple: true
107+
- name: List downloaded files
108+
run: ls -R
109+
- name: GH CLI status
110+
env:
111+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
112+
run: gh auth status
113+
# Releases files in the "snapshot" release.
114+
- name: Release Artifacts
115+
if: ${{ github.ref == 'refs/heads/master' }}
116+
run: gh release --repo ${{ github.repository }} upload snapshot --clobber *.zip *.tar.gz *.apk
117+
env:
118+
GH_TOKEN: ${{ github.token }}
119+
120+
update-release-tag:
121+
name: Update Release Tag (make snapshot tag point to the build commit on master branch)
122+
runs-on: ubuntu-latest
123+
needs: [release]
124+
steps:
125+
- uses: actions/checkout@v4
126+
- name: Update Release Tag
127+
if: ${{ github.ref == 'refs/heads/master' }}
128+
run: |
129+
# --force allows to overwrite previous tag
130+
git tag --force snapshot
131+
# --force allows to push with overwritten tag
132+
git push --force origin snapshot

README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Demo game made during Dev Days of Summer 2024
1+
# Pirate shooting balls at skeletons, using physics
22

33
The project developed during a presentation _"Coding games using Castle Game Engine and Delphi"_ during https://www.codegear.com/DevDaysofSummer/ .
44

@@ -10,7 +10,10 @@ TODO: Add link to YouTube video etc. when available.
1010

1111
- reworked `OnCollisionEnter` to use 1 method `SkeletonCollides` for all 3 enemies,
1212
- fixed FPC compatilibity,
13-
- added README and screnshots.
13+
- added README and screnshots,
14+
- added `.github` workflow to build the project using [GitHub Actions](https://castle-engine.io/github_actions).
15+
16+
Download the compiled binaries from [snapshot release](https://github.com/castle-engine/conference-dev-days-summer-2024/releases/tag/snapshot).
1417

1518
## Features shown
1619

0 commit comments

Comments
 (0)