SUB - Build on Linux #20
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
name: SUB - Build on Linux | |
on: | |
workflow_dispatch: | |
inputs: | |
env: | |
description: "An Environment" | |
required: true | |
type: choice | |
options: | |
- Development | |
- Production | |
version: | |
description: "A Version" | |
required: true | |
type: string | |
caching: | |
description: "Use caching" | |
required: true | |
type: boolean | |
default: false | |
workflow_call: | |
inputs: | |
env: | |
description: "An Environment" | |
required: true | |
type: string | |
version: | |
description: "A Version" | |
required: true | |
type: string | |
caching: | |
description: "Use caching" | |
required: true | |
type: boolean | |
default: false | |
env: | |
app_name: ${{ inputs.env == 'Production' && 'SuperHumanInstaller' || 'SuperHumanInstallerDev' }} | |
app_id: net.prominic.genesis.${{ inputs.env == 'Production' && 'superhumaninstaller' || 'superhumaninstallerdev' }} | |
full_version: ${{ inputs.version }}.${{ github.run_number }} | |
haxe_flag: ${{ inputs.env == 'Production' && '-final' || '-debug' }} | |
haxe_version: 4.3.3 | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Build info | |
run: | | |
echo "Ref: ${{ github.ref_name }}" | |
echo "Env: ${{ inputs.env }}" | |
echo "Version: ${{ env.full_version }}" | |
echo "App Name: ${{ env.app_name }}" | |
echo "App ID: ${{ env.app_id }}" | |
echo "Haxe Env Flag: ${{ env.haxe_flag }}" | |
- name: Checkout repo | |
uses: actions/checkout@v4 | |
with: | |
lfs: true | |
- name: Checkout LFS objects | |
run: git lfs checkout | |
- name: Override project.xml version | |
uses: Moonshine-IDE/[email protected] | |
with: | |
filepath: "project.xml" | |
xpath: "/project/meta/@version" | |
replace: "${{ env.full_version }}" | |
- name: Install missing system dependencies | |
run: | | |
sudo apt-get update | |
sudo apt-get install libxinerama-dev | |
sudo apt-get install libxrandr-dev | |
sudo apt-get install mesa-common-dev | |
sudo apt-get install libasound2-dev | |
sudo apt-get install gcc-multilib | |
sudo apt-get install g++-multilib | |
sudo apt-get install libfuse2 | |
- name: Set up Haxe | |
uses: krdlab/[email protected] | |
with: | |
haxe-version: ${{ env.haxe_version }} | |
- name: Show haxe info | |
run: | | |
echo "Haxe version:" | |
haxe -version | |
echo "Haxe lib path:" | |
haxelib config | |
- name: Update haxelib | |
run: haxelib --global update haxelib | |
- name: Cache Binaries | |
id: cache-bin | |
if: ${{ inputs.caching }} | |
uses: actions/cache@v4 | |
with: | |
path: Export/Development/linux/bin/ | |
key: ${{ env.app_name }}-linux-bin | |
- name: Install dependencies | |
if: ${{ !inputs.caching || !steps.cache-bin.outputs.cache-hit }} | |
working-directory: Build | |
run: haxe --run InstallDependencies.hx | |
- name: Build | |
if: ${{ !inputs.caching || !steps.cache-bin.outputs.cache-hit }} | |
run: | | |
haxelib install hxcpp | |
git clone --recursive --depth 1 --branch develop https://github.com/openfl/lime | |
haxelib dev lime lime | |
haxelib install format | |
haxelib install hxp | |
haxelib git lime-samples https://github.com/openfl/lime-samples | |
haxelib git openfl https://github.com/openfl/openfl.git develop | |
haxelib run openfl setup | |
haxelib git feathersui https://github.com/feathersui/feathersui-openfl.git | |
haxelib git champaign https://github.com/Moonshine-IDE/Champaign.git | |
- name: Show Build | |
run: tree Export/Development/linux/bin/ | |
- name: Upload bin | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ env.app_name }}-linux-bin | |
path: Export/${{ inputs.env }}/linux/bin/ |