Skip to content

Commit b0658ba

Browse files
committed
⬆️ Bump files with dotnet-file sync
# devlooped/oss - Fix improper first / in gh api repos devlooped/oss@f2b690c - Update nuget.config with new(ish?) MS certs devlooped/oss@032439d - Enable package pruning in Directory.Build.props devlooped/oss@0ff8b7b - Keep the --yes on dnx runfile devlooped/oss@9c2f8c7 - Update create-pull-request action to version 8 devlooped/oss@0662872 - Update dotnet-file sync command with init option devlooped/oss@f279ae9 - Add readme template devlooped/oss@2cc4ada - Ignore *.local recursively devlooped/oss@a225b7a - Improve triage actions on issues devlooped/oss@33000c0
1 parent 8aab8e6 commit b0658ba

8 files changed

Lines changed: 314 additions & 15 deletions

File tree

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 --init https://github.com/devlooped/oss/blob/main/.netconfig
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@v8
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/includes.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,11 @@ jobs:
5050
((get-content -raw $file) -replace '\$product\$',$product).trim() | set-content $file
5151
5252
- name: ✍ pull request
53-
uses: peter-evans/create-pull-request@v6
53+
uses: peter-evans/create-pull-request@v8
5454
with:
5555
add-paths: |
5656
**.md
57-
osmfeula.txt
57+
*.txt
5858
base: main
5959
branch: markdown-includes
6060
delete-branch: true

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ BenchmarkDotNet.Artifacts
1212
.idea
1313
local.settings.json
1414
.env
15+
*.local
1516

1617
*.suo
1718
*.sdf

.netconfig

Lines changed: 36 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,8 @@
6161
weak
6262
[file ".gitignore"]
6363
url = https://github.com/devlooped/oss/blob/main/.gitignore
64-
sha = 3776526342afb3f57da7e80f2095e5fdca3c31c9
65-
etag = 11767f73556aa4c6c8bcc153b77ee8e8114f99fa3b885b0a7d66d082f91e77b3
64+
sha = a225b7a9f609f26bcc24e0d84f663387be251a7d
65+
etag = 20a8b49d57024abbd85aac5b0020c30e5eb68e0384b2761e93727c8780c4a991
6666
weak
6767
[file "Directory.Build.rsp"]
6868
url = https://github.com/devlooped/oss/blob/main/Directory.Build.rsp
@@ -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
@@ -112,8 +112,8 @@
112112
weak
113113
[file ".github/workflows/includes.yml"]
114114
url = https://github.com/devlooped/oss/blob/main/.github/workflows/includes.yml
115-
sha = 2d1fb4ed52b63689f2b20b994512ebac28721243
116-
etag = 34ade86f020dea717c6a27ad7dcd0069c35be2832c58b0ba961278a1efe34089
115+
sha = 06628725a6303bb8c4cf3076a384fc982a91bc0b
116+
etag = 478f91d4126230e57cc601382da1ba23f9daa054645b4af89800d8dd862e64fd
117117
weak
118118
[file ".github/workflows/combine-prs.yml"]
119119
url = https://github.com/devlooped/oss/blob/main/.github/workflows/combine-prs.yml
@@ -148,3 +148,33 @@
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 = f279ae9cc626024f2fa5a0b8517db83303a2635d
159+
etag = 9b0e72793a0cd5d0051b667f724e48a22d00524b808dc250ab57bc3b33579a96
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 "oss.cs"]
167+
url = https://github.com/devlooped/oss/blob/main/oss.cs
168+
sha = 9c2f8c729d7cd3dd052b5a09d12fb1f3926247e5
169+
etag = e195cacdb0c6ea7ca768514ec94f8595d008c7f5aae805b39beec330895045e3
170+
weak
171+
[file "readme.tmp.md"]
172+
url = https://github.com/devlooped/oss/blob/main/readme.tmp.md
173+
sha = 2cc4ada8059b1e2e3f32089e67dab27a8ddeb7fb
174+
etag = c7c0694bd13d2d7fdc8b0530c80d5cf032cb9fdaaa5e1f814e951e9e6489746a
175+
weak
176+
[file "src/nuget.config"]
177+
url = https://github.com/devlooped/oss/blob/main/src/nuget.config
178+
sha = 032439dbf180fca0539a5bd3a019f18ab3484b76
179+
etag = da7c0104131bd474b52fc9bc9f9bda6470e24ae38d4fb9f5c4f719bc01370ab5
180+
weak

