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

Commit 09d8ce0

Browse files
committed
Mobile Setup (Missing Android Worklflow)
1 parent ce1ec65 commit 09d8ce0

File tree

7 files changed

+273
-52
lines changed

7 files changed

+273
-52
lines changed

.github/workflows/ios.yml

Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
2+
name: iOS Build
3+
on:
4+
push:
5+
workflow_dispatch:
6+
jobs:
7+
build:
8+
name: iOS Build
9+
permissions: write-all
10+
runs-on: macos-13
11+
steps:
12+
- name: Pulling the new commit
13+
uses: actions/checkout@v3
14+
- name: Setting up Haxe
15+
uses: krdlab/setup-haxe@v1
16+
with:
17+
haxe-version: 4.2.5
18+
- name: Get Libs Hash
19+
id: get_hash
20+
run: |
21+
export GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}
22+
echo "hash=$(haxe -cp commandline -D analyzer-optimize --run Main get-libs-hash)" >> $GITHUB_OUTPUT
23+
- name: Restore existing build cache for faster compilation
24+
id: cache
25+
uses: actions/cache@v3
26+
with:
27+
# not caching the bin folder to prevent asset duplication and stuff like that
28+
key: cache-build-ios-${{ steps.get_hash.outputs.hash }}
29+
path: |
30+
.haxelib/
31+
~/.hxcpp/
32+
export/release/ios/CodenameEngine/haxe/
33+
export/release/ios/CodenameEngine/obj/
34+
restore-keys: |
35+
cache-build-ios-${{ steps.get_hash.outputs.hash }}
36+
- name: Enable HXCPP compile cache
37+
run: |
38+
echo "HXCPP_COMPILE_CACHE=~/.hxcpp" >> $GITHUB_ENV
39+
- name: Installing/Updating libraries
40+
if: steps.cache.outputs.cache-hit != 'true'
41+
run: |
42+
haxe -cp commandline -D analyzer-optimize --run Main setup -s --actions
43+
- name: Building HXCPP
44+
if: steps.cache.outputs.cache-hit != 'true'
45+
run: |
46+
haxelib dev hxcpp .haxelib/hxcpp/git
47+
cd .haxelib/hxcpp/git/tools/hxcpp
48+
haxe compile.hxml
49+
cd ../../../../..
50+
- name: Building Lime
51+
if: steps.cache.outputs.cache-hit != 'true'
52+
run: |
53+
haxelib dev lime .haxelib/lime/git
54+
haxelib run lime setup -alias -y -nocffi -eval
55+
haxelib run lime rebuild ios -release -nocolor -eval
56+
lime rebuild tools -release -nocolor -eval
57+
- name: Building the game
58+
run: |
59+
haxelib run lime build ios -nosign
60+
- name: Making app from built payload
61+
run: |
62+
cd export/release/ios/build/Release-iphoneos
63+
mkdir Payload
64+
mv *.app Payload
65+
zip -r CodenameEngine.ipa Payload
66+
- name: Uploading artifact (entire build)
67+
uses: actions/upload-artifact@v4
68+
with:
69+
name: Codename Engine
70+
path: export/release/ios/build/Release-iphoneos/*.ipa
71+
- name: Clearing already existing cache
72+
uses: actions/github-script@v6
73+
env:
74+
HASH: ${{ steps.get_hash.outputs.hash }}
75+
with:
76+
script: |
77+
const hash = process.env.HASH;
78+
const caches = await github.rest.actions.getActionsCacheList({
79+
owner: context.repo.owner,
80+
repo: context.repo.repo,
81+
});
82+
for (const cache of caches.data.actions_caches) {
83+
if (cache.key == "cache-build-ios-" + hash) {
84+
console.log('Clearing ' + cache.key + '...');
85+
await github.rest.actions.deleteActionsCacheById({
86+
owner: context.repo.owner,
87+
repo: context.repo.repo,
88+
cache_id: cache.id,
89+
});
90+
console.log("Cache cleared.");
91+
}
92+
}
93+
- name: Uploading new cache
94+
uses: actions/cache@v3
95+
with:
96+
# caching again since for some reason it doesnt work with the first post cache shit
97+
key: cache-build-ios-${{ steps.get_hash.outputs.hash }}
98+
path: |
99+
.haxelib/
100+
~/.hxcpp/
101+
export/release/ios/CodenameEngine/haxe/
102+
export/release/ios/CodenameEngine/obj/
103+
restore-keys: |
104+
cache-build-ios-${{ steps.get_hash.outputs.hash }}

.github/workflows/linux.yml

Lines changed: 49 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -7,73 +7,106 @@ jobs:
77
build:
88
name: Linux Build
99
permissions: write-all
10-
runs-on: ubuntu-24.04
10+
runs-on: ubuntu-latest
1111
steps:
12-
- name: Pulling the source
13-
uses: actions/checkout@v2
12+
- name: Pulling the new commit
13+
uses: actions/checkout@v3
1414
- name: Setting up Haxe
1515
uses: krdlab/setup-haxe@v1
1616
with:
1717
haxe-version: 4.2.5
18+
- name: Get Libs Hash
19+
id: get_hash
20+
run: |
21+
export GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}
22+
echo "hash=$(haxe -cp commandline -D analyzer-optimize --run Main get-libs-hash)" >> $GITHUB_OUTPUT
1823
- name: Restore existing build cache for faster compilation
24+
id: cache
1925
uses: actions/cache@v3
2026
with:
2127
# not caching the bin folder to prevent asset duplication and stuff like that
22-
key: cache-build-linux
28+
key: cache-build-linux-${{ steps.get_hash.outputs.hash }}
2329
path: |
2430
.haxelib/
31+
~/.hxcpp/
2532
export/release/linux/haxe/
2633
export/release/linux/obj/
2734
restore-keys: |
28-
cache-build-linux
35+
cache-build-linux-${{ steps.get_hash.outputs.hash }}
2936
- name: Installing LibVLC
3037
run: |
38+
sudo apt-get update
3139
sudo apt-get install libvlc-dev libvlccore-dev
40+
sudo apt-get install -y libgl1-mesa-dev libglu1-mesa-dev g++-multilib gcc-multilib libasound2-dev libx11-dev libxext-dev libxi-dev libxrandr-dev libxinerama-dev libmbedtls-dev libpng-dev libturbojpeg-dev libuv1-dev libvorbis-dev
41+
- name: Enable HXCPP compile cache
42+
run: |
43+
echo "HXCPP_COMPILE_CACHE=~/.hxcpp" >> $GITHUB_ENV
3244
- name: Installing/Updating libraries
45+
if: steps.cache.outputs.cache-hit != 'true'
46+
run: |
47+
haxe -cp commandline -D analyzer-optimize --run Main setup -s --actions
48+
- name: Building HXCPP
49+
if: steps.cache.outputs.cache-hit != 'true'
50+
run: |
51+
haxelib dev hxcpp .haxelib/hxcpp/git
52+
cd .haxelib/hxcpp/git/tools/hxcpp
53+
haxe compile.hxml
54+
cd ../../../../..
55+
- name: Building Lime
56+
if: steps.cache.outputs.cache-hit != 'true'
3357
run: |
34-
haxe -cp commandline -D analyzer-optimize --run Main setup -s
58+
haxelib dev lime .haxelib/lime/git
59+
haxelib run lime setup -alias -y -nocffi -eval
60+
haxelib run lime rebuild linux -release -nocolor -eval
61+
cd .haxelib/lime/git/tools
62+
haxe tools.hxml
63+
cd ../../../..
3564
- name: Building the game
3665
run: |
3766
haxelib run lime build linux
38-
# - name: Tar files
39-
# run: tar -zcvf CodenameEngine.tar.gz -C export/release/linux/bin .
67+
- name: Tar files
68+
run: tar -zcvf CodenameEngine.tar.gz -C export/release/linux/bin .
4069
- name: Uploading artifact (entire build)
4170
uses: actions/upload-artifact@v4
4271
with:
4372
name: Codename Engine
44-
path: export/release/linux/bin/
73+
path: CodenameEngine.tar.gz
4574
# - name: Uploading artifact (executable)
4675
# uses: actions/upload-artifact@v4
4776
# with:
4877
# name: Update-Linux
4978
# path: export/release/linux/bin/CodenameEngine
5079
- name: Clearing already existing cache
5180
uses: actions/github-script@v6
81+
env:
82+
HASH: ${{ steps.get_hash.outputs.hash }}
5283
with:
5384
script: |
85+
const hash = process.env.HASH;
5486
const caches = await github.rest.actions.getActionsCacheList({
5587
owner: context.repo.owner,
5688
repo: context.repo.repo,
57-
})
89+
});
5890
for (const cache of caches.data.actions_caches) {
59-
if (cache.key == "cache-build-linux") {
60-
console.log('Clearing ' + cache.key + '...')
91+
if (cache.key == "cache-build-linux-" + hash) {
92+
console.log('Clearing ' + cache.key + '...');
6193
await github.rest.actions.deleteActionsCacheById({
6294
owner: context.repo.owner,
6395
repo: context.repo.repo,
6496
cache_id: cache.id,
65-
})
66-
console.log("Cache cleared.")
97+
});
98+
console.log("Cache cleared.");
6799
}
68100
}
69101
- name: Uploading new cache
70102
uses: actions/cache@v3
71103
with:
72104
# caching again since for some reason it doesnt work with the first post cache shit
73-
key: cache-build-linux
105+
key: cache-build-linux-${{ steps.get_hash.outputs.hash }}
74106
path: |
75107
.haxelib/
108+
~/.hxcpp/
76109
export/release/linux/haxe/
77110
export/release/linux/obj/
78111
restore-keys: |
79-
cache-build-linux
112+
cache-build-linux-${{ steps.get_hash.outputs.hash }}

.github/workflows/macos.yml

Lines changed: 42 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,25 +10,52 @@ jobs:
1010
runs-on: macos-13
1111
steps:
1212
- name: Pulling the new commit
13-
uses: actions/checkout@v2
13+
uses: actions/checkout@v3
1414
- name: Setting up Haxe
1515
uses: krdlab/setup-haxe@v1
1616
with:
1717
haxe-version: 4.2.5
18+
- name: Get Libs Hash
19+
id: get_hash
20+
run: |
21+
export GITHUB_TOKEN=${{ secrets.GITHUB_TOKEN }}
22+
echo "hash=$(haxe -cp commandline -D analyzer-optimize --run Main get-libs-hash)" >> $GITHUB_OUTPUT
1823
- name: Restore existing build cache for faster compilation
24+
id: cache
1925
uses: actions/cache@v3
2026
with:
2127
# not caching the bin folder to prevent asset duplication and stuff like that
22-
key: cache-build-mac
28+
key: cache-build-mac-${{ steps.get_hash.outputs.hash }}
2329
path: |
2430
.haxelib/
31+
~/.hxcpp/
2532
export/release/macos/haxe/
2633
export/release/macos/obj/
2734
restore-keys: |
28-
cache-build-mac
35+
cache-build-mac-${{ steps.get_hash.outputs.hash }}
36+
- name: Enable HXCPP compile cache
37+
run: |
38+
echo "HXCPP_COMPILE_CACHE=~/.hxcpp" >> $GITHUB_ENV
2939
- name: Installing/Updating libraries
40+
if: steps.cache.outputs.cache-hit != 'true'
41+
run: |
42+
haxe -cp commandline -D analyzer-optimize --run Main setup -s --actions
43+
- name: Building HXCPP
44+
if: steps.cache.outputs.cache-hit != 'true'
45+
run: |
46+
haxelib dev hxcpp .haxelib/hxcpp/git
47+
cd .haxelib/hxcpp/git/tools/hxcpp
48+
haxe compile.hxml
49+
cd ../../../../..
50+
- name: Building Lime
51+
if: steps.cache.outputs.cache-hit != 'true'
3052
run: |
31-
haxe -cp commandline -D analyzer-optimize --run Main setup -s
53+
haxelib dev lime .haxelib/lime/git
54+
haxelib run lime setup -alias -y -nocffi -eval
55+
haxelib run lime rebuild mac -release -nocolor -eval
56+
cd .haxelib/lime/git/tools
57+
haxe tools.hxml
58+
cd ../../../..
3259
- name: Building the game
3360
run: |
3461
haxelib run lime build mac
@@ -46,31 +73,35 @@ jobs:
4673
# path: export/release/macos/bin/CodenameEngine
4774
- name: Clearing already existing cache
4875
uses: actions/github-script@v6
76+
env:
77+
HASH: ${{ steps.get_hash.outputs.hash }}
4978
with:
5079
script: |
80+
const hash = process.env.HASH;
5181
const caches = await github.rest.actions.getActionsCacheList({
5282
owner: context.repo.owner,
5383
repo: context.repo.repo,
54-
})
84+
});
5585
for (const cache of caches.data.actions_caches) {
56-
if (cache.key == "cache-build-mac") {
57-
console.log('Clearing ' + cache.key + '...')
86+
if (cache.key == "cache-build-mac-" + hash) {
87+
console.log('Clearing ' + cache.key + '...');
5888
await github.rest.actions.deleteActionsCacheById({
5989
owner: context.repo.owner,
6090
repo: context.repo.repo,
6191
cache_id: cache.id,
62-
})
63-
console.log("Cache cleared.")
92+
});
93+
console.log("Cache cleared.");
6494
}
6595
}
6696
- name: Uploading new cache
6797
uses: actions/cache@v3
6898
with:
6999
# caching again since for some reason it doesnt work with the first post cache shit
70-
key: cache-build-mac
100+
key: cache-build-mac-${{ steps.get_hash.outputs.hash }}
71101
path: |
72102
.haxelib/
103+
~/.hxcpp/
73104
export/release/macos/haxe/
74105
export/release/macos/obj/
75106
restore-keys: |
76-
cache-build-mac
107+
cache-build-mac-${{ steps.get_hash.outputs.hash }}

0 commit comments

Comments
 (0)