Skip to content
This repository was archived by the owner on Jan 5, 2024. It is now read-only.

Commit 396b441

Browse files
authored
Merge pull request #380 from cortex-command-community/linux-AppImage-generation
AppImage artifacts and ccache fix
2 parents 1a7f66a + c8865c9 commit 396b441

File tree

6 files changed

+64
-40
lines changed

6 files changed

+64
-40
lines changed

.github/workflows/build-check.yml

Lines changed: 10 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,9 @@ name: Compile check
44
on:
55
# Triggers the workflow on push or pull request events but only for the development branch
66
push:
7-
branches: [ master, development ]
7+
branches: [master, development]
88
pull_request:
9-
types: [opened, ready_for_review]
10-
branches: [ master, development ]
9+
types: [opened, reopened, ready_for_review, synchronize]
1110

1211
workflow_dispatch:
1312

@@ -28,16 +27,6 @@ jobs:
2827
sudo apt-get update -yq
2928
sudo apt-get install --no-install-recommends liballegro4-dev libloadpng4-dev libflac++-dev luajit-5.1-dev libminizip-dev liblz4-dev libpng++-dev libx11-dev libboost-dev
3029
31-
- name: Cache
32-
uses: actions/[email protected]
33-
with:
34-
# A list of files, directories, and wildcard patterns to cache and restore
35-
path: |
36-
~/.cache
37-
~/.ccache
38-
# An explicit key for restoring and saving the cache
39-
key: ${{runner.os}}-build
40-
4130
- name: Install Clang
4231
# You may pin to the exact commit or the version.
4332
# uses: egor-tensin/setup-clang@d16e36d5f8a7eb00aa6627c1a536d94dfc4a913d
@@ -47,22 +36,26 @@ jobs:
4736
cc: 1 # optional, default is 1
4837

4938
- name: Setup ccache
50-
# You may pin to the exact commit or the version.
51-
# uses: alexjurkiewicz/setup-ccache@411d41a94dc67522f8aea0dbb5362240aaf31523
52-
uses: alexjurkiewicz/[email protected]
39+
uses: hendrikmuhs/ccache-action@v1
40+
with:
41+
key: build-check-${{runner.os}}-regressed
42+
max-size: 5G
5343

5444
- name: Build
5545
# You may pin to the exact commit or the version.
5646
# uses: BSFishy/meson-build@6f1930d878fd3eed3853c1c91285ec604c37f3a5
5747
uses: BSFishy/[email protected]
48+
env:
49+
CC: "ccache clang"
50+
CXX: "ccache clang++"
51+
CCACHE_SLOPPINESS: pch_defines,time_macros,include_file_mtime,include_file_ctime
5852
with:
5953
# The action to run
6054
setup-options: --buildtype=debug -Ddebug_type=full
6155
meson-version: 0.55.3
6256
ninja-version: 1.10.0
6357
action: build
6458

65-
6659
build-windows:
6760
env:
6861
# Path to the solution file relative to the root of the project.

.github/workflows/meson.yml

Lines changed: 40 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,14 @@ on:
44
# Triggers the workflow on push or pull request events but only for the development branch
55
push:
66
branches: [ master, development ]
7+
release:
78
workflow_dispatch:
89

910

1011
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
1112
jobs:
1213
# This workflow contains a single job called "build"
13-
build:
14+
build-release-linux:
1415
# The type of runner that the job will run on
1516
runs-on: ubuntu-20.04
1617

@@ -20,21 +21,11 @@ jobs:
2021
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
2122
- uses: actions/checkout@v2
2223
- uses: actions/setup-python@v2
23-
24+
2425
- name: Install Dependencies
2526
run: |
2627
sudo apt-get update -yq
27-
sudo apt-get install --no-install-recommends liballegro4-dev libloadpng4-dev libflac++-dev luajit-5.1-dev libminizip-dev liblz4-dev libpng++-dev libx11-dev libboost-dev
28-
29-
- name: Cache
30-
uses: actions/[email protected]
31-
with:
32-
# A list of files, directories, and wildcard patterns to cache and restore
33-
path: |
34-
~/.cache
35-
~/.ccache
36-
# An explicit key for restoring and saving the cache
37-
key: ${{runner.os}}-build
28+
sudo apt-get install --no-install-recommends wget liballegro4-dev libloadpng4-dev libflac++-dev luajit-5.1-dev libminizip-dev liblz4-dev libpng++-dev libx11-dev libboost-dev
3829
3930
- name: Install Clang
4031
# You may pin to the exact commit or the version.
@@ -43,19 +34,50 @@ jobs:
4334
with:
4435
# Set up cc/c++ executables
4536
cc: 1 # optional, default is 1
46-
37+
4738
- name: Setup ccache
48-
# You may pin to the exact commit or the version.
49-
# uses: alexjurkiewicz/setup-ccache@411d41a94dc67522f8aea0dbb5362240aaf31523
50-
uses: alexjurkiewicz/[email protected]
51-
39+
uses: hendrikmuhs/ccache-action@v1
40+
with:
41+
key: build-release-${{runner.os}}
42+
max-size: 5G
43+
5244
- name: Build
5345
# You may pin to the exact commit or the version.
5446
# uses: BSFishy/meson-build@6f1930d878fd3eed3853c1c91285ec604c37f3a5
5547
uses: BSFishy/[email protected]
48+
env:
49+
CC: "ccache clang"
50+
CXX: "ccache clang++"
51+
CCACHE_SLOPPINESS: pch_defines,time_macros,include_file_mtime,include_file_ctime
5652
with:
5753
# The action to run
54+
setup-options: --buildtype=release -Dinstall_data=false -Dinstall_runner=false -Dfmod_dir=/usr/lib/ --prefix=/usr/
5855
meson-version: 0.55.3
5956
ninja-version: 1.10.0
6057
action: build
6158