oss.cs

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
// First run: dnx runfile https://github.com/devlooped/oss/blob/main/oss.cs --yes --alias oss
2+
// Subsequently: dnx runfile oss --yes
3+
#:package Spectre.Console@*
4+
#:package CliWrap@*
5+
6+
using System;
7+
using System.IO;
8+
using System.Net.Http;
9+
using System.Runtime.InteropServices;
10+
using System.Threading.Tasks;
11+
using CliWrap;
12+
using Spectre.Console;
13+
14+
string dotnet = Path.GetFullPath(
15+
Path.Combine(RuntimeEnvironment.GetRuntimeDirectory(), "..", "..", "..",
16+
RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? "dotnet.exe" : "dotnet"));
17+
18+
AnsiConsole.Write(new FigletText("devlooped oss").Color(Color.Green));
19+
AnsiConsole.WriteLine();
20+
21+
var projectName = AnsiConsole.Prompt(
22+
new TextPrompt<string>("[green]Project name[/]:")
23+
.PromptStyle("yellow")
24+
.ValidationErrorMessage("[red]Project name cannot be empty[/]")
25+
.Validate(v => !string.IsNullOrWhiteSpace(v)));
26+
27+
var repoName = AnsiConsole.Prompt(
28+
new TextPrompt<string>("[green]Repo name[/]:")
29+
.PromptStyle("yellow")
30+
.DefaultValue(projectName));
31+
32+
var packageId = AnsiConsole.Prompt(
33+
new TextPrompt<string>("[green]Package ID[/]:")
34+
.PromptStyle("yellow")
35+
.DefaultValue($"Devlooped.{projectName}"));
36+
37+
AnsiConsole.WriteLine();
38+
AnsiConsole.Write(new Rule("[yellow]Setting up OSS project[/]").RuleStyle("grey").LeftJustified());
39+
AnsiConsole.WriteLine();
40+
41+
await RunDotNet("file init https://github.com/devlooped/oss/blob/main/.netconfig", "Initializing dotnet file sync from devlooped/oss");
42+
await RunDotNet($"new classlib -n {projectName} -o src/{projectName} -f net10.0", $"Creating class library src/{projectName}");
43+
await RunDotNet($"new xunit -n Tests -o src/Tests -f net10.0", "Creating xUnit test project src/Tests");
44+
await RunDotNet($"add src/Tests/Tests.csproj reference src/{projectName}/{projectName}.csproj", $"Adding reference from Tests to {projectName}");
45+
await RunDotNet($"new solution -n {projectName}", $"Creating solution {projectName}.slnx");
46+
await RunDotNet($"sln {projectName}.slnx add src/{projectName}/{projectName}.csproj src/Tests/Tests.csproj", $"Adding projects to {projectName}.slnx");
47+
48+
await AnsiConsole.Status()
49+
.Spinner(Spinner.Known.Dots)
50+
.SpinnerStyle(Style.Parse("green"))
51+
.StartAsync("Downloading readme.md template...", async ctx =>
52+
{
53+
using var http = new HttpClient();
54+
var readmeContent = await http.GetStringAsync(
55+
"https://raw.githubusercontent.com/devlooped/oss/main/readme.tmp.md");
56+
57+
readmeContent = readmeContent
58+
.Replace("{{PROJECT_NAME}}", projectName)
59+
.Replace("{{PACKAGE_ID}}", packageId)
60+
.Replace("{{REPO_NAME}}", repoName);
61+
62+
await File.WriteAllTextAsync("readme.md", readmeContent);
63+
ctx.Status("Downloaded and processed readme.md");
64+
});
65+
66+
AnsiConsole.MarkupLine("[green]✓[/] Created [yellow]readme.md[/]");
67+
68+
await File.WriteAllTextAsync(
69+
Path.Combine("src", projectName, "readme.md"),
70+
$"""
71+
[![EULA](https://img.shields.io/badge/EULA-OSMF-blue?labelColor=black&color=C9FF30)](osmfeula.txt)
72+
[![OSS](https://img.shields.io/github/license/devlooped/oss.svg?color=blue)](license.txt)
73+
[![GitHub](https://img.shields.io/badge/-source-181717.svg?logo=GitHub)](https://github.com/devlooped/{repoName})
74+
75+
<!-- include ../../readme.md#content -->
76+
77+
<!-- include https://github.com/devlooped/.github/raw/main/osmf.md -->
78+
79+
<!-- include https://github.com/devlooped/sponsors/raw/main/footer.md -->
80+
81+
<!-- exclude -->
82+
""");
83+
84+
AnsiConsole.WriteLine();
85+
AnsiConsole.Write(new Rule("[green]Done![/]").RuleStyle("grey").LeftJustified());
86+
AnsiConsole.WriteLine();
87+
AnsiConsole.MarkupLine($"[bold]Project:[/] [yellow]{projectName}[/]");
88+
AnsiConsole.MarkupLine($"[bold]Repo:[/] [yellow]{repoName}[/]");
89+
AnsiConsole.MarkupLine($"[bold]Package ID:[/] [yellow]{packageId}[/]");
90+
91+
async Task RunDotNet(string command, string description)
92+
{
93+
AnsiConsole.MarkupLine($"[grey]{Markup.Escape(description)}...[/]");
94+
await Cli.Wrap(dotnet)
95+
.WithArguments(command)
96+
.WithStandardOutputPipe(PipeTarget.ToStream(Console.OpenStandardOutput()))
97+
.WithStandardErrorPipe(PipeTarget.ToStream(Console.OpenStandardError()))
98+
.ExecuteAsync();
99+
AnsiConsole.MarkupLine($"[green]✓[/] {Markup.Escape(description)}");
100+
}

