Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TRX merger #1553

Merged
merged 11 commits into from
Oct 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
12 changes: 8 additions & 4 deletions .github/workflows/build_docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,12 @@ jobs:
strategy:
matrix:
include:
- platform: win
- platform: linux
- game_version: tr1
platform: win
- game_version: tr1
platform: linux
- game_version: tr2
platform: win
steps:
- name: Login to Docker Hub
uses: docker/login-action@v1
Expand All @@ -29,5 +33,5 @@ jobs:

- name: Build Docker image (${{ matrix.platform }})
run: |
just image-${{ matrix.platform }}
just push-image-${{ matrix.platform }}
just ${{ matrix.game_version }}-image-${{ matrix.platform }}
just ${{ matrix.game_version }}-push-image-${{ matrix.platform }}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build the game and the installer
name: Build TR1X and the installer

on:
workflow_call:
Expand All @@ -12,11 +12,11 @@ jobs:
matrix:
include:
- platform: linux
just_target: package-linux
just_target: tr1-package-linux
- platform: win
just_target: package-win-all
just_target: tr1-package-win-all
- platform: win-installer
just_target: package-win-installer
just_target: tr1-package-win-installer

steps:
- name: Install dependencies
Expand All @@ -30,15 +30,15 @@ jobs:

- id: vars
name: Prepare variables
run: echo "version=$(just output-current-version)" >> $GITHUB_OUTPUT
run: echo "version=$(just output-current-version 1)" >> $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 }}
name: TR1X-${{ steps.vars.outputs.version }}-${{ matrix.platform }}
path: |
*.zip
*.exe
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build the game and the installer (macOS)
name: Build TR1X and the installer (macOS)

on:
workflow_call:
Expand Down Expand Up @@ -225,14 +225,14 @@ jobs:
- name: Build arm64 and create app bundle
run: |
BUILD_DIR=build-arm64
BUILD_OPTIONS="--prefix=/tmp/TR1X.app --bindir=Contents/MacOS"
BUILD_OPTIONS="src/tr1 --prefix=/tmp/TR1X.app --bindir=Contents/MacOS"
meson setup $BUILD_DIR $BUILD_OPTIONS
meson install -C $BUILD_DIR

- name: Build x86-64
run: |
BUILD_DIR=build-x86-64
BUILD_OPTIONS="--prefix=/tmp/TR1X.app --bindir=Contents/MacOS --cross-file tools/mac/x86-64_cross_file.txt"
BUILD_OPTIONS="src/tr1 --prefix=/tmp/TR1X.app --bindir=Contents/MacOS --cross-file tools/tr1/mac/x86-64_cross_file.txt"
meson setup $BUILD_DIR $BUILD_OPTIONS
meson compile -C $BUILD_DIR

Expand All @@ -245,7 +245,7 @@ jobs:
mv $BUNDLE_EXEC_DIR/TR1X_universal $BUNDLE_EXEC_DIR/TR1X

# Update dynamic library links in the fused executable.
./tools/mac/bundle_dylibs --links-only
./tools/tr1/mac/bundle_dylibs --links-only

- name: Sign app bundle
run: |
Expand All @@ -262,16 +262,16 @@ jobs:
run: |
KEYCHAIN_PATH=$RUNNER_TEMP/app-signing.keychain-db
IDENTITY=$(security find-identity -v -p codesigning $KEYCHAIN_PATH | awk -F'"' '{print $2}')
tools/mac/create_installer
tools/tr1/mac/create_installer
xattr -cr TR1X-Installer.dmg
/usr/bin/codesign --force --options runtime -s "${IDENTITY}" --keychain $KEYCHAIN_PATH -v TR1X-Installer.dmg
xcrun notarytool submit --wait --apple-id "$MACOS_APPLEID" --password "$MACOS_APP_PWD" --team-id "$MACOS_TEAMID" TR1X-Installer.dmg
xcrun stapler staple -v TR1X-Installer.dmg
mv TR1X-Installer.dmg "TR1X-$(tools/get_version)-Installer.dmg"
mv TR1X-Installer.dmg "TR1X-$(tools/get_version 1)-Installer.dmg"

