forked from FunkinCrew/Funkin
-
Notifications
You must be signed in to change notification settings - Fork 0
82 lines (81 loc) · 2.78 KB
/
build-game.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
# This is a basic workflow to help you get started with Actions
name: Build CI
# Controls when the workflow will run
on:
push:
branches:
- develop
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
buildWindows:
# The type of runner that the job will run on
runs-on: windows-latest
# The name of the job
name: Windows x64 Build
permissions:
contents: write
actions: write
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: Pulling the new commit
uses: actions/checkout@main
with:
submodules: true # PLEASE LEAVE SUBMODULES ENABLED!!!!!!!!!!
- name: Setting up Haxe
uses: krdlab/setup-haxe@master
with:
haxe-version: 4.3.4
# Took the caching functions from Codename Engine
- name: Restore existing build cache for faster compilation
id: cache-restore
uses: actions/cache/restore@v4
with:
key: cache-build-windows
path: |
export/release/windows/haxe/
export/release/windows/obj/
# Runs a set of commands using the runners shell
- name: Install libraries through HMM
run: |
haxelib setup C:/haxelib
haxelib install hxcpp > /dev/null --quiet
haxelib install hmm --quiet
haxelib run hmm setup
haxelib run hmm install --quiet
haxelib run lime build windows
shell: cmd
- name: Publish Artifact
uses: actions/[email protected]
with:
name: windowsBuild
path: export/release/windows/bin
- name: Clear already existing cache
uses: actions/github-script@v6
with:
script: |
const caches = await github.rest.actions.getActionsCacheList({
owner: context.repo.owner,
repo: context.repo.repo,
})
for (const cache of caches.data.actions_caches) {
if (cache.key == "cache-build-windows") {
console.log('Clearing ' + cache.key + '...')
await github.rest.actions.deleteActionsCacheById({
owner: context.repo.owner,
repo: context.repo.repo,
cache_id: cache.id,
})
console.log("Cache cleared.")
}
}
- name: Save new cache
uses: actions/cache/save@v4
with:
path: |
export/release/windows/haxe/
export/release/windows/obj/
export/debug/windows/haxe/
export/debug/windows/obj/
key: cache-build-windows