readme.md

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -345,6 +345,7 @@ The versioning scheme for packages is:
345345
<!-- sponsors.md -->
346346
[![Clarius Org](https://avatars.githubusercontent.com/u/71888636?v=4&s=39 "Clarius Org")](https://github.com/clarius)
347347
[![MFB Technologies, Inc.](https://avatars.githubusercontent.com/u/87181630?v=4&s=39 "MFB Technologies, Inc.")](https://github.com/MFB-Technologies-Inc)
348+
[![SandRock](https://avatars.githubusercontent.com/u/321868?u=99e50a714276c43ae820632f1da88cb71632ec97&v=4&s=39 "SandRock")](https://github.com/sandrock)
348349
[![DRIVE.NET, Inc.](https://avatars.githubusercontent.com/u/15047123?v=4&s=39 "DRIVE.NET, Inc.")](https://github.com/drivenet)
349350
[![Keith Pickford](https://avatars.githubusercontent.com/u/16598898?u=64416b80caf7092a885f60bb31612270bffc9598&v=4&s=39 "Keith Pickford")](https://github.com/Keflon)
350351
[![Thomas Bolon](https://avatars.githubusercontent.com/u/127185?u=7f50babfc888675e37feb80851a4e9708f573386&v=4&s=39 "Thomas Bolon")](https://github.com/tbolon)
@@ -354,23 +355,21 @@ The versioning scheme for packages is:
354355
[![Jacob Foshee](https://avatars.githubusercontent.com/u/480334?v=4&s=39 "Jacob Foshee")](https://github.com/jfoshee)
355356
[![](https://avatars.githubusercontent.com/u/33566379?u=bf62e2b46435a267fa246a64537870fd2449410f&v=4&s=39 "")](https://github.com/Mrxx99)
356357
[![Eric Johnson](https://avatars.githubusercontent.com/u/26369281?u=41b560c2bc493149b32d384b960e0948c78767ab&v=4&s=39 "Eric Johnson")](https://github.com/eajhnsn1)
357-
[![David JENNI](https://avatars.githubusercontent.com/u/3200210?v=4&s=39 "David JENNI")](https://github.com/davidjenni)
358358
[![Jonathan ](https://avatars.githubusercontent.com/u/5510103?u=98dcfbef3f32de629d30f1f418a095bf09e14891&v=4&s=39 "Jonathan ")](https://github.com/Jonathan-Hickey)
359-
[![Charley Wu](https://avatars.githubusercontent.com/u/574719?u=ea7c743490c83e8e4b36af76000f2c71f75d636e&v=4&s=39 "Charley Wu")](https://github.com/akunzai)
360359
[![Ken Bonny](https://avatars.githubusercontent.com/u/6417376?u=569af445b6f387917029ffb5129e9cf9f6f68421&v=4&s=39 "Ken Bonny")](https://github.com/KenBonny)
361360
[![Simon Cropp](https://avatars.githubusercontent.com/u/122666?v=4&s=39 "Simon Cropp")](https://github.com/SimonCropp)
362361
[![agileworks-eu](https://avatars.githubusercontent.com/u/5989304?v=4&s=39 "agileworks-eu")](https://github.com/agileworks-eu)
363362
[![Zheyu Shen](https://avatars.githubusercontent.com/u/4067473?v=4&s=39 "Zheyu Shen")](https://github.com/arsdragonfly)
364363
[![Vezel](https://avatars.githubusercontent.com/u/87844133?v=4&s=39 "Vezel")](https://github.com/vezel-dev)
365364
[![ChilliCream](https://avatars.githubusercontent.com/u/16239022?v=4&s=39 "ChilliCream")](https://github.com/ChilliCream)
366365
[![4OTC](https://avatars.githubusercontent.com/u/68428092?v=4&s=39 "4OTC")](https://github.com/4OTC)
367-
[![Vincent Limo](https://avatars.githubusercontent.com/devlooped-user?s=39 "Vincent Limo")](https://github.com/v-limo)
368366
[![domischell](https://avatars.githubusercontent.com/u/66068846?u=0a5c5e2e7d90f15ea657bc660f175605935c5bea&v=4&s=39 "domischell")](https://github.com/DominicSchell)
369-
[![Justin Wendlandt](https://avatars.githubusercontent.com/u/1068431?u=f7715ed6a8bf926d96ec286f0f1c65f94bf86928&v=4&s=39 "Justin Wendlandt")](https://github.com/jwendl)
370367
[![Adrian Alonso](https://avatars.githubusercontent.com/u/2027083?u=129cf516d99f5cb2fd0f4a0787a069f3446b7522&v=4&s=39 "Adrian Alonso")](https://github.com/adalon)
371-
[![Michael Hagedorn](https://avatars.githubusercontent.com/u/61711586?u=8f653dfcb641e8c18cc5f78692ebc6bb3a0c92be&v=4&s=39 "Michael Hagedorn")](https://github.com/Eule02)
372368
[![torutek](https://avatars.githubusercontent.com/u/33917059?v=4&s=39 "torutek")](https://github.com/torutek)
373-
[![mccaffers](https://avatars.githubusercontent.com/u/16667079?u=739e110e62a75870c981640447efa5eb2cb3bc8f&v=4&s=39 "mccaffers")](https://github.com/mccaffers)
369+
[![mccaffers](https://avatars.githubusercontent.com/u/16667079?u=110034edf51097a5ee82cb6a94ae5483568e3469&v=4&s=39 "mccaffers")](https://github.com/mccaffers)
370+
[![Seika Logiciel](https://avatars.githubusercontent.com/u/2564602?v=4&s=39 "Seika Logiciel")](https://github.com/SeikaLogiciel)
371+
[![Andrew Grant](https://avatars.githubusercontent.com/devlooped-user?s=39 "Andrew Grant")](https://github.com/wizardness)
372+
[![Lars](https://avatars.githubusercontent.com/u/1727124?v=4&s=39 "Lars")](https://github.com/latonz)
374373

375374

376375
<!-- sponsors.md -->

0 commit comments

Comments
 (0)