Skip to content

Commit fb2e6e1

Browse files
committed
Merge branch 'master' into under_annotations
2 parents 759289a + c8da0c5 commit fb2e6e1

6 files changed

Lines changed: 21 additions & 26 deletions

File tree

.github/workflows/Benchmark.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ jobs:
88
steps:
99
- uses: actions/checkout@v6
1010
with:
11-
submodules: 'recursive'
11+
submodules: recursive
1212
- name: Setup .NET
1313
uses: actions/setup-dotnet@v5
1414
with:
@@ -18,7 +18,7 @@ jobs:
1818
uses: benchmark-action/github-action-benchmark@v1
1919
with:
2020
name: CSharpMath.Rendering.Benchmarks
21-
tool: 'benchmarkdotnet'
21+
tool: benchmarkdotnet
2222
output-file-path: .benchmarkresults/results/CSharpMath.Rendering.Benchmarks.Program-report-full-compressed.json
2323
github-token: ${{ github.token }}
2424
auto-push: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }} # Push and deploy GitHub pages branch automatically

.github/workflows/Format.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@ jobs:
1212
workloads: maui-ios, maui-maccatalyst, maui-android, wasm-tools
1313
- uses: actions/checkout@v6
1414
with:
15-
submodules: 'recursive'
15+
submodules: recursive
1616
- name: Check formatting (Fix with "dotnet format --exclude Typography" at repository root)
1717
run: dotnet format --exclude Typography --verify-no-changes --verbosity diagnostic

.github/workflows/Label.yml

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,20 @@
11
name: Label breaking changes for semantic versioning
22

3-
on: [pull_request]
3+
on: pull_request_target # Run on the merge target branch instead of the merge commit to grant pull-requests:write permission
44
jobs:
55
Label:
66
runs-on: windows-latest
7+
permissions:
8+
pull-requests: write # Allow adding a label to this pull request
79
steps:
810
- uses: actions/checkout@v6
911
with:
10-
submodules: recursive
12+
fetch-depth: 0 # Fetch all commit history and tags, instead of the default fetch of only one commit
13+
ref: ${{ github.event.pull_request.head.sha }} # Checkout the PR branch
1114
- name: If there are changes in PublicApi.Shipped.txt, fail the workflow
1215
if: github.head_ref != 'action/ship-publicapi' # Same branch name specified in Release.yml
1316
run: |
14-
git fetch origin ${{ github.base_ref }}
15-
$changes = git diff --numstat --shortstat origin/${{ github.base_ref }}...HEAD -- '**/PublicApi.Shipped.txt'
17+
$changes = git diff --numstat --shortstat origin/${{ github.base_ref }}...HEAD -- '**/PublicApi.Shipped.txt' # Note that ** must expand to at least one folder here, this doesn't check root
1618
Write-Output "$changes"
1719
if ($changes) {
1820
Write-Error "Changes detected in PublicApi.Shipped.txt files. Public API changes must be shipped through the release process, not in regular pull requests."
@@ -21,12 +23,9 @@ jobs:
2123
shell: pwsh
2224
- name: Label based on PublicApi.Unshipped.txt
2325
run: |
24-
git fetch origin ${{ github.base_ref }}
25-
26-
# Determine the appropriate label (Sync these labels with release-drafter.yml)
27-
if ("${{ github.head_ref }}" -eq "action/ship-publicapi") { # Same branch name specified in Release.yml
26+
if ("${{ github.head_ref }}" -eq "action/ship-publicapi") {
2827
$labels = @('Type/Housekeeping')
29-
Write-Output "This is a ship-publicapi PR, labeling as Type/Maintenance"
28+
Write-Output "This is a ship-publicapi PR, labeling as Type/Housekeeping"
3029
} else {
3130
# For regular PRs, check for API changes
3231
$changes = git diff origin/${{ github.base_ref }}...HEAD -- '**/PublicApi.Unshipped.txt'
@@ -44,8 +43,8 @@ jobs:
4443
Write-Output "Publicly facing API changes include only additions. Labelling as enhancement."
4544
}
4645
} else {
47-
$labels = @('Type/Bug')
48-
Write-Output "No publicly facing API changes. Labelling as bug."
46+
Write-Output "No publicly facing API changes. Exiting the workflow."
47+
Exit
4948
}
5049
}
5150

