-
-
Notifications
You must be signed in to change notification settings - Fork 2
111 lines (104 loc) · 4.7 KB
/
build.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
# ----------------------------------------------------------------------------
# GitHub Action workflow to build using latest Castle Game Engine snapshot
# for multiple platforms.
#
# See https://castle-engine.io/github_actions .
#
# Modified the default template to build client and server for not-quake.
# ----------------------------------------------------------------------------
name: Build
on: [push]
jobs:
# Build for platforms supported by
# CGE Docker image https://hub.docker.com/r/kambi/castle-engine-cloud-builds-tools/ .
#
# Since setting up Docker image takes majority of time (5-6 mins)
# compared to actually getting and compiling CGE (1 min)
# and building application (~1 min for each platform),
# we build all platforms possible within one job.
build-using-docker:
name: Build Using Docker
runs-on: ubuntu-latest
container: kambi/castle-engine-cloud-builds-tools:cge-none
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
# Set env CASTLE_ENGINE_PATH following
# https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#environment-files
# https://brandur.org/fragments/github-actions-env-vars-in-env-vars
- name: Castle Game Engine - Setup environment
run: echo "CASTLE_ENGINE_PATH=$GITHUB_WORKSPACE/castle-engine" >> $GITHUB_ENV
- name: Castle Game Engine - Clone snapshot
run: git clone --depth 1 --single-branch --branch snapshot https://github.com/castle-engine/castle-engine/
- name: Castle Game Engine - Build
run: cd $CASTLE_ENGINE_PATH/tools/build-tool/ && ./castle-engine_compile.sh
- name: Package Windows Client
run: cd client/ && $CASTLE_ENGINE_PATH/tools/build-tool/castle-engine package --os=win64 --cpu=x86_64 --verbose
- name: Package Windows Server
run: cd server/ && $CASTLE_ENGINE_PATH/tools/build-tool/castle-engine package --os=win64 --cpu=x86_64 --verbose
- name: Archive Artifacts
# See https://github.com/actions/upload-artifact
uses: actions/upload-artifact@v3
with:
name: windows-build
path: |
client/*-win64-x86_64.zip
server/*-win64-x86_64.zip
if-no-files-found: error
- name: Package Linux Client
run: cd client/ && $CASTLE_ENGINE_PATH/tools/build-tool/castle-engine package --os=linux --cpu=x86_64 --verbose
- name: Package Linux Server
run: cd server/ && $CASTLE_ENGINE_PATH/tools/build-tool/castle-engine package --os=linux --cpu=x86_64 --verbose
- name: Archive Artifacts
uses: actions/upload-artifact@v3
with:
name: linux-build
path: |
client/*-linux-x86_64.tar.gz
server/*-linux-x86_64.tar.gz
if-no-files-found: error
- name: Package Android Client
run: cd client/ && $CASTLE_ENGINE_PATH/tools/build-tool/castle-engine package --target=android --verbose
# We'd need some UI for Android server
# - name: Package Android Server
# run: cd server/ && $CASTLE_ENGINE_PATH/tools/build-tool/castle-engine package --target=android --verbose
- name: Archive Artifacts
uses: actions/upload-artifact@v3
with:
name: android-build
path: |
client/*.apk
server/*.apk
if-no-files-found: error
# Build for platforms supported from macOS.
# This means to build for macOS and (maybe in the future) iOS.
build-macos:
name: Build Using macOS
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- name: Install FPC+Lazarus
uses: gcarreno/setup-lazarus@v3.0.16
with:
lazarus-version: stable
- name: Castle Game Engine - Setup environment
run: echo "CASTLE_ENGINE_PATH=$GITHUB_WORKSPACE/castle-engine" >> $GITHUB_ENV
- name: Castle Game Engine - Clone snapshot
run: git clone --depth 1 --single-branch --branch snapshot https://github.com/castle-engine/castle-engine/
- name: Castle Game Engine - Build
run: cd $CASTLE_ENGINE_PATH/tools/build-tool/ && ./castle-engine_compile.sh
- name: Package macOS Client
run: cd client/ && $CASTLE_ENGINE_PATH/tools/build-tool/castle-engine package --os=darwin --cpu=x86_64 --verbose
- name: Package macOS Server
run: cd server/ && $CASTLE_ENGINE_PATH/tools/build-tool/castle-engine package --os=darwin --cpu=x86_64 --verbose
- name: Archive Artifacts
uses: actions/upload-artifact@v3
with:
name: macos-build
path: |
client/*-darwin-x86_64.zip
server/*-darwin-x86_64.zip
if-no-files-found: error