Skip to content

Commit c50e07b

Browse files
committed
⬆️ Bump files with dotnet-file sync
# devlooped/oss - Revert EOL change in editorconfig for C# files devlooped/oss@2d0e5a5 - Fix improper first / in gh api repos devlooped/oss@f2b690c - Ignore slnx file format too devlooped/oss@68b409c - Add explicit write permissions from caller workflow devlooped/oss@8fa147d - Add Company MSBuild property by default devlooped/oss@c509be4 - Ensure lf for Scriban templates always devlooped/oss@4a9aa32 - Fix error message quotes in includes.yml devlooped/oss@26e8cb7 - Use GH_TOKEN if available for PR devlooped/oss@77e83f2 - Improve default Product metadata, remove .git from user-facing URLs devlooped/oss@4339749 - Group MEAI packages together devlooped/oss@e733294 - Switch to dotnet-env for .NET SDK setup devlooped/oss@56c2b85 - Allow workflow to work cross-org devlooped/oss@af171b7 - Ignore .env files recursively devlooped/oss@3776526 - Update nuget.config with new(ish?) MS certs devlooped/oss@032439d
1 parent d780d62 commit c50e07b

17 files changed

+327
-52
lines changed

.editorconfig

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ indent_size = 4
1414

1515
# Xml project files
1616
[*.{csproj,vbproj,vcxproj,vcxproj.filters,proj,projitems,shproj,msbuildproj,props,targets}]
17-
indent_size = 2
17+
indent_size = 4
1818

1919
# Xml config files
2020
[*.{ruleset,config,nuspec,resx,vsixmanifest,vsct}]
@@ -30,6 +30,8 @@ indent_size = 2
3030

3131
# Dotnet code style settings:
3232
[*.{cs,vb}]
33+
tab_width = 4
34+
3335
# Sort using and Import directives with System.* appearing first
3436
dotnet_sort_system_directives_first = true
3537
# Avoid "this." and "Me." if not necessary
@@ -57,6 +59,9 @@ dotnet_style_require_accessibility_modifiers = omit_if_default:error
5759
# IDE0040: Add accessibility modifiers
5860
dotnet_diagnostic.IDE0040.severity = error
5961

62+
# IDE1100: Error reading content of source file 'Project.TargetFrameworkMoniker' (i.e. from ThisAssembly)
63+
dotnet_diagnostic.IDE1100.severity = none
64+
6065
[*.cs]
6166
# Top-level files are definitely OK
6267
csharp_using_directive_placement = outside_namespace:silent

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# normalize by default
22
* text=auto encoding=UTF-8
33
*.sh text eol=lf
4+
*.sbn eol=lf
45

56
# These are windows specific files which we may as well ensure are
67
# always crlf on checkout

.github/actions/dotnet/action.yml

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: ⚙ dotnet
2+
description: Configures dotnet if the repo/org defines the DOTNET custom property
3+
4+
runs:
5+
using: composite
6+
steps:
7+
- name: 🔎 dotnet
8+
id: dotnet
9+
shell: bash
10+
run: |
11+
VERSIONS=$(gh api repos/${{ github.repository }}/properties/values | jq -r '.[] | select(.property_name == "DOTNET") | .value')
12+
# Remove extra whitespace from VERSIONS
13+
VERSIONS=$(echo "$VERSIONS" | tr -s ' ' | tr -d ' ')
14+
# Convert comma-separated to newline-separated
15+
NEWLINE_VERSIONS=$(echo "$VERSIONS" | tr ',' '\n')
16+
# Validate versions
17+
while IFS= read -r version; do
18+
if ! [[ $version =~ ^[0-9]+(\.[0-9]+(\.[0-9]+)?)?(\.x)?$ ]]; then
19+
echo "Error: Invalid version format: $version"
20+
exit 1
21+
fi
22+
done <<< "$NEWLINE_VERSIONS"
23+
# Write multiline output to $GITHUB_OUTPUT
24+
{
25+
echo 'versions<<EOF'
26+
echo "$NEWLINE_VERSIONS"
27+
echo 'EOF'
28+
} >> $GITHUB_OUTPUT
29+
30+
- name: ⚙ dotnet
31+
if: steps.dotnet.outputs.versions != ''
32+
uses: actions/setup-dotnet@v4
33+
with:
34+
dotnet-version: |
35+
${{ steps.dotnet.outputs.versions }}

.github/dependabot.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,11 @@ updates:
2424
Extensions:
2525
patterns:
2626
- "Microsoft.Extensions*"
27+
exclude-patterns:
28+
- "Microsoft.Extensions.AI*"
29+
ExtensionsAI:
30+
patterns:
31+
- "Microsoft.Extensions.AI*"
2732
Web:
2833
patterns:
2934
- "Microsoft.AspNetCore*"
@@ -38,3 +43,6 @@ updates:
3843
ProtoBuf:
3944
patterns:
4045
- "protobuf-*"
46+
Spectre:
47+
patterns:
48+
- "Spectre.Console*"