.github/workflows/Nightly.yml

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
GITHUB_TOKEN: ${{ github.token }}
1717
- uses: actions/checkout@v6
1818
with:
19-
submodules: 'recursive'
19+
submodules: recursive
2020
- uses: actions/setup-dotnet@main
2121
with:
2222
dotnet-version: '10.x'
@@ -75,12 +75,6 @@ jobs:
7575
with:
7676
name: CSharpMath.Rendering.Tests results
7777
path: CSharpMath.Rendering.Tests/*/*.png
78-
- name: Upload CSharpMath.Xaml.Tests.NuGet results as CI artifacts
79-
uses: actions/upload-artifact@v4
80-
if: always()
81-
with:
82-
name: CSharpMath.Xaml.Tests.NuGet results
83-
path: CSharpMath.Xaml.Tests.NuGet/*.png
8478
- name: Upload NuGet packages as CI artifacts
8579
uses: actions/upload-artifact@v4
8680
if: always()
@@ -97,11 +91,12 @@ jobs:
9791
# By using *.* as the file path, this command will fail when .nupkgs folder contains any file that isn't a .nupkg or .snupkg file.
9892
# --skip-duplicate enables re-running this workflow even if some packages from the same commit are already uploaded.
9993
# --no-symbols omits uploading .snupkg files which is not supported by GitHub Packages: https://github.com/orgs/community/discussions/38678
100-
dotnet nuget push '.nupkgs\*.*' -s 'https://nuget.pkg.github.com/verybadcat/index.json' -k ${{ github.token }} --skip-duplicate --no-symbols
94+
dotnet nuget push '.nupkgs\*.*' -s 'https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json' -k ${{ github.token }} --skip-duplicate --no-symbols
10195
shell: pwsh
10296
- name: Publish CSharpMath.Uno.Example
10397
run: |
10498
git fetch origin gh-pages
99+
if (-not $?) { Exit } # For forks that didn't include the gh-pages branch, don't fail the workflow
105100
git worktree add website/wwwroot gh-pages
106101
Get-ChildItem -Path website/wwwroot/* -Exclude dev,.nojekyll | Remove-Item -Recurse -Force # dev is the output folder of Benchmark.yml and .nojekyll ensures _framework folder is served, keep them
107102
# TODO: why can't this publish use --no-build? For example, see https://github.com/verybadcat/CSharpMath/actions/runs/21600019106/job/62243168945

.github/workflows/Release.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@ jobs:
77
CSharpMath:
88
runs-on: windows-latest
99
permissions:
10-
# permissions requested by https://github.com/marketplace/actions/create-pull-request#token
10+
# Permissions requested by https://github.com/marketplace/actions/create-pull-request#token
1111
contents: write
1212
pull-requests: write
1313
steps:
1414
- uses: actions/checkout@v6
1515
with:
16-
submodules: 'recursive'
16+
submodules: recursive
1717
- uses: actions/setup-dotnet@main
1818
with:
1919
dotnet-version: '10.x'
@@ -56,4 +56,5 @@ jobs:
5656
commit-message: 'Move PublicApi.Unshipped.txt to PublicApi.Shipped.txt for ${{ github.event.release.tag_name }}'
5757
title: 'Ship PublicApi for ${{ github.event.release.tag_name }}'
5858
body: 'This PR moves the contents of PublicApi.Unshipped.txt to PublicApi.Shipped.txt to mark the API as shipped for version ${{ github.event.release.tag_name }}.'
59-
branch: action/ship-publicapi # Same branch name specified in Label.yml
59+
branch: action/ship-publicapi # Same branch name specified in Label.yml
60+
base: '${{ github.event.repository.default_branch }}' # Releases are checked out on the tag commit but we need a target branch for the pull request. Let's just always submit it against the default branch

.github/workflows/Test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
workloads: ${{ case(startsWith(matrix.os, 'ubuntu'), 'maui-android, wasm-tools', 'maui, wasm-tools') }}
2323
- uses: actions/checkout@v6
2424
with:
25-
submodules: 'recursive'
25+
submodules: recursive
2626
- name: Build Everything
2727
run: dotnet build
2828
- name: Run Tests

0 commit comments

Comments
 (0)