-
-
Notifications
You must be signed in to change notification settings - Fork 54
202 lines (167 loc) · 6.84 KB
/
build-launcher.yml
File metadata and controls
202 lines (167 loc) · 6.84 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
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
name: Build Launcher
on:
workflow_dispatch: { }
push:
branches-ignore:
- 'dev/launcher'
- 'develop'
paths:
- '.github/workflows/build-launcher.yaml'
- 'Launcher/**/*'
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
build:
runs-on: windows-latest-l
env:
working-directory: ./Launcher
steps:
- name: Get branch names
id: branch-names
uses: tj-actions/branch-names@v8
- name: Enable long paths
run: git config --system core.longpaths true
- name: Check out code
uses: actions/checkout@v4
with:
token: ${{ secrets.GH_PAT }}
submodules: true
- name: Setup MSBuild
uses: microsoft/setup-msbuild@v2
- name: Setup MSVC dev cmd (x64)
uses: ilammy/msvc-dev-cmd@v1
with:
arch: amd64
- name: Cache Rust ${{ matrix.rust-version }}
uses: actions/cache@v3
with:
path: ${{ github.workspace }}\rust\.rustup
key: rust-${{ matrix.rust-version }}-${{ hashFiles('**/rust-toolchain') }}
- name: Setup Rust ${{ matrix.rust-version }}
uses: actions-rs/toolchain@v1
with:
toolchain: nightly
override: true
components: rustfmt, clippy
- uses: Swatinem/rust-cache@v2
with:
workspaces: "./Launcher/rust -> target"
shared-key: ${{ runner.os }}-rust-deps
cache-on-failure: true
- name: Setup NuGet and Download Packages
run: |
nuget sources add -name "nuget.org" -source "https://api.nuget.org/v3/index.json"
nuget install Microsoft.Web.WebView2
nuget install Microsoft.Windows.ImplementationLibrary
shell: powershell
- name: Install LLVM
shell: pwsh
run: |
choco install llvm -y
echo "C:\Program Files\LLVM\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
- name: Install VS Build Tools + ATL
shell: pwsh
run: |
choco install visualstudio2022buildtools -y --no-progress
choco install visualstudio2022-workload-vctools -y --no-progress
$vsInstaller = "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vs_installer.exe"
& $vsInstaller modify `
--installPath "${env:ProgramFiles(x86)}\Microsoft Visual Studio\2022\BuildTools" `
--add Microsoft.VisualStudio.Component.VC.ATL `
--add Microsoft.VisualStudio.Component.VC.ATLMFC `
--quiet --norestart --nocache
- name: Install Protoc
uses: arduino/setup-protoc@v3
with:
repo-token: ${{ secrets.GH_PAT }}
- name: Setup Flutter
uses: subosito/flutter-action@v2.12.0
with:
channel: 'master'
- name: Set up melos
run: flutter pub global activate melos 7.1.1
- name: Melos Bootstrap
run: melos bs
- name: Download 7za
run: |
New-Item -Path _work -ItemType Directory
Invoke-WebRequest https://s3.kyber.gg/artifacts/7za.exe -OutFile 7za.exe
working-directory: ./Launcher/installer
shell: powershell
- name: Download VC Redist
run: |
Invoke-WebRequest https://aka.ms/vs/17/release/vc_redist.x64.exe -OutFile vc_redist.x64.exe
working-directory: ./Launcher/installer
shell: powershell
- name: Generate FFI bindings
run: dart run tool/ffigen.dart
working-directory: ${{env.working-directory}}
- name: Build Flutter app
run: flutter build windows -v
working-directory: ${{env.working-directory}}
- name: Download Maxima
run: |
New-Item -Path _work -ItemType Directory
Invoke-WebRequest https://s3.kyber.gg/artifacts/maxima-win64.zip -OutFile maxima.zip
Expand-Archive maxima.zip -DestinationPath _work
dir _work
shell: powershell
- name: Copy native assets
working-directory: ${{ env.working-directory }}
run: |
Copy-Item 'build\native_assets\windows\*' `
-Destination 'build\windows\x64\runner\Release\' `
-Recurse
- name: Copy Maxima
run: |
cp "_work/maxima-service.exe" "Launcher/build/windows/x64/runner/Release/maxima-service.exe"
cp "_work/maxima-bootstrap.exe" "Launcher/build/windows/x64/runner/Release/maxima-bootstrap.exe"
- name: Download Vivox
working-directory: ${{env.working-directory}}
run: |
New-Item -Path _work -ItemType Directory
$ProgressPreference = 'SilentlyContinue'
Invoke-WebRequest https://s3.kyber.gg/artifacts/kyber-depends.zip -OutFile depends.zip
Expand-Archive depends.zip -DestinationPath _work
shell: powershell
- name: Copy Vivox
working-directory: ${{env.working-directory}}
run: |
cp "_work/vivoxsdk.dll" "build/windows/x64/runner/Release/vivoxsdk.dll"
- name: Generate Installer
uses: Minionguyjpro/Inno-Setup-Action@v1.2.7
with:
path: Launcher/installer/installer.iss
options: /O+
- name: Generate Version File
run: |
Install-Module -Name powershell-yaml -Force -RequiredVersion 0.4.2
Import-Module powershell-yaml
$content = Get-Content -Raw -Path "Launcher/pubspec.yaml"
$yaml = ConvertFrom-Yaml $content
$version = $yaml.version
Set-Content -Path "Launcher/version" -Value $version
shell: powershell
- name: Zip files
if: runner.os == 'Windows'
run: |
Compress-Archive -Path "Launcher/build/windows/x64/runner/Release/*" -DestinationPath kyber-launcher.zip
shell: powershell
- name: Zip installer
if: runner.os == 'Windows'
run: |
rm Launcher/installer/installer.iss
rm Launcher/installer/7za.exe
rm Launcher/installer/vc_redist.x64.exe
Compress-Archive -Path "Launcher/installer/*" -DestinationPath kyber-installer.zip
shell: powershell
- name: Upload artifacts
if: runner.os == 'Windows'
run: |
Invoke-WebRequest https://dl.min.io/client/mc/release/windows-amd64/mc.exe -OutFile C:\mc.exe
C:\mc.exe alias set kyber https://s3.kyber.gg ${{ secrets.AWS_KEY_ID }} ${{ secrets.AWS_SECRET_ACCESS_KEY }}
C:\mc.exe cp Launcher/version kyber/artifacts/launcher-versions/${{ steps.branch-names.outputs.current_branch }}/latest-version
C:\mc.exe cp kyber-launcher.zip kyber/releases/${{ steps.branch-names.outputs.current_branch }}/kyber-launcher-win64.zip
C:\mc.exe cp kyber-installer.zip kyber/releases/${{ steps.branch-names.outputs.current_branch }}/kyber-installer-win64.zip
shell: powershell