.github/workflows/build.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ env:
2828
GH_TOKEN: ${{ secrets.GH_TOKEN }}
2929
MSBUILDTERMINALLOGGER: auto
3030
Configuration: ${{ github.event.inputs.configuration || 'Release' }}
31+
SLEET_FEED_URL: ${{ vars.SLEET_FEED_URL }}
3132

3233
defaults:
3334
run:
@@ -64,6 +65,9 @@ jobs:
6465
submodules: recursive
6566
fetch-depth: 0
6667

68+
- name: ⚙ dotnet
69+
uses: devlooped/actions-dotnet-env@v1
70+
6771
- name: 🙏 build
6872
run: dotnet build -m:1 -bl:build.binlog
6973

@@ -73,7 +77,7 @@ jobs:
7377
dotnet retest -- --no-build
7478
7579
- name: 🐛 logs
76-
uses: actions/upload-artifact@v3
80+
uses: actions/upload-artifact@v4
7781
if: runner.debug && always()
7882
with:
7983
name: logs
@@ -96,6 +100,9 @@ jobs:
96100
submodules: recursive
97101
fetch-depth: 0
98102

103+
- name: ⚙ dotnet
104+
uses: devlooped/actions-dotnet-env@v1
105+
99106
- name: ✓ ensure format
100107
run: |
101108
dotnet format whitespace --verify-no-changes -v:diag --exclude ~/.nuget

.github/workflows/dotnet-env.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: dotnet-env
2+
on:
3+
workflow_dispatch:
4+
push:
5+
branches:
6+
- main
7+
paths:
8+
- '**/*.*proj'
9+
10+
jobs:
11+
which-dotnet:
12+
runs-on: ubuntu-latest
13+
permissions:
14+
contents: write
15+
pull-requests: write
16+
17+
steps:
18+
- name: 🤖 defaults
19+
uses: devlooped/actions-bot@v1
20+
with:
21+
name: ${{ secrets.BOT_NAME }}
22+
email: ${{ secrets.BOT_EMAIL }}
23+
gh_token: ${{ secrets.GH_TOKEN }}
24+
github_token: ${{ secrets.GITHUB_TOKEN }}
25+
26+
- name: 🤘 checkout
27+
uses: actions/checkout@v4
28+
with:
29+
token: ${{ env.GH_TOKEN }}
30+
31+
- name: 🤌 dotnet
32+
uses: devlooped/actions-which-dotnet@v1
33+
34+
- name: ✍ pull request
35+
uses: peter-evans/create-pull-request@v7
36+
with:
37+
base: main
38+
branch: which-dotnet
39+
delete-branch: true
40+
labels: dependencies
41+
title: "⚙ Update dotnet versions"
42+
body: "Update dotnet versions"
43+
commit-message: "Update dotnet versions"
44+
token: ${{ env.GH_TOKEN }}
Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
# Synchronizes .netconfig-configured files with dotnet-file
2+
name: dotnet-file-core
3+
on:
4+
workflow_call:
5+
secrets:
6+
BOT_NAME:
7+
required: false
8+
BOT_EMAIL:
9+
required: false
10+
GH_TOKEN:
11+
required: false
12+
13+
env:
14+
DOTNET_NOLOGO: true
15+
16+
defaults:
17+
run:
18+
shell: pwsh
19+
20+
jobs:
21+
sync:
22+
runs-on: ubuntu-latest
23+
continue-on-error: true
24+
steps:
25+
- name: 🤖 defaults
26+
uses: devlooped/actions-bot@v1
27+
with:
28+
name: ${{ secrets.BOT_NAME }}
29+
email: ${{ secrets.BOT_EMAIL }}
30+
gh_token: ${{ secrets.GH_TOKEN }}
31+
github_token: ${{ secrets.GITHUB_TOKEN }}
32+
33+
- name: 🤘 checkout
34+
uses: actions/checkout@v4
35+
with:
36+
fetch-depth: 0
37+
ref: main
38+
token: ${{ env.GH_TOKEN }}
39+
40+
- name: ⌛ rate
41+
if: github.event_name != 'workflow_dispatch'
42+
run: |
43+
# add random sleep since we run on fixed schedule
44+
sleep (get-random -max 60)
45+
# get currently authenticated user rate limit info
46+
$rate = gh api rate_limit | convertfrom-json | select -expandproperty rate
47+
# if we don't have at least 100 requests left, wait until reset
48+
if ($rate.remaining -lt 10) {
49+
$wait = ($rate.reset - (Get-Date (Get-Date).ToUniversalTime() -UFormat %s))
50+
echo "Rate limit remaining is $($rate.remaining), waiting for $($wait / 1000) seconds to reset"
51+
sleep $wait
52+
$rate = gh api rate_limit | convertfrom-json | select -expandproperty rate
53+
echo "Rate limit has reset to $($rate.remaining) requests"
54+
}
55+
56+
- name: 🔄 sync
57+
run: |
58+
dotnet tool update -g dotnet-gcm
59+
# store credentials in plaintext for linux compat
60+
git config --local credential.credentialStore plaintext
61+
dotnet gcm store --protocol=https --host=github.com --username=$env:GITHUB_ACTOR --password=$env:GH_TOKEN
62+
gh auth status
63+
64+
dotnet tool update -g dotnet-file
65+
$changelog = "$([System.IO.Path]::GetTempPath())dotnet-file.md"
66+
dotnet file sync -c:$changelog
67+
if (test-path $changelog) {
68+
echo 'CHANGES<<EOF' >> $env:GITHUB_ENV
69+
cat $changelog >> $env:GITHUB_ENV
70+
echo 'EOF' >> $env:GITHUB_ENV
71+
cat $changelog
72+
} else {
73+
echo 'No changelog was generated'
74+
}
75+
76+
- name: +Mᐁ includes
77+
uses: devlooped/actions-includes@v1
78+
with:
79+
validate: false
80+
81+
- name: ✍ pull request
82+
uses: peter-evans/create-pull-request@v7
83+
with:
84+
base: main
85+
branch: dotnet-file-sync
86+
delete-branch: true
87+
labels: dependencies
88+
author: ${{ env.BOT_AUTHOR }}
89+
committer: ${{ env.BOT_AUTHOR }}
90+
commit-message: ⬆️ Bump files with dotnet-file sync
91+
92+
${{ env.CHANGES }}
93+
title: "⬆️ Bump files with dotnet-file sync"
94+
body: ${{ env.CHANGES }}
95+
token: ${{ env.GH_TOKEN }}