59+
- name: Create AppDir
60+
run: |
61+
echo "Setting output prefix"
62+
DESTDIR=${GITHUB_WORKSPACE}/build/AppDir meson install -C $GITHUB_WORKSPACE"/build"
63+
64+
- name: Download linuxdeploy
65+
working-directory: ${{env.GITHUB_WORKSPACE}}
66+
run: |
67+
wget https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage -O lindeploy
68+
chmod +x lindeploy
69+
70+
- name: Create AppImage
71+
working-directory: ${{env.GITHUB_WORKSPACE}}
72+
env:
73+
LD_LIBRARY_PATH: ./external/lib/linux/x86_64/
74+
OUTPUT: CortexCommand.AppImage
75+
run: |
76+
echo ${LD_LIBRARY_PATH}
77+
./lindeploy --appdir=build/AppDir --output appimage
78+
79+
- name: Upload Appimage
80+
uses: actions/upload-artifact@v2
81+
with:
82+
name: CortexCommand.AppImage
83+
path: CortexCommand.AppImage

Resources/cccp.desktop

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@ Categories=Game;
33
Type=Application
44
Icon=cccp
55
Name=Cortex Command (Community Project)
6-
Description=Choose between different factions, with their own set of expendable soldiers, mechas, and weapons. Protect your brain, mine gold, and destroy the enemy cortex in his bunker complex!
7-
Exec=CortexCommand
6+
Comment=Choose between different factions, with their own set of expendable soldiers, mechas, and weapons. Protect your brain, mine gold, and destroy the enemy cortex in his bunker complex!
7+
Exec=@EXERUNNER@

Resources/meson.build

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# User frontend
22
desktop_file = files('cccp.desktop')
33
icon_file = files('cccp.xpm')
4-
install_data('cccp.desktop', install_dir:get_option('datadir')/'applications', install_mode: 'rw-r--r--')
4+
configure_file(input: 'cccp.desktop', output: 'CortexCommand.desktop', install: true, install_dir:get_option('datadir')/'applications', install_mode: 'rw-r--r--', configuration: conf_data)
55
install_data('cccp.xpm', install_dir: get_option('datadir')/'icons/hicolor/32x32/apps', install_mode:'rw-r--r--')
6-
configure_file(input: 'cccp.sh', output:'CortexCommand', install:true, install_dir: get_option('bindir'), install_mode:'rwxr-xr-x', configuration: conf_data)
6+
configure_file(input: 'cccp.sh', output:'CortexCommand', install: get_option('install_runner'), install_dir: get_option('bindir'), install_mode:'rwxr-xr-x', configuration: conf_data)

meson.build

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ if compiler.get_argument_syntax()== 'gcc' # used for gcc compatible compilers
3333
message('gcc detected')
3434

3535
build_rpath = '$ORIGIN:$ORIGIN/../external/lib/linux/x86_64' # Set RUNPATH so that CCCP can find libfmod.so without needing to set LD_LIBRARY_PATH
36-
suffix = 'x86_64'
36+
#suffix = 'x86_64'
3737
link_args += ['-Wl,--enable-new-dtags'] # Set RUNPATH instead of RPATH
3838

3939
# Set preprocessor flags and cpp arguments according to build options
@@ -101,6 +101,11 @@ else
101101
conf_data.set('EXENAME', elfname + '.' + suffix)
102102
endif
103103

104+
if get_option('install_runner')
105+
conf_data.set('EXERUNNER', 'CortexCommand')
106+
else
107+
conf_data.set('EXERUNNER', conf_data.get('EXENAME'))
108+
endif
104109

105110
#### Sources Setup ####
106111
pch = 'System/StandardIncludes.h'
@@ -156,8 +161,10 @@ base_exclude_files = [
156161
'Start Dedicated Server.bat'
157162
]
158163

164+
if get_option('install_data')
159165
install_subdir(get_option('cccpdatadir'),
160166
exclude_directories:['.git', '.github', 'Metagames.rte', 'Scenes.rte'],
161167
exclude_files:base_exclude_files,
162168
install_dir:get_option('data_install_dir'),
163169
strip_directory:true)
170+
endif

meson_options.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,5 @@ option('cccpdatadir', type:'string', value:'../Cortex-Command-Community-Project-
33
option('data_install_dir', type:'string', value:'share/CortexCommand', description: 'Where to install the data files relative to prefix directory')
44
option('install_fmod', type:'boolean', value:true, description: 'Wether to install the fmod library.')
55
option('fmod_dir', type:'string', value:'/opt/CortexCommand/lib', description: 'Where to install the fmod library.')
6+
option('install_data', type: 'boolean', value: true, description: 'Whether to install the data repo.')
7+
option('install_runner', type: 'boolean', value: true, description: 'Whether to install the runner script.')

0 commit comments

Comments
 (0)