-
Notifications
You must be signed in to change notification settings - Fork 10
158 lines (154 loc) · 6.41 KB
/
dotnet.yml
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
name: .NET Build + Test + Publish
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
build:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Download config repo
uses: actions/checkout@v4
with:
repository: TheTrackerCouncil/SMZ3CasConfigs
path: configs
ref: main
- name: Download sprite repo
uses: actions/checkout@v4
with:
repository: TheTrackerCouncil/SMZ3CasSprites
path: sprites
ref: main
- name: Download tracker sprite repo
uses: actions/checkout@v4
with:
repository: TheTrackerCouncil/TrackerSprites
path: trackersprites
ref: main
- name: Download git trees
if: ${{ github.event_name != 'pull_request' }}
shell: pwsh
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
$headers = @{
Authorization="Bearer $Env:GH_TOKEN"
}
Invoke-RestMethod -Uri https://api.github.com/repos/TheTrackerCouncil/SMZ3CasSprites/git/trees/main?recursive=1 -OutFile sprites/Sprites/sprites.json -Headers $headers
Invoke-RestMethod -Uri https://api.github.com/repos/TheTrackerCouncil/TrackerSprites/git/trees/main?recursive=1 -OutFile trackersprites/tracker-sprites.json -Headers $headers
Remove-Item -LiteralPath "trackersprites/.git" -Force -Recurse
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build --no-restore -p:PostBuildEvent=
- name: Test
run: dotnet test --no-build --verbosity normal
- name: Publish Windows 64bit
if: ${{ github.event_name != 'pull_request' }}
run: dotnet publish --os win --arch x64 -c Release --self-contained false src/TrackerCouncil.Smz3.UI/TrackerCouncil.Smz3.UI.csproj
- name: Publish Windows 32bit
if: ${{ github.event_name != 'pull_request' }}
run: dotnet publish --os win --arch x86 -c Release --self-contained false src/TrackerCouncil.Smz3.UI/TrackerCouncil.Smz3.UI.csproj
- name: Get version number
if: ${{ github.event_name != 'pull_request' }}
id: version
run: |
$version = (Get-Item "src\TrackerCouncil.Smz3.UI\bin\Release\net8.0\win-x86\publish\SMZ3CasRandomizer.exe").VersionInfo.ProductVersion
$version = $version -replace "\+.*", ""
Write-Output "number=$version" >> $env:GITHUB_OUTPUT
shell: pwsh
- name: Publish Linux 64bit
if: ${{ github.event_name != 'pull_request' }}
run: dotnet publish --os linux --arch x64 -c Release --self-contained false src/TrackerCouncil.Smz3.UI/TrackerCouncil.Smz3.UI.csproj
- name: Publish Multiplayer Server
if: ${{ github.event_name != 'pull_request' }}
run: dotnet publish -c Release --self-contained false src//TrackerCouncil.Smz3.Multiplayer.Server//TrackerCouncil.Smz3.Multiplayer.Server.csproj
- name: Building the Windows installer
if: ${{ github.event_name != 'pull_request' }}
run: "\"%programfiles(x86)%/Inno Setup 6/iscc.exe\" \"setup/randomizer.app.iss\""
shell: cmd
- name: Building the Linux 64bit package
if: ${{ github.event_name != 'pull_request' }}
working-directory: setup
run: "./LinuxBuildZipper.ps1"
shell: pwsh
- name: Building the Multiplayer Server package
if: ${{ github.event_name != 'pull_request' }}
working-directory: setup
run: "./MultiplayerServerZipper.ps1"
shell: pwsh
- name: Upload artifact
uses: actions/upload-artifact@v4
if: ${{ github.event_name != 'pull_request' }}
with:
path: "setup/Output/*"
name: SMZ3CasRandomizer_${{ steps.version.outputs.number }}
build-mac:
runs-on: macos-latest
if: ${{ github.event_name != 'pull_request' }}
steps:
- uses: actions/checkout@v4
- name: Download config repo
uses: actions/checkout@v4
with:
repository: TheTrackerCouncil/SMZ3CasConfigs
path: configs
ref: main
- name: Download sprite repo
uses: actions/checkout@v4
with:
repository: TheTrackerCouncil/SMZ3CasSprites
path: sprites
ref: main
- name: Download tracker sprite repo
uses: actions/checkout@v4
with:
repository: TheTrackerCouncil/TrackerSprites
path: trackersprites
ref: main
- name: Download git trees
if: ${{ github.event_name != 'pull_request' }}
shell: pwsh
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
$headers = @{
Authorization="Bearer $Env:GH_TOKEN"
}
Invoke-RestMethod -Uri https://api.github.com/repos/TheTrackerCouncil/SMZ3CasSprites/git/trees/main?recursive=1 -OutFile sprites/Sprites/sprites.json -Headers $headers
Invoke-RestMethod -Uri https://api.github.com/repos/TheTrackerCouncil/TrackerSprites/git/trees/main?recursive=1 -OutFile trackersprites/tracker-sprites.json -Headers $headers
Remove-Item -LiteralPath "trackersprites/.git" -Force -Recurse
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- name: Restore dependencies
run: dotnet restore src/TrackerCouncil.Smz3.UI/TrackerCouncil.Smz3.UI.csproj
- name: Build
run: dotnet build --no-restore -p:PostBuildEvent= src/TrackerCouncil.Smz3.UI/TrackerCouncil.Smz3.UI.csproj
- name: Publish
run: dotnet publish -r osx-arm64 --configuration Release -p:UseAppHost=true src/TrackerCouncil.Smz3.UI/TrackerCouncil.Smz3.UI.csproj
- name: Get version number
id: version
run: |
$version = (Get-Item "src\TrackerCouncil.Smz3.UI\bin\Release\net8.0\osx-arm64\publish\SMZ3CasRandomizer.dll").VersionInfo.ProductVersion
$version = $version -replace "\+.*", ""
$versionShort = $version -replace "\-.*", ""
(Get-Content setup/Info.plist).Replace('%FULL_VERSION%', $version).Replace('%SHORT_VERSION%', $versionShort) | Set-Content setup/Info.plist
Write-Output "number=$version" >> $env:GITHUB_OUTPUT
shell: pwsh
- name: Prepare packaging script
run: |
chmod +x ./setup/package-macos-app.sh
./setup/package-macos-app.sh "${{ steps.version.outputs.number }}"
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
path: "setup/output/*"
name: SMZ3CasRandomizerMacOS_${{ steps.version.outputs.number }}