feat: include olm to Windows builds

Signed-off-by: TheOneWithTheBraid <the-one@with-the-braid.cf>
This commit is contained in:
TheOneWithTheBraid 2022-09-16 13:50:20 +02:00
parent f9e4b9356a
commit e368227780
6 changed files with 44 additions and 10 deletions

1
.gitignore vendored
View File

@ -62,3 +62,4 @@ ios/Podfile.lock
/linux/out
/macos/out
.vs
olm

View File

@ -124,16 +124,42 @@ build_web:
- docker
- famedly
# yes, we *do* build a Windows DLL on Linux. More reliable.
build_olm_windows:
image: archlinux:latest
stage: test
before_script:
- pacman-key --init
- pacman --noconfirm -Sy mingw-w64 cmake git base-devel
script:
- ./scripts/build-olm-windows.sh
- mv olm/build/libolm.dll .
artifacts:
paths:
- libolm.dll
only:
- main
- tags
build_windows:
extends:
- .shared_windows_runners
stage: build
before_script: [./scripts/prepare-windows.ps1]
script: [./scripts/build-windows.ps1]
stage: test
before_script:
- ./scripts/prepare-windows.ps1
# workarounding artifacts download being broken
- $response = Invoke-WebRequest -Uri "$CI_API_V4_URL/projects/$CI_PROJECT_ID/pipelines/$CI_PIPELINE_ID/jobs" -UseBasicParsing
- $jobs = $response | ConvertFrom-Json
- $job = $jobs | where { $_.name -eq "build_olm_windows" }
- $jobId = $job.id
- Invoke-WebRequest -Uri "$CI_API_V4_URL/projects/$CI_PROJECT_ID/jobs/$jobId/artifacts/libolm.dll" -UseBasicParsing -OutFile libolm.dll
script:
- ./scripts/build-windows.ps1
- Copy-Item -Path "libolm.dll" -Destination "build/windows/runner/Release"
- ./scripts/package-windows.ps1
artifacts:
paths:
- build/windows/runner/Release
allow_failure: true
only:
- main
- tags

7
scripts/build-olm-windows.sh Executable file
View File

@ -0,0 +1,7 @@
#!/usr/bin/env bash
git clone https://gitlab.matrix.org/matrix-org/olm.git -b 3.2.12
cd olm
cmake . -Bbuild -DCMAKE_TOOLCHAIN_FILE=Windows64.cmake
cmake --build build
cd ..

View File

@ -3,10 +3,5 @@ flutter config --enable-windows-desktop
flutter clean
flutter pub get
Write-Output "$WINDOWN_PFX"
Move-Item -Path $WINDOWS_PFX -Destination fluffychat.pem
certutil -decode fluffychat.pem fluffychat.pfx
flutter build windows --release -v
flutter pub run msix:create -c fluffychat.pfx -p $WINDOWS_PFX_PASS --sign-msix true --install-certificate false

View File

@ -0,0 +1,5 @@
Write-Output "$WINDOWN_PFX"
Move-Item -Path $WINDOWS_PFX -Destination fluffychat.pem
certutil -decode fluffychat.pem fluffychat.pfx
flutter pub run msix:create -c fluffychat.pfx -p $WINDOWS_PFX_PASS --sign-msix true --install-certificate false

View File

@ -1,4 +1,4 @@
choco install flutter -y
choco install flutter cmake --installargs 'ADD_CMAKE_TO_PATH=System' -y
Import-Module "$env:ChocolateyInstall\helpers\chocolateyProfile.psm1"
refreshenv