fucked up #98
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 | |
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | |
jobs: | |
# TODO: Make an Android CI job | |
buildWindows: | |
# The type of runner that the job will run on | |
runs-on: windows-latest | |
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 | |
- 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 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/ | |
export/debug/windows/haxe/ | |
export/debug/windows/obj/ | |
# Runs a set of commands using the runners shell | |
- name: Setup libraries via HMM | |
run: | | |
haxelib setup C:/haxelib | |
haxelib install hxcpp > /dev/null --quiet | |
haxelib install hmm --quiet | |
shell: cmd | |
- name: Build game | |
run: | | |
haxelib run lime build windows | |
shell: cmd | |
- name: Make a ZIP archive of files | |
run: | | |
7z a -tzip "PlusPlus.zip" "./export/release/windows/bin/*" | |
- name: Make release | |
uses: softprops/action-gh-release@v1 | |
with: | |
name: Latest dev build from action with id ${{github.run_number}} | |
tag_name: Actions_Build_${{github.run_number}} | |
prerelease: true | |
target_commitish: "develop" | |
files: | | |
PlusPlus.zip | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- 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 |