Skip to content

Commit 6ab225e

Browse files
committed
2 parents 89ba997 + 57246f5 commit 6ab225e

File tree

2 files changed

+28
-6
lines changed

2 files changed

+28
-6
lines changed

.github/workflows/release.yml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ jobs:
1919
steps:
2020
- uses: actions/checkout@v4
2121
with:
22-
fetch-depth: 0
23-
lfs: true
22+
sparse-checkout: |
23+
ProjectSettings/ProjectVersion.txt
2424
2525
- name: Set unity version
2626
id: set_unity_version
@@ -76,7 +76,6 @@ jobs:
7676
steps:
7777
- uses: actions/checkout@v4
7878
with:
79-
fetch-depth: 0
8079
lfs: true
8180

8281
# Avoid running into space issues for github runners - Docker images can take up quite some space
@@ -166,9 +165,6 @@ jobs:
166165
if: ${{ github.repository_owner == 'JohannesDeml' }}
167166
runs-on: ubuntu-latest
168167
steps:
169-
- name: Checkout code
170-
uses: actions/checkout@v4
171-
172168
- uses: actions/download-artifact@v4
173169
with:
174170
name: ${{ needs.variables.outputs.BUILD_NAME }}

Assets/Scripts/Editor/BuildScript.cs

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -384,6 +384,32 @@ private static void ReportSummary(BuildSummary summary)
384384
{
385385
LogError(summaryText);
386386
}
387+
388+
// Archive the build report to metadata folder
389+
ArchiveBuildReport(summary.outputPath);
390+
}
391+
392+
private static void ArchiveBuildReport(string buildOutputPath)
393+
{
394+
try
395+
{
396+
string buildReportPath = "Library/LastBuild.buildreport";
397+
if (!File.Exists(buildReportPath))
398+
{
399+
LogWarning($"Build report not found at {buildReportPath}");
400+
return;
401+
}
402+
403+
string destinationFolder = Path.Combine(buildOutputPath, "metadata");
404+
Directory.CreateDirectory(destinationFolder);
405+
string destinationPath = Path.Combine(destinationFolder, "LastBuild.buildreport");
406+
File.Copy(buildReportPath, destinationPath, true);
407+
Log($"Build report archived to: {destinationPath}");
408+
}
409+
catch (Exception ex)
410+
{
411+
LogWarning($"Failed to archive build report: {ex.Message}");
412+
}
387413
}
388414

389415
private static void ExitWithResult(BuildResult result)

0 commit comments

Comments
 (0)