Skip to content

Merge pull request #79 from LuxoriaSoft/develop #9

Merge pull request #79 from LuxoriaSoft/develop

Merge pull request #79 from LuxoriaSoft/develop #9

Workflow file for this run

name: Release
on:
push:
branches:
- main
- release/*
jobs:
build:
runs-on: windows-latest
strategy:
matrix:
configuration: [Release]
platform: [x64]
env:
Solution_Name: Luxoria.App.sln
steps:
# Checkout the code from the repository
- name: Checkout code
uses: actions/checkout@v3
# Set up .NET SDK
- name: Setup .NET SDK
uses: actions/setup-dotnet@v3
with:
dotnet-version: '9.x' # Specify the .NET SDK version you are using
# Add MSBuild to the PATH: https://github.com/microsoft/setup-msbuild
- name: Setup MSBuild.exe
uses: microsoft/[email protected]
# Restore the application to populate the obj folder with RuntimeIdentifiers
- name: Restore the application
run: msbuild $env:Solution_Name /t:Restore /p:Configuration=$env:Configuration
env:
Configuration: ${{ matrix.configuration }}
working-directory: ./Luxoria.App
# Decode the base 64 encoded pfx and save the Signing_Certificate
- 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)
working-directory: ./Luxoria.App
# Create the app package by building and packaging the project
- name: Create the app package
run: msbuild $env:Solution_Name /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 }}
working-directory: ./Luxoria.App
- name: Zip the published app
run: Compress-Archive -Path ./Luxoria.App/Luxoria.App/Packages -DestinationPath ./Luxoria.App.${{matrix.platform}}.zip
shell: pwsh
# Upload the published app
- name: Upload app
uses: actions/upload-artifact@v4
with:
name: Luxoria.App.${{matrix.platform}}
path: ./Luxoria.App.${{matrix.platform}}.zip
retention-days: 1