Skip to content

添加workflow

添加workflow #1

Workflow file for this run

name: WinUI3Utilities Build Pipeline
on:
push:
branches-ignore:
- 'dependabot**'
tags-ignore:
- '**'
pull_request:
paths-ignore:
- '**.md'
- '.builds/**'
- '.specs/**'
schedule:
- cron: '0 0 * * *'
defaults:
run:
shell: pwsh
jobs:
build:
runs-on: windows-latest
strategy:
fail-fast: true
matrix:
configuration: [Release]
platform: ['x64','x86','arm64']
env:
SOLUTION_NAME: 'WinUI3Utilities.sln'
PACKAGE_PROJECT_NAME: 'src/WinUI3Utilities.Samples/WinUI3Utilities.Samples.csproj'
PROJECT_RESTORE_PLATFORM: "x64"
CONFIGURATION: ${{ matrix.configuration }}
PLATFORM: ${{ matrix.platform }}
DEFAULT_DIR: ${{ github.workspace }} # Default: D:\a\WinUI3Utilities.Samples\WinUI3Utilities.Samples\
APPX_PACKAGE_DIR: ${{ github.workspace }}\AppxPackages
steps:
- name: Checkout the repository
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Setup MSBuild
id: setup_msbuild
uses: microsoft/setup-msbuild@v1
- name: Setup NuGet
id: setup-nuget
uses: NuGet/setup-nuget@v1.1.1
- name: Setup .NET 8
uses: actions/setup-dotnet@v3
with:
dotnet-version: '8.0.x'
- name: Restore Files
id: restore_project
shell: pwsh
run: |
msbuild $env:SOLUTION_NAME `
-t:Restore `
-p:Platform=$env:PROJECT_RESTORE_PLATFORM `
-p:Configuration=$env:CONFIGURATION `
-p:PublishReadyToRun=true `
- name: Restore NuGet
id: restore_nuget
shell: pwsh
run: 'nuget restore $env:SOLUTION_NAME'
- name: Build Files (Release)
id: build_app_with_release
shell: pwsh
run: |
msbuild $env:PACKAGE_PROJECT_NAME `
-t:Build `
-p:Platform=$env:PLATFORM `
-p:Configuration=$env:CONFIGURATION `
-p:AppxBundle=Never `