.github/workflows/dotnet-file.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,10 @@ env:
1212

1313
jobs:
1414
run:
15+
permissions:
16+
contents: write
1517
uses: devlooped/oss/.github/workflows/dotnet-file-core.yml@main
16-
secrets: inherit
18+
secrets:
19+
BOT_NAME: ${{ secrets.BOT_NAME }}
20+
BOT_EMAIL: ${{ secrets.BOT_EMAIL }}
21+
GH_TOKEN: ${{ secrets.GH_TOKEN }}

.github/workflows/includes.yml

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,16 @@ on:
55
branches:
66
- 'main'
77
paths:
8-
- '**.md'
8+
- '**.md'
99
- '!changelog.md'
10+
- 'osmfeula.txt'
1011

1112
jobs:
1213
includes:
1314
runs-on: ubuntu-latest
15+
permissions:
16+
contents: write
17+
pull-requests: write
1418
steps:
1519
- name: 🤖 defaults
1620
uses: devlooped/actions-bot@v1
@@ -28,10 +32,29 @@ jobs:
2832
- name: +Mᐁ includes
2933
uses: devlooped/actions-includes@v1
3034

35+
- name: 📝 OSMF EULA
36+
shell: pwsh
37+
run: |
38+
$file = "osmfeula.txt"
39+
$props = "src/Directory.Build.props"
40+
if (-not (test-path $file) -or -not (test-path $props)) {
41+
exit 0
42+
}
43+
44+
$product = dotnet msbuild $props -getproperty:Product
45+
if (-not $product) {
46+
write-error 'To use OSMF EULA, ensure the $(Product) property is set in Directory.props'
47+
exit 1
48+
}
49+
50+
((get-content -raw $file) -replace '\$product\$',$product).trim() | set-content $file
51+
3152
- name: ✍ pull request
3253
uses: peter-evans/create-pull-request@v6
3354
with:
34-
add-paths: '**.md'
55+
add-paths: |
56+
**.md
57+
osmfeula.txt
3558
base: main
3659
branch: markdown-includes
3760
delete-branch: true

.github/workflows/publish.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ env:
1515
VersionLabel: ${{ github.ref }}
1616
GH_TOKEN: ${{ secrets.GH_TOKEN }}
1717
MSBUILDTERMINALLOGGER: auto
18-
18+
SLEET_FEED_URL: https://api.nuget.org/v3/index.json
19+
1920
jobs:
2021
publish:
2122
runs-on: ${{ vars.PUBLISH_AGENT || 'ubuntu-latest' }}
@@ -26,6 +27,9 @@ jobs:
2627
submodules: recursive
2728
fetch-depth: 0
2829

30+
- name: ⚙ dotnet
31+
uses: devlooped/actions-dotnet-env@v1
32+
2933
- name: 🙏 build
3034
run: dotnet build -m:1 -bl:build.binlog
3135

@@ -35,7 +39,7 @@ jobs:
3539
dotnet retest -- --no-build
3640
3741
- name: 🐛 logs
38-
uses: actions/upload-artifact@v3
42+
uses: actions/upload-artifact@v4
3943
if: runner.debug && always()
4044
with:
4145
name: logs

0 commit comments

Comments
 (0)