Skip to content

Commit d37229d

Browse files
authored
Build and Run in CI
2 parents 9bdd05c + 2a7f5df commit d37229d

20 files changed

+382
-132
lines changed

.github/workflows/build.yml

Lines changed: 0 additions & 57 deletions
This file was deleted.

.github/workflows/ci.yml

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
name: Build Sentaur Survivors
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
workflow_dispatch: # e.g. to manually trigger on foreign PRs
9+
10+
jobs:
11+
cancel-previous-workflow:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- name: Cancel Previous Runs
15+
uses: styfle/cancel-workflow-action@b173b6ec0100793626c2d9e6b90435061f4fc3e5 # [email protected]
16+
with:
17+
access_token: ${{ github.token }}
18+
19+
build:
20+
name: Build for ${{ matrix.targetPlatform }}
21+
runs-on: ${{ matrix.os }}
22+
strategy:
23+
fail-fast: false
24+
matrix:
25+
include:
26+
- targetPlatform: StandaloneWindows64
27+
os: windows-latest
28+
- targetPlatform: Android
29+
os: ubuntu-latest
30+
31+
steps:
32+
- name: Free disk space # Android builds runs out of disk space otherwise
33+
if: matrix.os == 'ubuntu-latest'
34+
run: |
35+
sudo rm -rf /usr/share/dotnet
36+
sudo rm -rf /usr/local/lib/android
37+
sudo rm -rf /opt/ghc
38+
sudo rm -rf /opt/hostedtoolcache/CodeQL
39+
sudo docker image prune --all --force
40+
df -h
41+
42+
- name: Checkout repository
43+
uses: actions/checkout@v4
44+
with:
45+
fetch-depth: 0
46+
lfs: true
47+
48+
- name: Set Unity Version
49+
shell: bash
50+
run: |
51+
UNITY_VERSION=$(grep 'm_EditorVersion:' ProjectSettings/ProjectVersion.txt | awk '{print $2}')
52+
echo "UNITY_VERSION=$UNITY_VERSION" >> $GITHUB_ENV
53+
54+
- name: Cache Unity Library
55+
uses: actions/cache@v4
56+
with:
57+
path: Library
58+
key: Library-${{ matrix.targetPlatform }}-${{ hashFiles('Assets/**', 'Packages/**', 'ProjectSettings/**') }}
59+
restore-keys: |
60+
Library-${{ matrix.targetPlatform }}-
61+
Library-
62+
63+
- name: Cache Build Output
64+
uses: actions/cache@v4
65+
id: cache-build
66+
with:
67+
path: build
68+
key: Build-${{ matrix.targetPlatform }}-${{ hashFiles('Assets/**', 'Packages/**', 'ProjectSettings/**') }}
69+
restore-keys: |
70+
Build-${{ matrix.targetPlatform }}-
71+
72+
- run: echo "::add-mask::${{ secrets.LICENSE_SERVER_URL }}"
73+
74+
- uses: game-ci/unity-builder@v4
75+
if: steps.cache-build.outputs.cache-hit != 'true'
76+
with:
77+
unityVersion: ${{ env.UNITY_VERSION }}
78+
targetPlatform: ${{ matrix.targetPlatform }}
79+
unityLicensingServer: ${{ secrets.LICENSE_SERVER_URL }}
80+
buildName: SentaurSurvivors-${{ matrix.targetPlatform }}
81+
customParameters: -dsn ${{ secrets.DSN }} -auth_token ${{ secrets.AUTH_TOKEN }} # Arguments cannot be passed via ENV
82+
allowDirtyBuild: true
83+
84+
- name: Upload Build Artifact
85+
uses: actions/upload-artifact@v4
86+
if: always()
87+
with:
88+
name: SentaurSurvivors-${{ matrix.targetPlatform }}
89+
path: Build
90+
retention-days: 90
91+
92+
run-demo:
93+
name: Run Demo
94+
needs: [build]
95+
uses: ./.github/workflows/run-demo.yml
96+
secrets: inherit

.github/workflows/run-demo.yml

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: Run Demo Builds
2+
3+
on:
4+
schedule:
5+
- cron: '*/50 * * * *' # every 50 minutes
6+
workflow_call:
7+
workflow_dispatch:
8+
workflow_run:
9+
workflows: ["Build Sentaur Survivors"]
10+
types:
11+
- completed
12+
13+
jobs:
14+
run-windows:
15+
name: Run Windows Build
16+
runs-on: windows-latest
17+
18+
steps:
19+
- name: Download Build
20+
uses: actions/download-artifact@v4
21+
with:
22+
name: SentaurSurvivors-StandaloneWindows64
23+
path: ./Build
24+
github-token: ${{ secrets.GITHUB_TOKEN }}
25+
run-id: ${{ github.event_name == 'workflow_run' && github.event.workflow_run.id || github.run_id }}
26+
27+
- name: Run Build
28+
timeout-minutes: 10
29+
env:
30+
SENTRY_DSN: ${{ secrets.DSN }}
31+
run: |
32+
$exePath = Get-ChildItem -Path "./Build" -Filter "SentaurSurvivors-*.exe" -Recurse | Select-Object -First 1
33+
if ($exePath)
34+
{
35+
Write-Output "Found executable: $($exePath.FullName)"
36+
$startTime = Get-Date
37+
38+
Start-Process -FilePath $exePath -Wait -PassThru -NoNewWindow
39+
40+
$endTime = Get-Date
41+
$duration = $endTime - $startTime
42+
Write-Output "Game finished in $($duration.ToString('hh\:mm\:ss'))"
43+
44+
$logPath = "$env:USERPROFILE\AppData\LocalLow\Sentry\SentaurSurvivors\Player.log"
45+
if (Test-Path $logPath)
46+
{
47+
Write-Output "::group::Game Logs"
48+
Get-Content $logPath
49+
Write-Output "::endgroup::"
50+
}
51+
else
52+
{
53+
Write-Output "Unity log file not found at: $logPath"
54+
}
55+
56+
Write-Output "Run executed successfully"
57+
}
58+
else
59+
{
60+
Write-Error "No SentaurSurvivors executable found in build artifacts"
61+
exit 1
62+
}

