Skip to content

test

test #20

Workflow file for this run

name: MSBuild
on:
push:
branches:
- dev/pipeline
jobs:
build:
runs-on: windows-latest
strategy:
matrix:
configuration: [Release]
platform: [x64]
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Get .NET versions
run: |
$csprojFiles = Get-ChildItem -Path './*.csproj', '**/*.csproj'
$versions = @()
foreach ($file in $csprojFiles) {
[xml]$csproj = Get-Content -Path $file.FullName
$framework = $csproj.Project.PropertyGroup.TargetFramework
Write-Host "$($file.FullName): $framework"
$versions += $framework -replace '(^\D+)|(-.*)', ''
Write-Host $versions
}
$versionsString = $versions -join ','
echo "VERSIONS=$versionsString" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append
- name: Define .NET versions
id: define-versions
run: |
$versions = @("3.1.x", "5.0.x")
$versionsString = $versions -join ","
echo "::set-output name=dotnet-versions::$versionsString"
shell: pwsh
- name: Setup dotnet
uses: actions/setup-dotnet@v4
with:
dotnet-version: ${{ steps.define-versions.outputs.dotnet-versions }}
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: |
${{ env.VERSIONS }}
- name: Setup MSBuild
uses: microsoft/setup-msbuild@v1
- name: Restore NuGet packages
run: msbuild -t:Restore -p:Configuration=${{ matrix.configuration }}
- name: Build solution
run: msbuild -p:Configuration=${{ matrix.configuration }} -p:Platform=${{ matrix.platform }}
- name: Create MSIX package
run: msbuild -t:Pack -p:Configuration=${{ matrix.configuration }} -p:Platform=${{ matrix.platform }} -p:GenerateAppxPackageOnBuild=true
- name: Upload MSIX package
uses: actions/upload-artifact@v2
with:
name: msix-package
path: '**/*.msix'