Skip to content

Build

Build #27

Workflow file for this run

name: Build
on:
push:
branches: [ master ]
paths-ignore:
- '.github/**'
- '.editorconfig'
- '.gitattributes'
- '.gitignore'
- '.gitmodules'
- 'LICENSE.txt'
- 'README.md'
- 'README_EN.md'
- 'ShadowViewer.sln'
- 'vercel.json'
workflow_dispatch:
jobs:
build:
strategy:
matrix:
configuration: [Debug]
platform: [x64, x86, arm64]
runs-on: windows-latest
env:
Solution_Name: ShadowViewer
steps:
- uses: mickem/clean-after-action@v1
- name: Checkout
uses: actions/checkout@v2
with:
submodules: recursive
fetch-depth: 0
- uses: actions/cache@v4
with:
path: |
~/.nuget/packages
~/.dotnet
key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }}
restore-keys: |
${{ runner.os }}-nuget-
- name: Install .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: |
8.0.x
- name: Setup MSBuild.exe
uses: microsoft/setup-msbuild@v2
- name: Restore the application
run: msbuild $env:Solution_Name/$env:Solution_Name.csproj /t:Restore /p:Configuration=Debug
env:
Configuration: ${{ matrix.configuration }}
- name: Decode the pfx
run: |
$pfx_cert_byte = [System.Convert]::FromBase64String("${{ secrets.BASE64_ENCODED_PFX }}")
$certificatePath = "GitHubActionsWorkflow.pfx"
[IO.File]::WriteAllBytes("$certificatePath", $pfx_cert_byte)
- name: Create the app package
run: msbuild $env:Solution_Name/$env:Solution_Name.csproj /p:Configuration=$env:Configuration /p:Platform=$env:Platform /p:UapAppxPackageBuildMode=$env:Appx_Package_Build_Mode /p:AppxBundle=$env:Appx_Bundle /p:PackageCertificateKeyFile=../GitHubActionsWorkflow.pfx /p:AppxPackageDir="$env:Appx_Package_Dir" /p:GenerateAppxPackageOnBuild=true
env:
Appx_Bundle: Never
Appx_Package_Build_Mode: SideloadOnly
Appx_Package_Dir: ..\Packages\
Configuration: ${{ matrix.configuration }}
Platform: ${{ matrix.platform }}
- name: Get Version
run: |
[xml]$proj = Get-Content $env:Solution_Name/Package.appxmanifest
$v = $proj.Package.Identity.Version
echo "VERSION=$v" >> $env:GITHUB_ENV
- name: Remove the pfx
run: |
Remove-Item -path GitHubActionsWorkflow.pfx
- name: Upload MSIX package
uses: actions/upload-artifact@v4
with:
name: ${{ env.Solution_Name }}_${{ env.VERSION }}_${{ matrix.platform }}_${{ matrix.configuration }}
path: |
Packages/${{ env.Solution_Name }}*/*.*
Packages/${{ env.Solution_Name }}*/Add-AppDevPackage.resources
Packages/${{ env.Solution_Name }}*/Dependencies/${{ matrix.platform }}/*.*