Skip to content

Build Launcher

Build Launcher #70

Workflow file for this run

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