build: build every pull request

This commit is contained in:
Marcin Kurczewski 2024-08-30 15:14:25 +02:00
parent 5b2460c484
commit 3ef5a77a20
No known key found for this signature in database
GPG key ID: CC65E6FD28CAE42A
4 changed files with 79 additions and 32 deletions

44
.github/workflows/build_game.yml vendored Normal file
View file

@ -0,0 +1,44 @@
name: Build the game and the installer
on:
workflow_call:
workflow_dispatch:
jobs:
build:
name: Build release assets
runs-on: ubuntu-latest
strategy:
matrix:
include:
- platform: linux
just_target: package-linux
- platform: win
just_target: package-win-all
- platform: win-installer
just_target: package-win-installer
steps:
- name: Install dependencies
uses: taiki-e/install-action@just
- name: Checkout code
uses: actions/checkout@v4
with:
submodules: 'true'
fetch-depth: 0
- id: vars
name: Prepare variables
run: echo "version=$(just output-current-version)" >> $GITHUB_OUTPUT
- name: Package asset (${{ matrix.platform }})
run: just ${{ matrix.just_target }}
- name: Upload the artifact
uses: actions/upload-artifact@v4
with:
name: ${{ github.event.repository.name }}-${{ steps.vars.outputs.version }}-${{ matrix.platform }}
path: |
*.zip
*.exe

View file

@ -1,4 +1,4 @@
name: Build macOS app bundle and .dmg installer image
name: Build the game and the installer (macOS)
on:
workflow_call:
@ -19,6 +19,7 @@ env:
jobs:
build:
name: Build release assets
runs-on: macos-14
continue-on-error: ${{ inputs.let_mac_fail == true || inputs.let_mac_fail == 'true' }}
steps:
@ -264,10 +265,14 @@ jobs:
xcrun stapler staple -v TR1X-Installer.dmg
mv TR1X-Installer.dmg "TR1X-$(tools/get_version)-Installer.dmg"
- id: vars
name: Prepare variables
run: echo "version=$(tools/get_version)" >> $GITHUB_OUTPUT
- name: Upload signed+notarized installer image
uses: actions/upload-artifact@v4
with:
name: packaged_asset-mac
name: ${{ github.event.repository.name }}-${{ steps.vars.outputs.version }}-mac
path: |
*.dmg
compression-level: 0 # .dmg is already compressed.

25
.github/workflows/pr_builds.yml vendored Normal file
View file

@ -0,0 +1,25 @@
name: Create a test build
permissions:
contents: write
on:
pull_request:
push:
branches:
- '!stable'
- '!develop'
jobs:
package_multiplatform:
name: 'Create a test build'
uses: ./.github/workflows/build_game.yml
secrets: inherit
package_mac:
name: 'Create a test build (macOS)'
if: vars.MACOS_ENABLE == 'true'
uses: ./.github/workflows/build_game_macos.yml
with:
let_mac_fail: true
secrets: inherit

View file

@ -65,42 +65,15 @@ jobs:
name: Build release assets
runs-on: ubuntu-latest
if: vars.RELEASE_ENABLE == 'true'
strategy:
matrix:
include:
- platform: linux
just_target: package-linux
- platform: win
just_target: package-win-all
- platform: win installer
just_target: package-win-installer
steps:
- name: Install dependencies
uses: taiki-e/install-action@just
- name: Checkout code
uses: actions/checkout@v4
with:
submodules: 'true'
fetch-depth: 0
- name: Package asset (${{ matrix.platform }})
run: just ${{ matrix.just_target }}
- name: Upload the artifact
uses: actions/upload-artifact@v4
with:
name: packaged_asset-${{ matrix.platform }}
path: |
*.zip
*.exe
uses: ./.github/workflows/build_game.yml
secrets: inherit
package_mac:
name: "Build release assets (mac)"
if: |
vars.RELEASE_ENABLE == 'true' &&
vars.MACOS_ENABLE == 'true'
uses: ./.github/workflows/build_macos.yml
uses: ./.github/workflows/build_game_macos.yml
with:
let_mac_fail: ${{ inputs.let_mac_fail == true || inputs.let_mac_fail == 'true' }}
secrets: inherit