Skip to content

Build Windows

Build Windows #31

Workflow file for this run

name: Build Windows
on:
release:
types: [created]
jobs:
build:
runs-on: windows-latest
permissions:
packages: write
contents: read
env:
Solution_Name: OpenOTDR
CS_Project_Directory: OpenOTDR
CS_Project_Path: OpenOTDR\OpenOTDR.csproj
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install .NET Core
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- name: Set Version Variable
if: ${{ github.ref_type == 'tag' }}
env:
TAG: ${{ github.ref_name }}
run: echo "VERSION=${TAG#v}" >> $GITHUB_ENV
- name: Add msbuild to PATH
uses: microsoft/setup-msbuild@v2
with:
vs-version: '[17.10,)'
- name: Install MAUI workload
run: dotnet workload install maui
- name: Build the application
run: dotnet publish /p:Version=$VERSION /p:ApplicationDisplayVersion=$VERSION /p:ApplicationVersion=$VERSION -f net8.0-windows10.0.22621.0 -c Release -p:WindowsPackageType=None -p:PublishSingleFile=true -o ${{ env.CS_Project_Directory }}\AppPackages --self-contained
- name: Upload build artifacts
uses: actions/upload-artifact@v3
with:
name: OpenOTDR
path: ${{ env.CS_Project_Directory }}\AppPackages