Skip to content

Commit 73da4a6

Browse files
committed
⬆️ Bump files with dotnet-file sync
# devlooped/oss - Support using current Version from CVM devlooped/oss@2fff747 - Fix improper first / in gh api repos devlooped/oss@f2b690c - Add explicit write permissions from caller workflow devlooped/oss@8fa147d - Simplify .gitattributes devlooped/oss@5f92a68 - Update typed resgen to opt-in only devlooped/oss@a8b2080 - Allow workflow to work cross-org devlooped/oss@af171b7 - Attempt to get necessary permissions for default token devlooped/oss@85829f2 - Group Spectre.Console updates devlooped/oss@917ff54 - Update nuget.config with new(ish?) MS certs devlooped/oss@032439d - If we provide a docs category, don't exclude docs :) devlooped/oss@0c23e24 - Update .gitignore to ignore .genaiscript devlooped/oss@e0be248
1 parent cdc54b0 commit 73da4a6

File tree

12 files changed

+222
-45
lines changed

12 files changed

+222
-45
lines changed

.gitattributes

Lines changed: 3 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,8 @@
1-
# sln, csproj files (and friends) are always CRLF, even on linux
2-
*.sln text eol=crlf
3-
*.proj text eol=crlf
4-
*.csproj text eol=crlf
1+
# normalize by default
2+
* text=auto encoding=UTF-8
3+
*.sh text eol=lf
54

65
# These are windows specific files which we may as well ensure are
76
# always crlf on checkout
87
*.bat text eol=crlf
98
*.cmd text eol=crlf
10-
11-
# Opt in known filetypes to always normalize line endings on checkin
12-
# and always use native endings on checkout
13-
*.c text
14-
*.config text
15-
*.h text
16-
*.cs text
17-
*.md text
18-
*.tt text
19-
*.txt text
20-
21-
# Some must always be checked out as lf so enforce that for those files
22-
# If these are not lf then bash/cygwin on windows will not be able to
23-
# excute the files
24-
*.sh text eol=lf

.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: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,6 @@ updates:
3838
ProtoBuf:
3939
patterns:
4040
- "protobuf-*"
41+
Spectre:
42+
patterns:
43+
- "Spectre.Console*"

.github/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ changelog:
88
- invalid
99
- wontfix
1010
- need info
11-
- docs
1211
- techdebt
1312
authors:
1413
- devlooped-bot
@@ -24,6 +23,7 @@ changelog:
2423
- title: 📝 Documentation updates
2524
labels:
2625
- docs
26+
- documentation
2727
- title: 🔨 Other
2828
labels:
2929
- '*'
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: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ on:
1111
jobs:
1212
includes:
1313
runs-on: ubuntu-latest
14+
permissions:
15+
contents: write
16+
pull-requests: write
1417
steps:
1518
- name: 🤖 defaults
1619
uses: devlooped/actions-bot@v1

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ BenchmarkDotNet.Artifacts
88
/app
99
.vs
1010
.vscode
11+
.genaiscript
1112
.idea
1213
local.settings.json
1314

.netconfig

