Skip to content

Build

Build #20

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:
install-dotnet:
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
- name: Install .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: |
8.0.x
- name: Setup MSBuild.exe
uses: microsoft/setup-msbuild@v2
- uses: actions/cache@v4
with:
path: ~/.nuget/packages
key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }}
restore-keys: |
${{ runner.os }}-nuget-
- name: Restore the application
run: msbuild $env:Solution_Name/$env:Solution_Name.csproj /t:Restore /p:Configuration=Debug
env:
Configuration: ${{ matrix.configuration }}
build:
needs: install-dotnet
strategy:
matrix:
configuration: [Debug]
platform: [x64,x86,ARM64]
runs-on: windows-latest
env:
Solution_Name: ShadowViewer
steps:
- 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: Remove the pfx
run: |
ls
- 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: Remove the pfx
run: |
Remove-Item -path GitHubActionsWorkflow.pfx
ls
- name: Upload MSIX package
uses: actions/upload-artifact@v4
with:
name: ${{ env.Solution_Name }}_${{ matrix.platform }}_${{ matrix.configuration }}
path: Packages