forked from RalseiSmol03/ourple-guy-yeaa
-
Notifications
You must be signed in to change notification settings - Fork 0
103 lines (93 loc) · 3.05 KB
/
maindebug.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
name: Ourple Guy Build
on: workflow_dispatch
jobs:
Android:
runs-on: ubuntu-latest
permissions:
contents: write
actions: write
steps:
- name: Checkout
uses: actions/checkout@main
with:
submodules: true
- name: Setup Android NDK
id: setup-ndk
uses: nttld/setup-ndk@main
with:
ndk-version: r21e
- name: Setup Java JDK
uses: actions/setup-java@main
with:
distribution: 'zulu'
java-version: '11'
- name: Setup Haxe
uses: krdlab/setup-haxe@master
with:
haxe-version: 4.2.5
- name: Restore Previous Cache
id: cache-debug-build-android-restore
uses: actions/cache/restore@main
with:
path: |
.haxelib/
export/debug/android/haxe/
export/debug/android/obj/
key: cache-android-build
- name: Installing Libraries
run: |
haxelib setup ~/haxelib
haxelib install hxcpp > /dev/null --quiet
haxelib install hmm --quiet
haxelib run hmm install
- name: Configure Android
run: |
haxelib run lime setup -alias -y
haxelib run lime config ANDROID_SDK $ANDROID_HOME
haxelib run lime config ANDROID_NDK_ROOT $ANDROID_NDK_HOME
haxelib run lime config JAVA_HOME $JAVA_HOME
haxelib run lime config ANDROID_SETUP true
env:
ANDROID_NDK_HOME: ${{ steps.setup-ndk.outputs.ndk-path }}
- name: Building
run: haxelib run lime build android -debug
- name: Clear Previous Cache
uses: actions/github-script@main
with:
script: |
try {
const caches = await github.rest.actions.getActionsCacheList({
owner: context.repo.owner,
repo: context.repo.repo,
})
if (typeof caches.data.actions_caches != null && caches.data.actions_caches.length > 0) {
for (const cache of caches.data.actions_caches) {
if (cache.key == "cache-android-build") {
console.log('Clearing ' + cache.key + '...')
await github.rest.actions.deleteActionsCacheById({
owner: context.repo.owner,
repo: context.repo.repo,
cache_id: cache.id,
})
console.log("Previous Cache Cleared!")
}
}
}
} catch (error) {
console.log(error.message);
}
- name: Save Current Cache
id: cache-debug-build-android-save
uses: actions/cache/save@main
with:
path: |
.haxelib/
export/debug/android/haxe/
export/debug/android/obj/
key: cache-android-build
- name: Upload Artifact
uses: actions/upload-artifact@main
with:
name: OurpleGuy-Android
path: export/debug/android/bin/app/build/outputs/apk/debug
if-no-files-found: warn