.gitignore

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,4 @@ crashlytics-build.properties
8888
# But keep the demo packages themselves.
8989
!/Assets/Plugins/Sirenix/Demos/*.unitypackage
9090

91-
# Ignore Sentry CLI options
92-
/Assets/Plugins/Sentry/SentryCliOptions.*
93-
9491
/Assets/Plugins/GDK

.vscode/settings.json

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"**/*.user":true,
1313
"**/*.userprefs":true,
1414
"**/*.unityproj":true,
15-
"**/*.dll":true,
15+
"**/*.dll":false,
1616
"**/*.exe":true,
1717
"**/*.pdf":true,
1818
"**/*.mid":true,
@@ -37,7 +37,7 @@
3737
"**/*.MA":true,
3838
"**/*.obj":true,
3939
"**/*.OBJ":true,
40-
"**/*.asset":true,
40+
"**/*.asset":false,
4141
"**/*.cubemap":true,
4242
"**/*.flare":true,
4343
"**/*.mat":true,
@@ -58,5 +58,25 @@
5858
"Temp/":true
5959
},
6060
"omnisharp.enableRoslynAnalyzers": true,
61-
"dotnet.defaultSolution": "sentaur-survivors.sln"
61+
"dotnet.defaultSolution": "sentaur-survivors.sln",
62+
"workbench.colorCustomizations": {
63+
"activityBar.activeBackground": "#fa1b49",
64+
"activityBar.background": "#fa1b49",
65+
"activityBar.foreground": "#e7e7e7",
66+
"activityBar.inactiveForeground": "#e7e7e799",
67+
"activityBarBadge.background": "#155e02",
68+
"activityBarBadge.foreground": "#e7e7e7",
69+
"commandCenter.border": "#e7e7e799",
70+
"sash.hoverBorder": "#fa1b49",
71+
"statusBar.background": "#dd0531",
72+
"statusBar.foreground": "#e7e7e7",
73+
"statusBarItem.hoverBackground": "#fa1b49",
74+
"statusBarItem.remoteBackground": "#dd0531",
75+
"statusBarItem.remoteForeground": "#e7e7e7",
76+
"titleBar.activeBackground": "#dd0531",
77+
"titleBar.activeForeground": "#e7e7e7",
78+
"titleBar.inactiveBackground": "#dd053199",
79+
"titleBar.inactiveForeground": "#e7e7e799"
80+
},
81+
"peacock.color": "#dd0531"
6282
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
%YAML 1.1
2+
%TAG !u! tag:unity3d.com,2011:
3+
--- !u!114 &11400000
4+
MonoBehaviour:
5+
m_ObjectHideFlags: 0
6+
m_CorrespondingSourceObject: {fileID: 0}
7+
m_PrefabInstance: {fileID: 0}
8+
m_PrefabAsset: {fileID: 0}
9+
m_GameObject: {fileID: 0}
10+
m_Enabled: 1
11+
m_EditorHideFlags: 0
12+
m_Script: {fileID: 11500000, guid: 11edbeb61dea3472eb2b4d947008a3a6, type: 3}
13+
m_Name: SentryCliConfiguration
14+
m_EditorClassIdentifier:

Assets/Plugins/Sentry/SentryCliConfiguration.asset.meta

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
%YAML 1.1
2+
%TAG !u! tag:unity3d.com,2011:
3+
--- !u!114 &11400000
4+
MonoBehaviour:
5+
m_ObjectHideFlags: 0
6+
m_CorrespondingSourceObject: {fileID: 0}
7+
m_PrefabInstance: {fileID: 0}
8+
m_PrefabAsset: {fileID: 0}
9+
m_GameObject: {fileID: 0}
10+
m_Enabled: 1
11+
m_EditorHideFlags: 0
12+
m_Script: {fileID: 1079966944, guid: 43ec428a58422470fa764bdba9d9bc19, type: 3}
13+
m_Name: SentryCliOptions
14+
m_EditorClassIdentifier:
15+
<UploadSymbols>k__BackingField: 1
16+
<UploadDevelopmentSymbols>k__BackingField: 0
17+
<UploadSources>k__BackingField: 1
18+
<UrlOverride>k__BackingField:
19+
<Auth>k__BackingField:
20+
<Organization>k__BackingField: demo
21+
<Project>k__BackingField: unity
22+
<IgnoreCliErrors>k__BackingField: 0
23+
<CliOptionsConfiguration>k__BackingField: {fileID: 11400000, guid: f1bf305bff70d481482767f93449ff03, type: 2}

Assets/Plugins/Sentry/SentryCliOptions.asset.meta

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
%YAML 1.1
2+
%TAG !u! tag:unity3d.com,2011:
3+
--- !u!114 &11400000
4+
MonoBehaviour:
5+
m_ObjectHideFlags: 0
6+
m_CorrespondingSourceObject: {fileID: 0}
7+
m_PrefabInstance: {fileID: 0}
8+
m_PrefabAsset: {fileID: 0}
9+
m_GameObject: {fileID: 0}
10+
m_Enabled: 1
11+
m_EditorHideFlags: 0
12+
m_Script: {fileID: 11500000, guid: 9aa6d6e10678d4054849da657d4d417d, type: 3}
13+
m_Name: SentryOptionConfiguration
14+
m_EditorClassIdentifier:

0 commit comments

Comments
 (0)