- id: vars
name: Prepare variables
run: echo "version=$(tools/get_version)" >> $GITHUB_OUTPUT
run: echo "version=$(tools/get_version 1)" >> $GITHUB_OUTPUT

- name: Upload signed+notarized installer image
uses: actions/upload-artifact@v4
Expand Down
40 changes: 40 additions & 0 deletions .github/workflows/job_build_tr2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Build TR2X

on:
workflow_call:
workflow_dispatch:

jobs:
build:
name: Build release assets
runs-on: ubuntu-latest
strategy:
matrix:
include:
- platform: win
just_target: tr2-package-win-all

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 2)" >> $GITHUB_OUTPUT

- name: Package asset (${{ matrix.platform }})
run: just ${{ matrix.just_target }}

- name: Upload the artifact
uses: actions/upload-artifact@v4
with:
name: TR2X-${{ steps.vars.outputs.version }}-${{ matrix.platform }}
path: |
*.zip
*.exe
29 changes: 15 additions & 14 deletions .github/workflows/job_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ name: Create a new release
on:
workflow_call:
inputs:
changelog_game_version:
type: string
description: "Game version to build the changelog from"
required: true
draft:
type: boolean
description: "Draft"
Expand All @@ -13,11 +17,6 @@ on:
description: "Prerelease"
required: true
default: false
release_name:
type: string
description: "Release name"
required: true
default: "Release ${{ github.ref_name }}"
tag_name:
type: string
description: "Tag name"
Expand All @@ -39,19 +38,21 @@ jobs:
submodules: 'true'
fetch-depth: 0

- name: "Prepare release data"
id: prepare_release_data
run: |
echo -n "release_name=" >> $GITHUB_OUTPUT
just output-release-name ${{ inputs.changelog_game_version }} >> $GITHUB_OUTPUT
echo "changelog<<EOF" >> $GITHUB_OUTPUT
just output-current-changelog ${{ inputs.changelog_game_version }} >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT

- name: "Download built game assets"
uses: actions/download-artifact@v4
with:
path: artifacts/
merge-multiple: true

- name: "Generate changelog"
run: |
hash=$(git log -1 --pretty=format:%H)
tag=$(just output-current-version)
echo -e "**Commit: $hash** \n**Tag: $tag**\n\n### Changes\n" > _changes.txt
just output-current-changelog >> _changes.txt

- name: "Get information on the latest pre-release"
if: ${{ inputs.prerelease == true || inputs.prerelease == 'true' }}
id: last_release
Expand All @@ -77,9 +78,9 @@ jobs:
uses: softprops/action-gh-release@v2
with:
token: ${{ secrets.GITHUB_TOKEN }}
name: ${{ inputs.release_name }}
tag_name: ${{ inputs.tag_name }}
body_path: _changes.txt
name: ${{ steps.prepare_release_data.outputs.release_name }}
body: ${{ steps.prepare_release_data.outputs.changelog }}
draft: ${{ inputs.draft == true || inputs.draft == 'true' }}
prerelease: ${{ inputs.prerelease == true || inputs.prerelease == 'true' }}
fail_on_unmatched_files: true
Expand Down
17 changes: 11 additions & 6 deletions .github/workflows/pr_builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,20 @@ on:
- '!develop'

jobs:
package_multiplatform:
name: 'Create a test build'
uses: ./.github/workflows/job_build_game.yml
package_tr1_multiplatform:
name: Build TR1
uses: ./.github/workflows/job_build_tr1.yml
secrets: inherit

package_mac:
name: 'Create a test build (macOS)'
package_tr1_mac:
name: Build TR1
if: vars.MACOS_ENABLE == 'true'
uses: ./.github/workflows/job_build_game_macos.yml
uses: ./.github/workflows/job_build_tr1_macos.yml
with:
let_mac_fail: true
secrets: inherit

package_tr2_multiplatform:
name: Build TR2
uses: ./.github/workflows/job_build_tr2.yml
secrets: inherit
25 changes: 16 additions & 9 deletions .github/workflows/prerelease.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,31 +9,38 @@ on:
- develop