Lines changed: 31 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -19,18 +19,18 @@
1919
weak
2020
[file ".gitattributes"]
2121
url = https://github.com/devlooped/oss/blob/main/.gitattributes
22-
sha = 0683ee777d7d878d4bf013d7deea352685135a05
23-
etag = 7acb32f5fa6d4ccd9c824605a7c2b8538497f0068c165567807d393dcf4d6bb7
22+
sha = 5f92a68e302bae675b394ef343114139c075993e
23+
etag = 338ba6d92c8d1774363396739c2be4257bfc58026f4b0fe92cb0ae4460e1eff7
2424
weak
2525
[file ".github/dependabot.yml"]
2626
url = https://github.com/devlooped/oss/blob/main/.github/dependabot.yml
27-
sha = 49661dbf0720cde93eb5569be7523b5912351560
28-
etag = c147ea2f3431ca0338c315c4a45b56ee233c4d30f8d6ab698d0e1980a257fd6a
27+
sha = 917ff5486e25bec90038e7ab6d146fd82c61f846
28+
etag = 50bf50df5a6eeb1705baea50f4c6e06d167a89cb5a590887ff939bd4120bd442
2929
weak
3030
[file ".github/release.yml"]
3131
url = https://github.com/devlooped/oss/blob/main/.github/release.yml
32-
sha = 1afd173fe8f81b510c597737b0d271218e81fa73
33-
etag = 482dc2c892fc7ce0cb3a01eb5d9401bee50ddfb067d8cb85873555ce63cf5438
32+
sha = 0c23e24704625cf75b2cb1fdc566cef7e20af313
33+
etag = 310df162242c95ed19ed12e3c96a65f77e558b46dced676ad5255eb12caafe75
3434
weak
3535
[file ".github/workflows/build.yml"]
3636
url = https://github.com/devlooped/oss/blob/main/.github/workflows/build.yml
@@ -47,13 +47,13 @@
4747
weak
4848
[file ".github/workflows/dotnet-file.yml"]
4949
url = https://github.com/devlooped/oss/blob/main/.github/workflows/dotnet-file.yml
50-
sha = 7afe350f7e80a230e922db026d4e1198ba15cae1
51-
etag = 65e9794df6caff779eb989c8f71ddf4d4109b24a75af79e4f8d0fe6ba7bd9702
50+
sha = 8fa147d4799d73819040736c399d0b1db2c2d86c
51+
etag = 1ca805a23656e99c03f9d478dba8ccef6e571f5de2ac0e9bb7e3c5216c99a694
5252
weak
5353
[file ".github/workflows/includes.yml"]
5454
url = https://github.com/devlooped/oss/blob/main/.github/workflows/includes.yml
55-
sha = d152e7437fd0d6f6d9363d23cb3b78c07335ea49
56-
etag = ec40db34f379d0c6d83b2ec15624f330318a172cc4f85b5417c63e86eaf601df
55+
sha = 85829f2510f335f4a411867f3dbaaa116c3ab3de
56+
etag = 086f6b6316cc6ea7089c0dcc6980be519e6ed6e6201e65042ef41b82634ec0ee
5757
weak
5858
[file ".github/workflows/publish.yml"]
5959
url = https://github.com/devlooped/oss/blob/main/.github/workflows/publish.yml
@@ -65,8 +65,8 @@
6565
weak
6666
[file ".gitignore"]
6767
url = https://github.com/devlooped/oss/blob/main/.gitignore
68-
sha = 02811fa23b0a102b9b33048335d41e515bf75737
69-
etag = a9c37ae312afac14b78436a7d018af4483d88736b5f780576f2c5a0b3f14998c
68+
sha = e0be248fff1d39133345283b8227372b36574b75
69+
etag = c449ec6f76803e1891357ca2b8b4fcb5b2e5deeff8311622fd92ca9fbf1e6575
7070
weak
7171
[file "Directory.Build.rsp"]
7272
url = https://github.com/devlooped/oss/blob/main/Directory.Build.rsp
@@ -90,11 +90,26 @@
9090
weak
9191
[file "src/Directory.Build.props"]
9292
url = https://github.com/devlooped/oss/blob/main/src/Directory.Build.props
93-
sha = b76de49afb376aa48eb172963ed70663b59b31d3
94-
etag = c8b56f3860cc7ccb8773b7bd6189f5c7a6e3a2c27e9104c1ee201fbdc5af9873
93+
sha = 2fff747a9673b499c99f2da183cdd5263fdc9333
94+
etag = 0fccddf04f282fe98122ab2610dc2972c205a521254559bf013655c6271b0017
9595
weak
9696
[file "src/Directory.Build.targets"]
9797
url = https://github.com/devlooped/oss/blob/main/src/Directory.Build.targets
98-
sha = 33a20db26e47589769284817b271ce67ea9ccfd8
99-
etag = 1a3a0151b5771ee97ed8351254ff4c18a0ff568e0df5c33c6830f069bfbb067b
98+
sha = a8b208093599263b7f2d1fe3854634c588ea5199
99+
etag = 19087699f05396205e6b050d999a43b175bd242f6e8fac86f6df936310178b03
100+
weak
101+
[file ".github/actions/dotnet/action.yml"]
102+
url = https://github.com/devlooped/oss/blob/main/.github/actions/dotnet/action.yml
103+
sha = f2b690ce307acb76c5b8d7faec1a5b971a93653e
104+
etag = 27ea11baa2397b3ec9e643a935832da97719c4e44215cfd135c49cad4c29373f
105+
weak
106+
[file ".github/workflows/dotnet-file-core.yml"]
107+
url = https://github.com/devlooped/oss/blob/main/.github/workflows/dotnet-file-core.yml
108+
sha = af171b7a87382ee665ba6fbaeb5f38a3551e1c23
109+
etag = 5ce370f52933ab2a4cd50f2b410e842fc5eab23088db2bf98b6c4d4ccdc9022b
110+
weak
111+
[file "src/nuget.config"]
112+
url = https://github.com/devlooped/oss/blob/main/src/nuget.config
113+
sha = 032439dbf180fca0539a5bd3a019f18ab3484b76
114+
etag = da7c0104131bd474b52fc9bc9f9bda6470e24ae38d4fb9f5c4f719bc01370ab5
100115
weak

src/Directory.Build.props

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,18 @@
153153
<Import Project="Directory.props" Condition="Exists('Directory.props')"/>
154154
<Import Project="Directory.props.user" Condition="Exists('Directory.props.user')" />
155155

156+
<!-- If the imported props changed ManagePackageVersionsCentrally, we need to replicate
157+
the Version defaults from Microsoft.NET.DefaultAssemblyInfo.targets since it's too
158+
early here and Directory.Packages.props will be imported right after this time,
159+
meaning dependencies that expect to use the currently building Version would not
160+
get the expected value.
161+
-->
162+
<PropertyGroup Condition="'$(ManagePackageVersionsCentrally)' == 'true' and '$(Version)' == ''">
163+
<VersionPrefix Condition=" '$(VersionPrefix)' == '' ">1.0.0</VersionPrefix>
164+
<Version Condition=" '$(VersionSuffix)' != '' ">$(VersionPrefix)-$(VersionSuffix)</Version>
165+
<Version Condition=" '$(Version)' == '' ">$(VersionPrefix)</Version>
166+
</PropertyGroup>
167+
156168
<!-- Implemented by SDK in .targets, guaranteeing it's overwritten. Added here since we add a DependsOnTargets to it.
157169
Covers backwards compatiblity with non-SDK projects. -->
158170
<Target Name="InitializeSourceControlInformation" />

0 commit comments

Comments
 (0)