Skip to content

Commit

Permalink
Rework building process and use custom MUX
Browse files Browse the repository at this point in the history
  • Loading branch information
Guerra24 committed Nov 7, 2023
1 parent 7e2e8c0 commit 9c164af
Show file tree
Hide file tree
Showing 19 changed files with 2,852 additions and 140 deletions.
164 changes: 85 additions & 79 deletions .github/workflows/build-nightly.yml
Expand Up @@ -4,68 +4,79 @@ on:
branches:
- develop
jobs:
buildAvaloniaLinuxX64:
name: Build Avalonia Linux X64
runs-on: windows-2022
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Prepare Env
uses: microsoft/setup-msbuild@v1.3
- name: Build
env:
DOTNET_NOLOGO: true
run: |
dotnet publish LRReader.Avalonia.Desktop\LRReader.Avalonia.Desktop.csproj -nologo -v:minimal /p:Configuration=Release /p:PublishProfile=linux-x64
- name: Upload Artifacts
uses: actions/upload-artifact@v3
with:
name: LRReader.Avalonia.Desktop.Linux-X64
path: LRReader.Avalonia.Desktop/publish/linux-x64
buildAvaloniaMacOSX64:
name: Build Avalonia macOS X64
runs-on: windows-2022
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Prepare Env
uses: microsoft/setup-msbuild@v1.3
- name: Build
env:
DOTNET_NOLOGO: true
run: |
dotnet publish LRReader.Avalonia.Desktop\LRReader.Avalonia.Desktop.csproj -nologo -v:minimal /p:Configuration=Release /p:PublishProfile=macos-x64
- name: Upload Artifacts
uses: actions/upload-artifact@v3
with:
name: LRReader.Avalonia.Desktop.macOS-X64
path: LRReader.Avalonia.Desktop/publish/macos-x64
buildAvaloniaWinX64:
name: Build Avalonia Windows X64
runs-on: windows-2022
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Prepare Env
uses: microsoft/setup-msbuild@v1.3
- name: Build
env:
DOTNET_NOLOGO: true
run: |
dotnet publish LRReader.Avalonia.Desktop\LRReader.Avalonia.Desktop.csproj -nologo -v:minimal /p:Configuration=Release /p:PublishProfile=win-x64
- name: Upload Artifacts
uses: actions/upload-artifact@v3
with:
name: LRReader.Avalonia.Desktop.Win-X64
path: LRReader.Avalonia.Desktop/publish/win-x64
# buildAvaloniaLinuxX64:
# name: Build Avalonia Linux X64
# runs-on: windows-2022
# steps:
# - name: Checkout
# uses: actions/checkout@v3
# - name: Prepare Env
# uses: microsoft/setup-msbuild@v1.3
# - name: Build
# env:
# DOTNET_NOLOGO: true
# run: |
# dotnet publish LRReader.Avalonia.Desktop\LRReader.Avalonia.Desktop.csproj -nologo -v:minimal /p:Configuration=Release /p:PublishProfile=linux-x64
# - name: Upload Artifacts
# uses: actions/upload-artifact@v3
# with:
# name: LRReader.Avalonia.Desktop.Linux-X64
# path: LRReader.Avalonia.Desktop/publish/linux-x64
# buildAvaloniaMacOSX64:
# name: Build Avalonia macOS X64
# runs-on: windows-2022
# steps:
# - name: Checkout
# uses: actions/checkout@v3
# - name: Prepare Env
# uses: microsoft/setup-msbuild@v1.3
# - name: Build
# env:
# DOTNET_NOLOGO: true
# run: |
# dotnet publish LRReader.Avalonia.Desktop\LRReader.Avalonia.Desktop.csproj -nologo -v:minimal /p:Configuration=Release /p:PublishProfile=macos-x64
# - name: Upload Artifacts
# uses: actions/upload-artifact@v3
# with:
# name: LRReader.Avalonia.Desktop.macOS-X64
# path: LRReader.Avalonia.Desktop/publish/macos-x64
# buildAvaloniaWinX64:
# name: Build Avalonia Windows X64
# runs-on: windows-2022
# steps:
# - name: Checkout
# uses: actions/checkout@v3
# - name: Prepare Env
# uses: microsoft/setup-msbuild@v1.3
# - name: Build
# env:
# DOTNET_NOLOGO: true
# run: |
# dotnet publish LRReader.Avalonia.Desktop\LRReader.Avalonia.Desktop.csproj -nologo -v:minimal /p:Configuration=Release /p:PublishProfile=win-x64
# - name: Upload Artifacts
# uses: actions/upload-artifact@v3
# with:
# name: LRReader.Avalonia.Desktop.Win-X64
# path: LRReader.Avalonia.Desktop/publish/win-x64
buildUWP:
name: Build UWP
name: Sideload
runs-on: windows-2022
permissions:
packages: read
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Prepare Env
uses: microsoft/setup-msbuild@v1.3
- name: Auth nuget registry
run: dotnet nuget update source --username ${{ github.actor }} --password ${{ secrets.GITHUB_TOKEN }} --store-password-in-clear-text guerra24
- name: Prepare nuget cache
uses: actions/cache@v3
with:
path: ~/.nuget/packages
key: nuget-uwp-${{ hashFiles('LRReader.Shared/packages.lock.json', 'LRReader.UWP/packages.lock.json') }}
restore-keys: |
nuget-uwp-
- name: Build
env:
CERT_PASSWORD: ${{ secrets.CERT_PASSWORD }}
Expand All @@ -79,7 +90,7 @@ jobs:
& "C:\Program Files\Git\usr\bin\gpg.exe" --quiet --batch --yes --decrypt --passphrase="${env:CERT_GPG}" --output Cert.pfx Cert.pfx.gpg
Invoke-Expression "./Util/Version.ps1 ${env:BUILD_NUMBER}"
Invoke-Expression "./Util/ConfigureAppCenter.ps1"
MSBuild LRReader.UWP\LRReader.UWP.csproj -nologo -r -v:minimal /p:Nightly=true /p:Configuration=Release /p:UapAppxPackageBuildMode="SideloadOnly" /p:AppxPackageSigningEnabled=true /p:PackageCertificateThumbprint="" /p:PackageCertificateKeyFile="..\Cert.pfx" /p:PackageCertificatePassword="${env:CERT_PASSWORD}" /p:GenerateAppInstallerFile=True /p:AppInstallerUri="https://s3.guerra24.net/projects/lrr/nightly"
MSBuild LRReader.UWP\LRReader.UWP.csproj -nologo -r -v:minimal /p:RestoreLockedMode=true /p:Nightly=true /p:Configuration=Release /p:UapAppxPackageBuildMode="SideloadOnly" /p:AppxPackageSigningEnabled=true /p:PackageCertificateThumbprint="" /p:PackageCertificateKeyFile="..\Cert.pfx" /p:PackageCertificatePassword="${env:CERT_PASSWORD}" /p:GenerateAppInstallerFile=True /p:AppInstallerUri="https://s3.guerra24.net/projects/lrr/nightly"
Remove-Item -Path "./Cert.pfx.gpg","./Cert.pfx"
Invoke-Expression "./Util/CleanInstaller.ps1"
- name: Prepare for upload
Expand All @@ -103,44 +114,39 @@ jobs:
with:
name: LRReader.UWP
path: LRReader.UWP/AppPackages
buildInstallerX64:
name: Build Installer X64
buildInstaller:
name: Installer
runs-on: windows-2022
permissions:
packages: read
strategy:
matrix:
arch: [x64, ARM64]
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Prepare Env
uses: microsoft/setup-msbuild@v1.3
- name: Build
env:
APP_VERSION: Nightly
run: |
Invoke-Expression "./Util/ConfigureInstaller.ps1"
MSBuild LRReader.UWP.Installer\LRReader.UWP.Installer.csproj -nologo -r -v:minimal /p:Configuration=Release /p:Platform=x64
- name: Upload Artifacts
uses: actions/upload-artifact@v3
- name: Auth nuget registry
run: dotnet nuget update source --username ${{ github.actor }} --password ${{ secrets.GITHUB_TOKEN }} --store-password-in-clear-text guerra24
- name: Prepare nuget cache
uses: actions/cache@v3
with:
name: Installer-x64
path: LRReader.UWP.Installer/bin/x64/Release/net472/LRReader.UWP.Installer.exe
buildInstallerARM64:
name: Build Installer ARM64
runs-on: windows-2022
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Prepare Env
uses: microsoft/setup-msbuild@v1.3
path: ~/.nuget/packages
key: nuget-installer-${{ hashFiles('LRReader.UWP.Installer/packages.lock.json') }}
restore-keys: |
nuget-installer-
- name: Build
env:
APP_VERSION: Nightly
run: |
Invoke-Expression "./Util/ConfigureInstaller.ps1"
MSBuild LRReader.UWP.Installer\LRReader.UWP.Installer.csproj -nologo -r -v:minimal /p:Configuration=Release /p:Platform=ARM64
MSBuild LRReader.UWP.Installer\LRReader.UWP.Installer.csproj -nologo -r -v:minimal /p:RestoreLockedMode=true /p:Configuration=Release /p:Platform=${{ matrix.arch }}
- name: Upload Artifacts
uses: actions/upload-artifact@v3
with:
name: Installer-ARM64
path: LRReader.UWP.Installer/bin/ARM64/Release/net472/LRReader.UWP.Installer.exe
name: Installer-${{ matrix.arch }}
path: LRReader.UWP.Installer/bin/${{ matrix.arch }}/Release/net472/LRReader.UWP.Installer.exe
purgeUWPCache:
name: Purge UWP Nightly cache
needs: buildUWP
Expand Down
90 changes: 50 additions & 40 deletions .github/workflows/build-release.yml
Expand Up @@ -4,14 +4,25 @@ on:
types: [published]
jobs:
buildAppxBundle:
name: Build AppInstaller
name: Sideload
runs-on: windows-2022
permissions:
packages: read
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Prepare Env
uses: microsoft/setup-msbuild@v1.3
- name: Build AppInstaller
- name: Auth nuget registry
run: dotnet nuget update source --username ${{ github.actor }} --password ${{ secrets.GITHUB_TOKEN }} --store-password-in-clear-text guerra24
- name: Prepare nuget cache
uses: actions/cache@v3
with:
path: ~/.nuget/packages
key: nuget-uwp-${{ hashFiles('LRReader.Shared/packages.lock.json', 'LRReader.UWP/packages.lock.json') }}
restore-keys: |
nuget-uwp-
- name: Build
env:
CERT_PASSWORD: ${{ secrets.CERT_PASSWORD }}
CERT_GPG: ${{ secrets.CERT_GPG }}
Expand All @@ -24,7 +35,7 @@ jobs:
[IO.File]::WriteAllBytes("./Cert.pfx.gpg", [Convert]::FromBase64String("${env:CERT_BASE64}"))
& "C:\Program Files\Git\usr\bin\gpg.exe" --quiet --batch --yes --decrypt --passphrase="${env:CERT_GPG}" --output Cert.pfx Cert.pfx.gpg
Invoke-Expression "./Util/ConfigureAppCenter.ps1"
MSBuild LRReader.UWP\LRReader.UWP.csproj -nologo -r -v:minimal /p:Sideload=true /p:Configuration=Release /p:UapAppxPackageBuildMode="SideloadOnly" /p:AppxPackageSigningEnabled=true /p:PackageCertificateThumbprint="" /p:PackageCertificateKeyFile="..\Cert.pfx" /p:PackageCertificatePassword="${env:CERT_PASSWORD}" /p:GenerateAppInstallerFile=True /p:AppInstallerUri="https://s3.guerra24.net/projects/lrr/$($xmlDoc.Package.Identity.Version)"
MSBuild LRReader.UWP\LRReader.UWP.csproj -nologo -r -v:minimal /p:RestoreLockedMode=true /p:Sideload=true /p:Configuration=Release /p:UapAppxPackageBuildMode="SideloadOnly" /p:AppxPackageSigningEnabled=true /p:PackageCertificateThumbprint="" /p:PackageCertificateKeyFile="..\Cert.pfx" /p:PackageCertificatePassword="${env:CERT_PASSWORD}" /p:GenerateAppInstallerFile=True /p:AppInstallerUri="https://s3.guerra24.net/projects/lrr/$($xmlDoc.Package.Identity.Version)"
Remove-Item -Path "./Cert.pfx.gpg","./Cert.pfx"
Invoke-Expression "./Util/CleanInstaller.ps1"
- name: Prepare for upload
Expand Down Expand Up @@ -58,72 +69,71 @@ jobs:
name: LRReader.appinstaller
path: LRReader.UWP/AppPackages/LRReader.UWP.appinstaller
repo-token: ${{ secrets.GITHUB_TOKEN }}
buildInstallerX64:
name: Build Installer X64
buildInstaller:
name: Installer
runs-on: windows-2022
permissions:
packages: read
strategy:
matrix:
arch: [x64, ARM64]
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Prepare Env
uses: microsoft/setup-msbuild@v1.3
- name: Installer
run: |
[xml]$xmlDoc = Get-Content "./Util/Package.appxmanifest"
$env:APP_INSTALLER_URL="https://s3.guerra24.net/projects/lrr/$($xmlDoc.Package.Identity.Version)/LRReader.UWP.appinstaller"
$env:APP_VERSION="$($xmlDoc.Package.Identity.Version)"
Invoke-Expression "./Util/ConfigureInstaller.ps1"
MSBuild LRReader.UWP.Installer\LRReader.UWP.Installer.csproj -nologo -r -v:minimal /p:Configuration=Release /p:Platform=x64
- name: Upload Artifacts
uses: actions/upload-artifact@v3
with:
name: Installer-x64
path: LRReader.UWP.Installer/bin/x64/Release/net472/LRReader.UWP.Installer.exe
- name: Upload to Release
uses: Guerra24/upload-to-release@v1
- name: Auth nuget registry
run: dotnet nuget update source --username ${{ github.actor }} --password ${{ secrets.GITHUB_TOKEN }} --store-password-in-clear-text guerra24
- name: Prepare nuget cache
uses: actions/cache@v3
with:
name: LRReader.x64.exe
path: LRReader.UWP.Installer/bin/x64/Release/net472/LRReader.UWP.Installer.exe
repo-token: ${{ secrets.GITHUB_TOKEN }}
buildInstallerARM64:
name: Build Installer ARM64
runs-on: windows-2022
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Prepare Env
uses: microsoft/setup-msbuild@v1.3
- name: Installer
path: ~/.nuget/packages
key: nuget-installer-${{ hashFiles('LRReader.UWP.Installer/packages.lock.json') }}
restore-keys: |
nuget-installer-
- name: Build
run: |
[xml]$xmlDoc = Get-Content "./Util/Package.appxmanifest"
$env:APP_INSTALLER_URL="https://s3.guerra24.net/projects/lrr/$($xmlDoc.Package.Identity.Version)/LRReader.UWP.appinstaller"
$env:APP_VERSION="$($xmlDoc.Package.Identity.Version)"
Invoke-Expression "./Util/ConfigureInstaller.ps1"
MSBuild LRReader.UWP.Installer\LRReader.UWP.Installer.csproj -nologo -r -v:minimal /p:Configuration=Release /p:Platform=ARM64
MSBuild LRReader.UWP.Installer\LRReader.UWP.Installer.csproj -nologo -r -v:minimal /p:RestoreLockedMode=true /p:Configuration=Release /p:Platform=${{ matrix.arch }}
- name: Upload Artifacts
uses: actions/upload-artifact@v3
with:
name: Installer-ARM64
path: LRReader.UWP.Installer/bin/ARM64/Release/net472/LRReader.UWP.Installer.exe
name: Installer-${{ matrix.arch }}
path: LRReader.UWP.Installer/bin/${{ matrix.arch }}/Release/net472/LRReader.UWP.Installer.exe
- name: Upload to Release
uses: Guerra24/upload-to-release@v1
with:
name: LRReader.ARM64.exe
path: LRReader.UWP.Installer/bin/ARM64/Release/net472/LRReader.UWP.Installer.exe
name: LRReader.${{ matrix.arch }}.exe
path: LRReader.UWP.Installer/bin/${{ matrix.arch }}/Release/net472/LRReader.UWP.Installer.exe
repo-token: ${{ secrets.GITHUB_TOKEN }}
buildStoreBundle:
name: Build Store Bundle
name: Store
runs-on: windows-2022
permissions:
packages: read
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Prepare Env
uses: microsoft/setup-msbuild@v1.0.2
- name: Build AppInstaller
uses: microsoft/setup-msbuild@v1.3
- name: Auth nuget registry
run: dotnet nuget update source --username ${{ github.actor }} --password ${{ secrets.GITHUB_TOKEN }} --store-password-in-clear-text guerra24
- name: Prepare nuget cache
uses: actions/cache@v3
with:
path: ~/.nuget/packages
key: nuget-uwp-${{ hashFiles('LRReader.Shared/packages.lock.json', 'LRReader.UWP/packages.lock.json') }}
restore-keys: |
nuget-uwp-
- name: Build
env:
APPCENTER_APP_ID: ${{ secrets.APPCENTER_APP_ID }}
run: |
Invoke-Expression "./Util/ConfigureAppCenter.ps1"
MSBuild LRReader.UWP\LRReader.UWP.csproj -nologo -r -v:minimal /p:Configuration=Release /p:UapAppxPackageBuildMode="StoreOnly" /p:AppxPackageSigningEnabled=false
MSBuild LRReader.UWP\LRReader.UWP.csproj -nologo -r -v:minimal /p:RestoreLockedMode=true /p:Configuration=Release /p:UapAppxPackageBuildMode="StoreOnly" /p:AppxPackageSigningEnabled=false
- name: Upload Artifacts
uses: actions/upload-artifact@v3
with:
Expand Down
5 changes: 5 additions & 0 deletions LRReader.Shared/Directory.Build.targets
@@ -0,0 +1,5 @@
<Project>
<PropertyGroup>
<RestoreAdditionalProjectFallbackFolders></RestoreAdditionalProjectFallbackFolders>
</PropertyGroup>
</Project>
1 change: 1 addition & 0 deletions LRReader.Shared/LRReader.Shared.csproj
Expand Up @@ -4,6 +4,7 @@
<TargetFrameworks>netstandard2.1;uap10.0.17763</TargetFrameworks>
<Nullable>enable</Nullable>
<LangVersion>10.0</LangVersion>
<RestorePackagesWithLockFile>true</RestorePackagesWithLockFile>
<ExtrasUwpMetaPackageVersion>6.2.14</ExtrasUwpMetaPackageVersion>
<TargetPlatformVersion>10.0.22621.0</TargetPlatformVersion>
<TargetPlatformMinVersion>10.0.17763.0</TargetPlatformMinVersion>
Expand Down

0 comments on commit 9c164af

Please sign in to comment.