-
-
Notifications
You must be signed in to change notification settings - Fork 85
160 lines (137 loc) · 5.01 KB
/
build.yml
File metadata and controls
160 lines (137 loc) · 5.01 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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
# Credits to @Scighost from Starward for his contributions!
name: Build-Canary
#run-name: Canary Build for ${{ github.ref }}
on:
workflow_dispatch:
push:
branches:
- 'main'
paths-ignore:
- '**.md'
- 'Hi3Helper.Core/Lang/**.json'
- 'Docs/**'
- '**/packages.lock.json'
pull_request:
branches-ignore:
- 'stable'
- 'preview'
- 'translations_**'
paths-ignore:
- '**.md'
- 'Hi3Helper.Core/Lang/**.json'
- 'Docs/**'
- '**/packages.lock.json'
env:
NUGET_PACKAGES: ${{ github.workspace }}/.nuget/packages
jobs:
build:
runs-on: windows-2025-vs2026
strategy:
matrix:
configuration: [Debug] # No need to distribute Debug builds
platform: [x64]
framework: [net10.0-windows10.0.26100.0]
env:
Configuration: ${{ matrix.configuration }}
Platform: ${{ matrix.platform }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- name: 'Preparing Environment Variables'
if: ${{ github.event.pull_request.head.repo.full_name == github.event.pull_request.base.repo.full_name }}
run: |
$env = Get-Content env.json | ConvertFrom-Json
foreach ($prop in $env.PSObject.Properties) {
echo "$($prop.Name)=$($prop.Value)" >> $env:GITHUB_ENV
}
- name: Install .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
dotnet-quality: ${{ env.DOTNET_QUALITY }}
cache: true
cache-dependency-path: CollapseLauncher/packages.lock.json
- name: Update .NET workload
run: dotnet workload update
- name: Build
run: |
dotnet publish CollapseLauncher -c ${{matrix.Configuration}} -p:PublishProfile=Publish-DebugCIRelease -p:PublishDir=".\debug-build\" -p:PublishAot=false
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: collapse_${{ matrix.platform }}-${{ matrix.configuration }}_${{ matrix.framework }}_${{ github.sha }}
path: ./CollapseLauncher/debug-build/
compression-level: 9
- name: Validate build for Preview
run: |
dotnet build CollapseLauncher -c Release --verbosity quiet --no-restore
- name: Validate build for Stable
run: |
dotnet build CollapseLauncher -c Publish --verbosity quiet --no-restore
build-nativeaot:
runs-on: windows-2025-vs2026
strategy:
matrix:
configuration: [Debug]
platform: [x64]
framework: [net10.0-windows10.0.26100.0]
env:
Configuration: ${{ matrix.configuration }}
Platform: ${{ matrix.platform }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
submodules: recursive
- name: 'Preparing Environment Variables'
if: ${{ github.event.pull_request.head.repo.full_name == github.event.pull_request.base.repo.full_name }}
run: |
$env = Get-Content env.json | ConvertFrom-Json
foreach ($prop in $env.PSObject.Properties) {
echo "$($prop.Name)=$($prop.Value)" >> $env:GITHUB_ENV
}
- name: Install .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
dotnet-quality: ${{ env.DOTNET_QUALITY }}
cache: true
cache-dependency-path: CollapseLauncher/packages.lock.json
- name: Update .NET workload
run: dotnet workload update
- name: Build
run: |
dotnet publish CollapseLauncher -c ${{matrix.Configuration}} -p:PublishProfile=Publish-DebugCIReleaseAOT -p:PublishDir=".\debug-aot-build\" -p:PublishAotSelf=true
- name: Upload debug symbols
uses: actions/upload-artifact@v4
with:
name: aot-experimental-symbols_collapse_${{ matrix.platform }}-${{ matrix.configuration }}_${{ matrix.framework }}_${{ github.sha }}
path: ./CollapseLauncher/debug-aot-build/**/*.pdb
compression-level: 9
- name: Remove debug symbols
run: |
Remove-Item -Path "./CollapseLauncher/debug-aot-build/*.pdb" -Recurse -Force
- name: Upload Artifact
uses: actions/upload-artifact@v4
with:
name: aot-experimental_collapse_${{ matrix.platform }}-${{ matrix.configuration }}_${{ matrix.framework }}_${{ github.sha }}
path: ./CollapseLauncher/debug-aot-build/
compression-level: 9
notify-discord:
runs-on: ubuntu-latest
if: always()
needs: [build, build-nativeaot]
steps:
- name: Notify Discord
uses: sarisia/actions-status-discord@v1.15.1
if: always()
continue-on-error: true
with:
webhook: ${{ secrets.DISCORD_WEBHOOK_NIGHTLY }}
title: Collapse Launcher CI build is complete!
status: ${{ job.status }}
description: |
Commit `${{ github.sha }}` by ${{ github.actor }}
Click [here](https://nightly.link/CollapseLauncher/Collapse/actions/runs/${{ github.run_id }}) to download!