Skip to content

Release

Release #35

Workflow file for this run

name: Release
on:
workflow_dispatch:
inputs:
build_linux:
description: "Build Linux"
type: boolean
default: true
build_windows:
description: "Build Windows"
type: boolean
default: true
build_macos:
description: "Build macOS"
type: boolean
default: true
build_android:
description: "Build Android"
type: boolean
default: true
build_ios:
description: "Build iOS"
type: boolean
default: true
build_asset_bundles:
description: "Build asset bundles"
type: boolean
default: true
deploy:
description: "Deploy after build"
type: boolean
default: true
jobs:
patch:
uses: ./.github/workflows/reusable-patch.yml
with:
upload_project: true
secrets:
UNITY_SERIAL: ${{ secrets.UNITY_SERIAL }}
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
build-linux:
name: Build Linux
if: ${{ inputs.build_linux }}
needs: patch
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Download patched project
uses: actions/download-artifact@v8
with:
name: patched-project
path: RippedProject
- name: Restore NuGet packages
run: |
dotnet tool install --global NuGetForUnity.Cli
nugetforunity restore RippedProject
- name: Free disk space
uses: jlumbroso/free-disk-space@v1.3.1
- name: Build game
uses: game-ci/unity-builder@v4
env:
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
with:
projectPath: RippedProject
targetPlatform: StandaloneLinux64
buildName: Frontline
versioning: None
- name: Make asset bundles directory
if: ${{ inputs.build_asset_bundles }}
shell: bash
run: mkdir -p ${{ github.workspace }}/AssetBundles/StandaloneLinux64
- name: Build asset bundles
if: ${{ inputs.build_asset_bundles }}
uses: game-ci/unity-builder@v4
env:
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
with:
projectPath: RippedProject
targetPlatform: StandaloneLinux64
buildMethod: AssetTools.BuildAssetBundlesCi
customParameters: >
-assetbundlePath /github/workspace/AssetBundles/StandaloneLinux64
versioning: None
allowDirtyBuild: true
- name: Build AppImage
run: |
wget https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage -O appimagetool.AppImage
chmod +x appimagetool.AppImage
cp -r build/StandaloneLinux64/* Platforms/AppImage/
rm -rf Platforms/AppImage/Frontline_BackUpThisFolder_ButDontShipItWithYourGame
cp RippedProject/Assets/Texture2D/app_icon.png Platforms/AppImage/
./appimagetool.AppImage Platforms/AppImage Frontline.AppImage
env:
APPIMAGE_EXTRACT_AND_RUN: 1
- name: Upload artifact
uses: actions/upload-artifact@v7
with:
name: Frontline.AppImage
path: Frontline.AppImage
- name: Upload asset bundles
if: ${{ inputs.build_asset_bundles }}
uses: actions/upload-artifact@v7
with:
name: AssetBundles-Linux
path: ${{ github.workspace }}/AssetBundles/StandaloneLinux64
build-windows:
name: Build Windows
if: ${{ inputs.build_windows }}
needs: patch
runs-on: windows-latest
steps:
- name: Checkout code
uses: actions/checkout@v6
- name: Download patched project
uses: actions/download-artifact@v8
with:
name: patched-project
path: RippedProject
- name: Restore NuGet packages
run: |
dotnet tool install --global NuGetForUnity.Cli
nugetforunity restore RippedProject
- name: Build game
uses: game-ci/unity-builder@v4
env:
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
with:
projectPath: RippedProject
targetPlatform: StandaloneWindows64
buildName: Frontline
versioning: None
- name: Make asset bundles directory
if: ${{ inputs.build_asset_bundles }}
shell: bash
run: mkdir -p RippedProject/AssetBundles/StandaloneWindows64
- name: Build asset bundles
if: ${{ inputs.build_asset_bundles }}
uses: game-ci/unity-builder@v4
env:
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
with:
projectPath: RippedProject
targetPlatform: StandaloneWindows64
buildMethod: AssetTools.BuildAssetBundlesCi
customParameters: >
-assetbundlePath AssetBundles/StandaloneWindows64
versioning: None
allowDirtyBuild: true
- name: Install NSIS
uses: repolevedavaj/install-nsis@v1.1.0
with:
nsis-version: 3.11
- name: Create installer
shell: pwsh
run: |
Remove-Item -Path "build/StandaloneWindows64/Frontline_BackUpThisFolder_ButDontShipItWithYourGame" -Recurse -Force
$buildPath = "${{ github.workspace }}/build/StandaloneWindows64"
$scriptPath = "${{ github.workspace }}/Platforms/Windows/Installer.nsi"
makensis /DSOURCE_PATH="$buildPath" "$scriptPath"
- name: Upload artifact
uses: actions/upload-artifact@v7
with:
name: Frontline-Setup.exe
path: Platforms/Windows/Frontline-Setup.exe
- name: Upload asset bundles
if: ${{ inputs.build_asset_bundles }}
uses: actions/upload-artifact@v7
with:
name: AssetBundles-Windows
path: RippedProject/AssetBundles/StandaloneWindows64
build-macos:
name: Build macOS
if: ${{ inputs.build_macos }}
needs: patch
runs-on: macos-latest
steps:
- name: Download patched project
uses: actions/download-artifact@v8
with:
name: patched-project
path: RippedProject
- name: Setup .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: 10.x
- name: Restore NuGet packages
run: |
dotnet tool install --global NuGetForUnity.Cli
nugetforunity restore RippedProject
- name: Build game
uses: game-ci/unity-builder@v4
env:
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
with:
projectPath: RippedProject
targetPlatform: StandaloneOSX
buildName: Frontline
versioning: None
- name: Create DMG
run: |
npm install --global create-dmg
create-dmg build/StandaloneOSX/Frontline.app \
build/StandaloneOSX/ \
--no-version-in-filename \
--no-code-sign \
--dmg-title=Frontline
- name: Upload artifact
uses: actions/upload-artifact@v7
with:
name: Frontline.dmg
path: build/StandaloneOSX/Frontline.dmg
build-macos-bundles:
name: Build macOS asset bundles
if: ${{ inputs.build_macos && inputs.build_asset_bundles }}
needs: patch
runs-on: macos-latest
steps:
- name: Download patched project
uses: actions/download-artifact@v8
with:
name: patched-project
path: RippedProject
- name: Setup .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: 10.x
- name: Restore NuGet packages
run: |
dotnet tool install --global NuGetForUnity.Cli
nugetforunity restore RippedProject
- name: Make asset bundles directory
if: ${{ inputs.build_asset_bundles }}
shell: bash
run: mkdir -p ${{ github.workspace }}/AssetBundles/StandaloneOSX
- name: Build asset bundles
if: ${{ inputs.build_asset_bundles }}
uses: game-ci/unity-builder@v4
env:
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
with:
projectPath: RippedProject
targetPlatform: StandaloneOSX
buildMethod: AssetTools.BuildAssetBundlesCi
customParameters: >
-assetbundlePath ${{ github.workspace }}/AssetBundles/StandaloneOSX
versioning: None
allowDirtyBuild: true
- name: Upload asset bundles
if: ${{ inputs.build_asset_bundles }}
uses: actions/upload-artifact@v7
with:
name: AssetBundles-macOS
path: ${{ github.workspace }}/AssetBundles/StandaloneOSX
build-android:
name: Build Android
if: ${{ inputs.build_android }}
needs: patch
runs-on: ubuntu-latest
steps:
- name: Download patched project
uses: actions/download-artifact@v8
with:
name: patched-project
path: RippedProject
- name: Restore NuGet packages
run: |
dotnet tool install --global NuGetForUnity.Cli
nugetforunity restore RippedProject
- name: Free disk space
uses: jlumbroso/free-disk-space@v1.3.1
- name: Build game
uses: game-ci/unity-builder@v4
env:
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
with:
projectPath: RippedProject
targetPlatform: Android
buildName: Frontline
versioning: None
androidExportType: androidPackage
androidKeystoreName: tfreclaimed.keystore
androidKeystoreBase64: ${{ secrets.ANDROID_KEYSTORE_BASE64 }}
androidKeystorePass: ${{ secrets.ANDROID_KEYSTORE_PASSWORD }}
androidKeyaliasName: tfreclaimed
androidKeyaliasPass: ${{ secrets.ANDROID_KEYSTORE_PASSWORD }}
- name: Make asset bundles directory
if: ${{ inputs.build_asset_bundles }}
shell: bash
run: mkdir -p ${{ github.workspace }}/AssetBundles/Android
- name: Build asset bundles
if: ${{ inputs.build_asset_bundles }}
uses: game-ci/unity-builder@v4
env:
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
with:
projectPath: RippedProject
targetPlatform: Android
buildMethod: AssetTools.BuildAssetBundlesCi
customParameters: >
-assetbundlePath /github/workspace/AssetBundles/Android
versioning: None
allowDirtyBuild: true
- name: Upload artifact
uses: actions/upload-artifact@v7
with:
name: Frontline.apk
path: build/Android/Frontline.apk
- name: Upload asset bundles
if: ${{ inputs.build_asset_bundles }}
uses: actions/upload-artifact@v7
with:
name: AssetBundles-Android
path: ${{ github.workspace }}/AssetBundles/Android
build-ios:
name: Build iOS
if: ${{ inputs.build_ios }}
needs: patch
runs-on: macos-latest
steps:
- name: Download patched project
uses: actions/download-artifact@v8
with:
name: patched-project
path: RippedProject
- name: Setup .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: 10.x
- name: Restore NuGet packages
run: |
dotnet tool install --global NuGetForUnity.Cli
nugetforunity restore RippedProject
- name: Build game
uses: game-ci/unity-builder@v4
env:
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
with:
projectPath: RippedProject
targetPlatform: iOS
buildName: Frontline
versioning: None
- name: Build Xcode archive
run: |
cd build/iOS/Frontline
xcodebuild -project Unity-iPhone.xcodeproj \
-scheme Unity-iPhone \
-configuration Release \
-archivePath Frontline.xcarchive \
CODE_SIGNING_ALLOWED=NO \
CODE_SIGNING_REQUIRED=NO \
CODE_SIGN_IDENTITY="" \
clean archive
- name: Package IPA
run: |
cd build/iOS/Frontline
mkdir Payload
cp -r Frontline.xcarchive/Products/Applications/*.app Payload/
zip -r Frontline.ipa Payload
- name: Upload artifact
uses: actions/upload-artifact@v7
with:
name: Frontline.ipa
path: build/iOS/Frontline/Frontline.ipa
build-ios-bundles:
name: Build iOS asset bundles
if: ${{ inputs.build_ios && inputs.build_asset_bundles }}
needs: patch
runs-on: macos-latest
steps:
- name: Download patched project
uses: actions/download-artifact@v8
with:
name: patched-project
path: RippedProject
- name: Setup .NET
uses: actions/setup-dotnet@v5
with:
dotnet-version: 10.x
- name: Restore NuGet packages
run: |
dotnet tool install --global NuGetForUnity.Cli
nugetforunity restore RippedProject
- name: Make asset bundles directory
if: ${{ inputs.build_asset_bundles }}
shell: bash
run: mkdir -p ${{ github.workspace }}/AssetBundles/iOS
- name: Build asset bundles
if: ${{ inputs.build_asset_bundles }}
uses: game-ci/unity-builder@v4
env:
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
with:
projectPath: RippedProject
targetPlatform: iOS
buildMethod: AssetTools.BuildAssetBundlesCi
customParameters: >
-assetbundlePath ${{ github.workspace }}/AssetBundles/iOS
versioning: None
allowDirtyBuild: true
- name: Upload asset bundles
if: ${{ inputs.build_asset_bundles }}
uses: actions/upload-artifact@v7
with:
name: AssetBundles-iOS
path: ${{ github.workspace }}/AssetBundles/iOS
deploy:
name: Deploy
if: ${{ inputs.deploy && always() }}
needs: [build-linux, build-windows, build-macos, build-android, build-ios, build-macos-bundles, build-ios-bundles]
runs-on: ubuntu-latest
steps:
- name: Check build status
run: |
if [[ "${{ contains(needs.*.result, 'failure') }}" == "true" ]]; then
echo "One or more builds failed. Skipping deployment."
exit 1
fi
- name: Download build artifacts
uses: actions/download-artifact@v8
with:
path: build-artifacts
- name: Organize artifacts
run: |
mkdir -p deploy/Android deploy/iOS deploy/Linux deploy/Windows deploy/Mac
[ -d "build-artifacts/AssetBundles-Android" ] && mv build-artifacts/AssetBundles-Android/* deploy/Android/
[ -d "build-artifacts/AssetBundles-iOS" ] && mv build-artifacts/AssetBundles-iOS/* deploy/iOS/
[ -d "build-artifacts/AssetBundles-Linux" ] && mv build-artifacts/AssetBundles-Linux/* deploy/Linux/
[ -d "build-artifacts/AssetBundles-Windows" ] && mv build-artifacts/AssetBundles-Windows/* deploy/Windows/
[ -d "build-artifacts/AssetBundles-macOS" ] && mv build-artifacts/AssetBundles-macOS/* deploy/Mac/
[ -f "build-artifacts/Frontline.apk/Frontline.apk" ] && mv build-artifacts/Frontline.apk/Frontline.apk deploy/
[ -f "build-artifacts/Frontline.ipa/Frontline.ipa" ] && mv build-artifacts/Frontline.ipa/Frontline.ipa deploy/
[ -f "build-artifacts/Frontline.AppImage/Frontline.AppImage" ] && mv build-artifacts/Frontline.AppImage/Frontline.AppImage deploy/
[ -f "build-artifacts/Frontline-Setup.exe/Frontline-Setup.exe" ] && mv build-artifacts/Frontline-Setup.exe/Frontline-Setup.exe deploy/
[ -f "build-artifacts/Frontline.dmg/Frontline.dmg" ] && mv build-artifacts/Frontline.dmg/Frontline.dmg deploy/
rm -rf build-artifacts/patched-project
- name: Install Rclone
run: |
sudo apt-get install rclone
- name: Configure Rclone
run: |
rclone config create r2 s3 \
provider Cloudflare \
access_key_id ${{ secrets.R2_ACCESS_KEY }} \
secret_access_key ${{ secrets.R2_SECRET_KEY }} \
endpoint ${{ secrets.R2_ENDPOINT }} \
acl private
- name: Upload artifacts to R2
run: |
rclone sync deploy/ r2:frontline --progress