2024-04-14 17:49:41 -04:00
|
|
|
name: Build and Upload nightly game builds
|
|
|
|
|
|
|
|
on:
|
|
|
|
workflow_dispatch:
|
|
|
|
push:
|
|
|
|
paths-ignore:
|
|
|
|
- '**/Dockerfile'
|
|
|
|
- '.github/workflows/build-docker-image.yml'
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
|
|
|
|
build-game-on-host:
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
include:
|
|
|
|
- target: windows
|
|
|
|
- target: macos
|
|
|
|
runs-on:
|
|
|
|
- ${{ matrix.target }}
|
|
|
|
defaults:
|
|
|
|
run:
|
|
|
|
shell: bash
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Make git happy
|
|
|
|
run: |
|
2024-04-24 17:08:35 -04:00
|
|
|
git config --global --replace-all safe.directory $GITHUB_WORKSPACE
|
2024-04-14 17:49:41 -04:00
|
|
|
|
|
|
|
- name: Get checkout token
|
|
|
|
uses: actions/create-github-app-token@v1
|
|
|
|
id: app_token
|
|
|
|
with:
|
|
|
|
app-id: ${{ vars.APP_ID }}
|
|
|
|
private-key: ${{ secrets.APP_PEM }}
|
|
|
|
owner: ${{ github.repository_owner }}
|
|
|
|
|
|
|
|
- name: Checkout repo
|
|
|
|
uses: funkincrew/ci-checkout@v6
|
|
|
|
with:
|
|
|
|
submodules: 'recursive'
|
|
|
|
token: ${{ steps.app_token.outputs.token }}
|
|
|
|
|
|
|
|
- name: Setup build environment
|
|
|
|
uses: ./.github/actions/setup-haxe
|
2024-04-24 17:08:35 -04:00
|
|
|
with:
|
|
|
|
gh-token: ${{ steps.app_token.outputs.token }}
|
2024-04-14 17:49:41 -04:00
|
|
|
|
|
|
|
- name: Build game
|
|
|
|
if: ${{ matrix.target == 'windows' }}
|
|
|
|
run: |
|
|
|
|
haxelib run lime build windows -v -release -DGITHUB_BUILD
|
|
|
|
timeout-minutes: 120
|
|
|
|
- name: Build game
|
|
|
|
if: ${{ matrix.target != 'windows' }}
|
|
|
|
run: |
|
|
|
|
haxelib run lime build ${{ matrix.target }} -v -release --times -DGITHUB_BUILD
|
|
|
|
timeout-minutes: 120
|
|
|
|
|
|
|
|
- name: Upload build artifacts
|
|
|
|
uses: ./.github/actions/upload-itch
|
|
|
|
with:
|
|
|
|
butler-key: ${{ secrets.BUTLER_API_KEY}}
|
|
|
|
target: ${{ matrix.target }}
|
|
|
|
|
|
|
|
build-game-in-container:
|
|
|
|
runs-on: build-set
|
|
|
|
container: ghcr.io/funkincrew/build-dependencies:latest
|
|
|
|
strategy:
|
|
|
|
matrix:
|
|
|
|
include:
|
|
|
|
- target: linux
|
|
|
|
- target: html5
|
|
|
|
defaults:
|
|
|
|
run:
|
|
|
|
shell: bash
|
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Get checkout token
|
|
|
|
uses: actions/create-github-app-token@v1
|
|
|
|
id: app_token
|
|
|
|
with:
|
|
|
|
app-id: ${{ vars.APP_ID }}
|
|
|
|
private-key: ${{ secrets.APP_PEM }}
|
|
|
|
owner: ${{ github.repository_owner }}
|
|
|
|
|
|
|
|
- name: Checkout repo
|
|
|
|
uses: funkincrew/ci-checkout@v6
|
|
|
|
with:
|
|
|
|
submodules: 'recursive'
|
|
|
|
token: ${{ steps.app_token.outputs.token }}
|
2024-04-24 17:08:35 -04:00
|
|
|
persist-credentials: false
|
2024-04-14 17:49:41 -04:00
|
|
|
|
|
|
|
- name: Config haxelib
|
|
|
|
run: |
|
|
|
|
haxelib --never newrepo
|
|
|
|
echo "HAXEPATH=$(haxelib config)" >> "$GITHUB_ENV"
|
|
|
|
|
|
|
|
- name: Restore cached dependencies
|
|
|
|
id: cache-hmm
|
|
|
|
uses: actions/cache@v4
|
|
|
|
with:
|
|
|
|
path: .haxelib
|
|
|
|
key: haxe-hmm-${{ runner.os }}-${{ hashFiles('**/hmm.json') }}
|
|
|
|
|
|
|
|
- if: ${{ steps.cache-hmm.outputs.cache-hit != 'true' }}
|
|
|
|
name: Install dependencies
|
|
|
|
run: |
|
2024-04-24 17:21:54 -04:00
|
|
|
git config --global 'url.https://x-access-token:${{ steps.app_token.outputs.token }}@github.com/.insteadOf' https://github.com/
|
2024-04-24 17:08:35 -04:00
|
|
|
haxelib --global run hmm install -q
|
2024-04-14 17:49:41 -04:00
|
|
|
|
|
|
|
- if: ${{ matrix.target != 'html5' }}
|
|
|
|
name: Restore hxcpp cache
|
|
|
|
uses: actions/cache@v4
|
|
|
|
with:
|
|
|
|
path: /usr/share/hxcpp
|
|
|
|
key: haxe-hxcpp-${{ runner.os }}-${{ github.ref_name }}-${{ github.sha }}
|
|
|
|
restore-keys: haxe-hxcpp-${{ runner.os }}-${{ github.ref_name }}
|
|
|
|
|
|
|
|
- name: Build game
|
|
|
|
run: |
|
|
|
|
haxelib run lime build ${{ matrix.target }} -v -release --times -DGITHUB_BUILD
|
|
|
|
timeout-minutes: 120
|
|
|
|
|
|
|
|
- name: Upload build artifacts
|
|
|
|
uses: ./.github/actions/upload-itch
|
|
|
|
with:
|
|
|
|
butler-key: ${{ secrets.BUTLER_API_KEY}}
|
|
|
|
target: ${{ matrix.target }}
|