dep: Update dependency Microsoft.WindowsAppSDK to v1.4.231219000 #801
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: CI | |
on: [push, pull_request, workflow_dispatch] | |
env: | |
ProjectName: ${{ github.event.repository.name }} | |
NET_TFM: net8.0-windows10.0.22621.0 | |
Configuration: Release | |
jobs: | |
check_format: | |
runs-on: windows-latest | |
steps: | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: 8.0.x | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Run dotnet format check | |
run: dotnet format -v diag --verify-no-changes | |
test: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: | |
- windows-latest | |
- ubuntu-latest | |
- macos-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: 8.0.x | |
- name: Run tests | |
working-directory: UnitTest | |
run: dotnet test -c Release | |
build: | |
needs: [test, check_format] | |
runs-on: windows-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: 8.0.x | |
- name: Build | |
shell: pwsh | |
run: | | |
.\build.ps1 | |
.\build.WinUI.ps1 x64 | |
.\build.WinUI.ps1 arm64 | |
- name: Upload | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ env.ProjectName }} | |
path: ${{ env.ProjectName }}\bin\${{ env.Configuration }}\${{ env.NET_TFM }}\generic\publish\ | |
- name: Upload WinUI x64 | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ env.ProjectName }}.WinUI.x64 | |
path: ${{ env.ProjectName }}.WinUI\bin\x64\${{ env.Configuration }}\${{ env.NET_TFM }}\win-x64\publish\ | |
- name: Upload WinUI arm64 | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ env.ProjectName }}.WinUI.arm64 | |
path: ${{ env.ProjectName }}.WinUI\bin\arm64\${{ env.Configuration }}\${{ env.NET_TFM }}\win-arm64\publish\ | |
nuget: | |
needs: [test, check_format] | |
if: ${{ github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') }} | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
PackageName: | |
- STUN | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: 8.0.x | |
- name: Build | |
working-directory: ${{ matrix.PackageName }} | |
run: dotnet build -c Release | |
- name: Push nuget packages | |
working-directory: ${{ matrix.PackageName }}/bin/Release | |
run: | | |
dotnet nuget push *.nupkg -s https://nuget.pkg.github.com/HMBSbige -k ${{ secrets.GITHUB_TOKEN }} --skip-duplicate | |
dotnet nuget push *.nupkg -s https://api.nuget.org/v3/index.json -k ${{ secrets.NuGetAPIKey }} --skip-duplicate | |
release: | |
needs: [build, nuget] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/download-artifact@v4 | |
with: | |
name: ${{ env.ProjectName }} | |
path: ${{ env.ProjectName }} | |
- uses: actions/download-artifact@v4 | |
with: | |
name: ${{ env.ProjectName }}.WinUI.x64 | |
path: ${{ env.ProjectName }}.WinUI.x64 | |
- uses: actions/download-artifact@v4 | |
with: | |
name: ${{ env.ProjectName }}.WinUI.arm64 | |
path: ${{ env.ProjectName }}.WinUI.arm64 | |
- name: Package | |
shell: pwsh | |
run: | | |
New-Item -ItemType Directory -Path builtfiles -Force > $null | |
$zip_path = "builtfiles/$env:ProjectName-${{ github.ref_name }}.7z" | |
7z a -mx9 "$zip_path" ${{ env.ProjectName }} | |
echo "GENERIC_SHA256=$((Get-FileHash $zip_path -Algorithm SHA256).Hash)" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append | |
- name: Package WinUI x64 | |
shell: pwsh | |
run: | | |
$zip_path = "builtfiles/$env:ProjectName-${{ github.ref_name }}-x64.7z" | |
7z a -mx9 "$zip_path" ${{ env.ProjectName }}.WinUI.x64 | |
echo "X64_SHA256=$((Get-FileHash $zip_path -Algorithm SHA256).Hash)" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append | |
- name: Package WinUI arm64 | |
shell: pwsh | |
run: | | |
$zip_path = "builtfiles/$env:ProjectName-${{ github.ref_name }}-arm64.7z" | |
7z a -mx9 "$zip_path" ${{ env.ProjectName }}.WinUI.arm64 | |
echo "ARM64_SHA256=$((Get-FileHash $zip_path -Algorithm SHA256).Hash)" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append | |
- name: Create a new GitHub release | |
uses: ncipollo/release-action@v1 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
prerelease: true | |
draft: false | |
artifacts: builtfiles/* | |
body: | | |
## Hash | |
| Filename | SHA-256 | | |
| :- | :- | | |
| <sub>${{ env.ProjectName }}-${{ github.ref_name }}.7z</sub> | <sub>${{ env.GENERIC_SHA256 }}</sub> | | |
| <sub>${{ env.ProjectName }}-${{ github.ref_name }}-x64.7z</sub> | <sub>${{ env.X64_SHA256 }}</sub> | | |
| <sub>${{ env.ProjectName }}-${{ github.ref_name }}-arm64.7z</sub> | <sub>${{ env.ARM64_SHA256 }}</sub> | |