2024-04-14 21:49:41 +00: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 18:48:18 +00:00
|
|
|
git config --global --replace-all safe.directory $GITHUB_WORKSPACE
|
2024-04-14 21:49:41 +00: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 20:06:21 +00:00
|
|
|
with:
|
|
|
|
gh-token: ${{ steps.app_token.outputs.token }}
|
2024-04-14 21:49:41 +00: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 20:33:02 +00:00
|
|
|
persist-credentials: false
|
2024-04-14 21:49:41 +00: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 20:39:41 +00:00
|
|
|
git config --global url.https://x-access-token:${{ steps.app_token.outputs.token }}@github.com/.insteadOf https://github.com/
|
2024-04-24 19:26:01 +00:00
|
|
|
haxelib --global run hmm install -q
|
2024-04-24 21:03:56 +00:00
|
|
|
echo "TIMER_DONE=$(date +%s)" >> "$GITHUB_ENV"
|
2024-04-14 21:49:41 +00: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 }}
|