📦 Use custom build action #8
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: .NET Core Desktop | |
on: | |
push: | |
tags: | |
- '*' | |
jobs: | |
build: | |
strategy: | |
matrix: | |
configuration: [Release] | |
targetplatform: [x64] | |
defaults: | |
run: | |
working-directory: ./src | |
runs-on: windows-latest | |
env: | |
Solution_Path: Watermarker.sln | |
TargetApplication: Watermarker\Watermarker.csproj | |
InstallerApplication: Watermarker.Installer\Watermarker.Installer.csproj | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Use Nerdbank.GitVersioning to set version variables | |
uses: dotnet/nbgv@master | |
id: nbgv | |
# Install the .NET Core workload | |
- name: Install .NET Core | |
uses: actions/setup-dotnet@v3 | |
with: | |
dotnet-version: 6.0.x | |
# Add MSBuild to the PATH: https://github.com/microsoft/setup-msbuild | |
- name: Setup MSBuild.exe | |
uses: microsoft/[email protected] | |
# Update the version before build | |
#- name: Update manifest version | |
# run: | | |
# [xml]$manifest = get-content ".\$env:Wap_Project_Directory\Package.appxmanifest" | |
# $manifest.Package.Identity.Version = "${{ steps.nbgv.outputs.SimpleVersion }}.0" | |
# $manifest.save(".\$env:Wap_Project_Directory\Package.appxmanifest") | |
# Restore the application to populate the obj folder with RuntimeIdentifiers | |
- name: Restore the application | |
run: msbuild $env:Solution_Path /t:Restore /p:Configuration=$env:Configuration /p:RuntimeIdentifier=$env:RuntimeIdentifier | |
env: | |
Configuration: ${{ matrix.configuration }} | |
RuntimeIdentifier: win-${{ matrix.targetplatform }} | |
# Build main application | |
- name: Build the main application | |
run: msbuild $env:TargetApplication /p:Platform=$env:TargetPlatform /p:Configuration=$env:Configuration | |
env: | |
Configuration: Release | |
TargetPlatform: ${{ matrix.targetplatform }} | |
# Build installer | |
- name: Build installer | |
run: msbuild $env:InstallerApplication /p:Platform=$env:TargetPlatform /p:Configuration=$env:Configuration | |
env: | |
Configuration: Release | |
TargetPlatform: ${{ matrix.targetplatform }} | |
# Upload the MSIX package: https://github.com/marketplace/actions/upload-a-build-artifact | |
#- name: Upload build artifacts | |
# uses: actions/upload-artifact@v3 | |
# with: | |
# name: MSIX Package | |
# path: src\${{ env.Wap_Project_Directory }}\${{ env.App_Packages_Directory }} |