-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
125 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,125 @@ | ||
# Copyright (c) 2024 0x5BFA | ||
# Licensed under the MIT License. See the LICENSE. | ||
|
||
name: FluentRegEdit CI | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
paths-ignore: | ||
- 'assets/**' | ||
- 'builds/**' | ||
- 'docs/**' | ||
- '*.md' | ||
pull_request: | ||
paths-ignore: | ||
- 'assets/**' | ||
- 'builds/**' | ||
- 'docs/**' | ||
- '*.md' | ||
|
||
run-name: ${{ github.event_name == 'pull_request' && 'FluentRegEdit PR Validation' || 'FluentRegEdit CI Validation' }} | ||
|
||
env: | ||
WORKING_DIR: '${{ github.workspace }}' # Default: 'D:\a\FluentRegEdit\FluentRegEdit' | ||
SOLUTION_PATH: '${{ github.workspace }}\RegistryValley.sln' | ||
PACKAGE_PROJECT_DIR: '${{ github.workspace }}\src\RegistryValley.Package' | ||
PACKAGE_PROJECT_PATH: '${{ github.workspace }}\src\RegistryValley.Package\RegistryValley.Package.wapproj' | ||
ARTIFACTS_STAGING_DIR: '${{ github.workspace }}\artifacts' | ||
APPX_PACKAGE_DIR: '${{ github.workspace }}\artifacts\AppxPackages' | ||
|
||
jobs: | ||
|
||
check-formatting: | ||
|
||
if: github.repository_owner == '0x5bfa' | ||
|
||
runs-on: ubuntu-latest | ||
defaults: | ||
run: | ||
shell: pwsh | ||
|
||
steps: | ||
|
||
- name: Checkout the repository | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 2 | ||
|
||
- name: Install XamlStyler console | ||
run: 'dotnet tool install --global XamlStyler.Console' | ||
|
||
- name: Check XAML formatting | ||
id: check-step | ||
run: | | ||
$changedFiles = (git diff --diff-filter=d --name-only HEAD~1) -split "\n" | Where-Object {$_ -like "*.xaml"} | ||
foreach ($file in $changedFiles) | ||
{ | ||
xstyler -p -l None -f $file | ||
if ($LASTEXITCODE -ne 0) | ||
{ | ||
echo "::error file=$file::Format check failed" | ||
} | ||
} | ||
continue-on-error: true | ||
|
||
- name: Fail if necessary | ||
if: steps.check-step.outcome == 'failure' | ||
run: exit 1 | ||
|
||
build: | ||
|
||
if: github.repository_owner == '0x5bfa' | ||
|
||
runs-on: windows-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
configuration: [Debug, Release] | ||
platform: [x64, arm64] | ||
env: | ||
CONFIGURATION: ${{ matrix.configuration }} | ||
ARCHITECTURE: ${{ matrix.platform }} | ||
|
||
steps: | ||
|
||
- name: Checkout the repository | ||
uses: actions/checkout@v4 | ||
- name: Setup MSBuild | ||
uses: microsoft/setup-msbuild@v2 | ||
- name: Setup NuGet | ||
uses: NuGet/setup-nuget@v2 | ||
- name: Setup .NET 8 | ||
uses: actions/setup-dotnet@v4 | ||
with: | ||
dotnet-version: '8.0.x' | ||
|
||
- name: Restore NuGet | ||
shell: pwsh | ||
run: 'nuget restore $env:SOLUTION_PATH' | ||
|
||
- name: Restore FluentRegEdit | ||
shell: pwsh | ||
run: | | ||
msbuild $env:SOLUTION_PATH ` | ||
-t:Restore ` | ||
-p:Platform=$env:ARCHITECTURE ` | ||
-p:Configuration=$env:CONFIGURATION ` | ||
-p:PublishReadyToRun=true | ||
- name: Build FluentRegEdit | ||
run: | | ||
msbuild ` | ||
$env:PACKAGE_PROJECT_PATH ` | ||
-t:Build ` | ||
-clp:ErrorsOnly ` | ||
-p:Configuration=$env:CONFIGURATION ` | ||
-p:Platform=$env:ARCHITECTURE ` | ||
-p:AppxBundle=Never | ||
- name: Upload the packages to the Artifacts | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: 'Appx Packages (${{ env.CONFIGURATION }}, ${{ env.ARCHITECTURE }})' | ||
path: ${{ env.ARTIFACTS_STAGING_DIR }} |