jobs:
package_multiplatform:
name: Build prerelease assets
package_tr1_multiplatform:
name: Build TR1
if: vars.PRERELEASE_ENABLE == 'true'
uses: ./.github/workflows/job_build_game.yml
uses: ./.github/workflows/job_build_tr1.yml
secrets: inherit

package_mac:
name: "Build prerelease assets (mac)"
package_tr1_mac:
name: Build TR1
if: |
vars.PRERELEASE_ENABLE == 'true' &&
vars.MACOS_ENABLE == 'true'
uses: ./.github/workflows/job_build_game_macos.yml
uses: ./.github/workflows/job_build_tr1_macos.yml
with:
let_mac_fail: true
secrets: inherit

package_tr2_multiplatform:
name: Build TR2
if: vars.PRERELEASE_ENABLE == 'true'
uses: ./.github/workflows/job_build_tr2.yml
secrets: inherit

publish_prerelease:
if: vars.PRERELEASE_ENABLE == 'true'
name: Create a prerelease
needs:
- package_multiplatform
- package_mac
- package_tr1_multiplatform
- package_tr1_mac
- package_tr2_multiplatform
with:
release_name: 'Development snapshot'
draft: false
prerelease: true
tag_name: 'latest'
changelog_game_version: 'all'
uses: ./.github/workflows/job_release.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Publish a new release
name: Publish a new TR1X release

permissions:
contents: write
Expand All @@ -7,7 +7,7 @@ on:
push:
branch: stable
tags:
- "v?[0-9]*"
- "tr1-*"

workflow_dispatch:
inputs:
Expand All @@ -21,11 +21,6 @@ on:
required: true
type: boolean
default: false
release_name:
description: "Release name"
required: true
type: string
default: "Release name"
tag_name:
description: "Tag name"
required: false
Expand All @@ -36,15 +31,15 @@ jobs:
package_multiplatform:
name: Build release assets
if: vars.RELEASE_ENABLE == 'true'
uses: ./.github/workflows/job_build_game.yml
uses: ./.github/workflows/job_build_tr1.yml
secrets: inherit

package_mac:
name: "Build release assets (mac)"
if: |
vars.RELEASE_ENABLE == 'true' &&
vars.MACOS_ENABLE == 'true'
uses: ./.github/workflows/job_build_game_macos.yml
uses: ./.github/workflows/job_build_tr1_macos.yml
with:
let_mac_fail: ${{ inputs.let_mac_fail == true || inputs.let_mac_fail == 'true' }}
secrets: inherit
Expand All @@ -56,8 +51,8 @@ jobs:
- package_multiplatform
- package_mac
with:
release_name: ${{ inputs.release_name }}
draft: ${{ inputs.draft || false }}
prerelease: ${{ inputs.draft || false }}
tag_name: ${{ inputs.tag_name || github.ref_name }}
changelog_game_version: 1
uses: ./.github/workflows/job_release.yml
47 changes: 47 additions & 0 deletions .github/workflows/release_tr2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Publish a new TR2X release

permissions:
contents: write

on:
push:
branch: stable
tags:
- "tr2-*"

workflow_dispatch:
inputs:
draft:
description: "Draft"
required: true
type: boolean
default: false
prerelease:
description: "Prerelease"
required: true
type: boolean
default: false
tag_name:
description: "Tag name"
required: false
type: string
default: github.ref_name

jobs:
package_multiplatform:
name: Build release assets
if: vars.RELEASE_ENABLE == 'true'
uses: ./.github/workflows/job_build_tr2.yml
secrets: inherit

publish_release:
if: vars.RELEASE_ENABLE == 'true'
name: Create a GitHub release
needs:
- package_multiplatform
with:
draft: ${{ inputs.draft || false }}
prerelease: ${{ inputs.draft || false }}
tag_name: ${{ inputs.tag_name || github.ref_name }}
changelog_game_version: 2
uses: ./.github/workflows/job_release.yml
Loading