Repository navigation
122 lines (103 loc) · 4.27 KB
/
Copy pathnightly.yml
File metadata and controls
122 lines (103 loc) · 4.27 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
name: Nightly (Experimental) Build
on:
schedule:
- cron: "0 3 * * *"
workflow_dispatch:
jobs:
build:
runs-on: windows-latest
steps:
- name: Checkout repository
uses: actions/checkout@v5
- name: Setup MSBuild
uses: microsoft/setup-msbuild@v3
- name: Run generate-nightly.bat to create solution
run: |
echo "Running generate-nightly.bat to produce consolation-client.sln..."
call generate-nightly.bat
shell: cmd
working-directory: ${{ github.workspace }}
- name: Verify consolation-client.sln exists
run: dir build
shell: pwsh
- name: Clean old d3d9.dll
run: |
$dllPath = "build/bin/Release/d3d9.dll"
if (Test-Path $dllPath) {
Write-Host "Removing old d3d9.dll..."
Remove-Item $dllPath -Force
} else {
Write-Host "No old DLL found, skipping."
}
shell: pwsh
- name: Build solution
run: msbuild build\consolation-client.sln `
/p:Configuration=Release `
/p:OutDir=bin/Release/ `
/p:DisableSpecificWarnings=4459 `
/p:TreatWarningsAsErrors=false
shell: pwsh
working-directory: ${{ github.workspace }}
- name: Package and verify nightly installation layout
run: ./tools/package-nightly.ps1
shell: pwsh
- name: Get short commit hash
id: shortsha
run: |
$short = $env:GITHUB_SHA.Substring(0,7)
"short_sha=$short" | Out-File -FilePath $env:GITHUB_OUTPUT -Encoding utf8
shell: pwsh
- name: Get build metadata
id: metadata
run: |
$utcNow = (Get-Date).ToUniversalTime()
$time = $utcNow.ToString("dd MMMM yyyy - HH:mm:ss 'UTC'")
$tag = "nightly-" + $utcNow.ToString("yyyyMMdd-HHmmss") + "-${{ steps.shortsha.outputs.short_sha }}"
"build_time=$time" | Out-File -FilePath $env:GITHUB_OUTPUT -Encoding utf8 -Append
"release_tag=$tag" | Out-File -FilePath $env:GITHUB_OUTPUT -Encoding utf8 -Append
shell: pwsh
- name: Cleanup old nightly releases (keep 10)
uses: actions/github-script@v8
with:
script: |
const releases = await github.rest.repos.listReleases({
owner: context.repo.owner,
repo: context.repo.repo,
});
const nightly = releases.data
.filter(r => r.prerelease && r.tag_name.startsWith("nightly-"))
.sort((a,b) => new Date(b.created_at) - new Date(a.created_at));
const toDelete = nightly.slice(10);
for (const rel of toDelete) {
console.log(`Deleting old nightly: ${rel.name}`);
await github.rest.repos.deleteRelease({
owner: context.repo.owner,
repo: context.repo.repo,
release_id: rel.id
});
await github.rest.git.deleteRef({
owner: context.repo.owner,
repo: context.repo.repo,
ref: `tags/${rel.tag_name}`
});
}
- name: Create/Update Nightly Release and upload zip
uses: softprops/action-gh-release@v3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.metadata.outputs.release_tag }}
name: Nightly Build ${{ steps.shortsha.outputs.short_sha }}
body: |
Nightly build from commit ${{ steps.shortsha.outputs.short_sha }} (${{ steps.metadata.outputs.build_time }})
Nightly builds are experimental and unstable. They may crash frequently or fail to run at all.
Use at your own risk. Support is limited and no support will be given for nightly builds.
Extract the archive into the patched English/French 1.1 game directory,
preserving folders, then use Launch Consolation.bat.
The DLL in optional/offline is NOT installed automatically: copy it to
the game root only for offline/debug use and follow README_XLIVE.txt.
Normal GFWL play uses the original runtime without -offline.
draft: false
prerelease: true
overwrite_files: true
files: consolation-nightly.zip