Skip to content

Commit ed36c00

Browse files
committed
⬆️ Bump files with dotnet-file sync
# devlooped/oss - Enable package pruning in Directory.Build.props devlooped/oss@0ff8b7b - Fix improper first / in gh api repos devlooped/oss@f2b690c - Improve triage actions on issues devlooped/oss@33000c0 - Update nuget.config with new(ish?) MS certs devlooped/oss@032439d - Allow workflow to work cross-org devlooped/oss@af171b7
1 parent 8aab8e6 commit ed36c00

File tree

4 files changed

+131
-3
lines changed

4 files changed

+131
-3
lines changed
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 }}

.netconfig

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,8 @@
8686
weak
8787
[file "src/Directory.Build.props"]
8888
url = https://github.com/devlooped/oss/blob/main/src/Directory.Build.props
89-
sha = 95b338b9780de6b8ed11f060fed2d300f136ec60
90-
etag = 5e73ffebd7aef6fecae5a73d4fb044bf46f3a593ee2858ff1648d9c337e546ad
89+
sha = 0ff8b7b79a82112678326d1dc5543ed890311366
90+
etag = 3ebde0a8630d526b80f15801179116e17a857ff880a4442e7db7b075efa4fd63
9191
weak
9292
[file "src/Directory.Build.targets"]
9393
url = https://github.com/devlooped/oss/blob/main/src/Directory.Build.targets
@@ -148,3 +148,23 @@
148148
sha = 666a2a7c315f72199c418f11482a950fc69a8901
149149
etag = 91ea15c07bfd784036c6ca931f5b2df7e9767b8367146d96c79caef09d63899f
150150
weak
151+
[file ".github/actions/dotnet/action.yml"]
152+
url = https://github.com/devlooped/oss/blob/main/.github/actions/dotnet/action.yml
153+
sha = f2b690ce307acb76c5b8d7faec1a5b971a93653e
154+
etag = 27ea11baa2397b3ec9e643a935832da97719c4e44215cfd135c49cad4c29373f
155+
weak
156+
[file ".github/workflows/dotnet-file-core.yml"]
157+
url = https://github.com/devlooped/oss/blob/main/.github/workflows/dotnet-file-core.yml
158+
sha = af171b7a87382ee665ba6fbaeb5f38a3551e1c23
159+
etag = 5ce370f52933ab2a4cd50f2b410e842fc5eab23088db2bf98b6c4d4ccdc9022b
160+
weak
161+
[file ".github/workflows/triage.yml"]
162+
url = https://github.com/devlooped/oss/blob/main/.github/workflows/triage.yml
163+
sha = 33000c0c4ab4eb4e0e142fa54515b811a189d55c
164+
etag = 013a47739e348f06891f37c45164478cca149854e6cd5c5158e6f073f852b61a
165+
weak
166+
[file "src/nuget.config"]
167+
url = https://github.com/devlooped/oss/blob/main/src/nuget.config
168+
sha = 032439dbf180fca0539a5bd3a019f18ab3484b76
169+
etag = da7c0104131bd474b52fc9bc9f9bda6470e24ae38d4fb9f5c4f719bc01370ab5
170+
weak

readme.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -371,6 +371,8 @@ The versioning scheme for packages is:
371371
[![Michael Hagedorn](https://avatars.githubusercontent.com/u/61711586?u=8f653dfcb641e8c18cc5f78692ebc6bb3a0c92be&v=4&s=39 "Michael Hagedorn")](https://github.com/Eule02)
372372
[![torutek](https://avatars.githubusercontent.com/u/33917059?v=4&s=39 "torutek")](https://github.com/torutek)
373373
[![mccaffers](https://avatars.githubusercontent.com/u/16667079?u=739e110e62a75870c981640447efa5eb2cb3bc8f&v=4&s=39 "mccaffers")](https://github.com/mccaffers)
374+
[![Christoph Hochstätter](https://avatars.githubusercontent.com/u/17645550?u=01bbdcb84d03cac26260f1c951e046d24a324591&v=4&s=39 "Christoph Hochstätter")](https://github.com/christoh)
375+
[![ADS Fund](https://avatars.githubusercontent.com/u/202042116?v=4&s=39 "ADS Fund")](https://github.com/ADS-Fund)
374376

375377

376378
<!-- sponsors.md -->

src/Directory.Build.props

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<Project>
1+
<Project TreatAsLocalProperty="VersionPrefix">
22
<!-- To extend/change the defaults, create a Directory.props alongside this file -->
33

44
<PropertyGroup Label="CI" Condition="'$(CI)' == ''">
@@ -45,6 +45,8 @@
4545
<GeneratePathProperty>true</GeneratePathProperty>
4646
<!-- Avoid warnings for test projects when we run dotnet pack on the whole solution. -->
4747
<WarnOnPackingNonPackableProject>false</WarnOnPackingNonPackableProject>
48+
<!-- See https://learn.microsoft.com/en-us/nuget/consume-packages/package-references-in-project-files#prunepackagereference-specification -->
49+
<RestoreEnablePackagePruning>true</RestoreEnablePackagePruning>
4850
</PropertyGroup>
4951

5052
<PropertyGroup Label="Build">
@@ -136,6 +138,15 @@
136138
<VersionSuffix Condition="!$(VersionLabel.Contains('refs/tags/'))">$(_VersionLabel)</VersionSuffix>
137139
<!-- Special case for tags, the label is actually the version. Backs compat since passed-in value overrides MSBuild-set one -->
138140
<Version Condition="$(VersionLabel.Contains('refs/tags/'))">$(_VersionLabel)</Version>
141+
142+
<!-- In order for latest from main/master to always be greatest when using -prerelease switch on install/run,
143+
we change the scheme as follows:
144+
- main/master remain as today: VersionPrefix: 42.42.${{ github.run_number }} (from yaml)
145+
- others: VersionPrefix: 42.42.0-[label].${{ github.run_number }}
146+
-->
147+
<IsMaster Condition="$(VersionLabel.Contains('refs/heads/main')) or $(VersionLabel.Contains('refs/heads/master'))">true</IsMaster>
148+
<VersionPrefix Condition="'$(IsMaster)' != 'true'">42.42.0</VersionPrefix>
149+
<VersionSuffix Condition="'$(IsMaster)' != 'true'">$(VersionSuffix).$(GITHUB_RUN_NUMBER)</VersionSuffix>
139150
</PropertyGroup>
140151

141152
<ItemGroup Label="ThisAssembly.Project">

0 commit comments

Comments
 (0)