Skip to content

Commit

Permalink
⬆️ Bump files with dotnet-file sync
Browse files Browse the repository at this point in the history
# devlooped/oss

- SponsorLink-enabled analyzers need copylocal devlooped/oss@7593657
- Add our implementation of JWT manifest reading and reporting devlooped/oss@a0ae727
- Whitespace and formatting devlooped/oss@d74f511
- Rename sample assemblies for nicer display devlooped/oss@93df7c7
- Dynamically fetch devlooped JWK from github devlooped/oss@55124bc
- Minor code simplification devlooped/oss@cf154d5
- Remove dependency on ThisAssembly devlooped/oss@c879f25
- Add nullable and generated code annotations devlooped/oss@b2a11fa
- Fix path to jwk.ps1 alongside the SponsorLink.targets devlooped/oss@c4830fc
- Improve versioning of sample package devlooped/oss@3b943f5
- Fix scenario where multiple packages share product name devlooped/oss@23f83bd
- Minimal docs on consuming devlooped/oss@827a1d1
- Add targets for inclusion from tests devlooped/oss@81ba912
- Simplify and unify manifest reading implementation devlooped/oss@4fca946
- Update to checkout@v4 devlooped/oss@5fb1723
- Update dotnet-file.yml with fix to create pull request action devlooped/oss@11a331d
- Don't add random wait on manual dotnet-file runs devlooped/oss@7afe350
- Add static usings to allow unprefixed ThrowXxxx devlooped/oss@6dfe21f
- Add compatibility for non-SDK projects without InitializeSourceControlInformation target devlooped/oss@6e96c59
- Set Version from VersionLabel if it's a refs/tags/ devlooped/oss@57653a2
- Cleanup build and publish to use VersionLabel devlooped/oss@14deaea
- Bump create-pr dependency to avoid error with existing PRs devlooped/oss@11a8757
- Only commit markdown files when resolving includes devlooped/oss@2c10a83
  • Loading branch information
devlooped-bot committed Jun 26, 2024
1 parent 311904c commit a92b84d
Show file tree
Hide file tree
Showing 46 changed files with 2,654 additions and 49 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
github_token: ${{ secrets.GITHUB_TOKEN }}

- name: 🤘 checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: main
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/dotnet-file.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,15 @@ jobs:
github_token: ${{ secrets.GITHUB_TOKEN }}

- name: 🤘 checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: main
token: ${{ env.GH_TOKEN }}

- name: ⌛ rate
shell: pwsh
if: github.event_name != 'workflow_dispatch'
run: |
# add random sleep since we run on fixed schedule
sleep (get-random -max 60)
Expand Down Expand Up @@ -70,7 +71,7 @@ jobs:
validate: false

- name: ✍ pull request
uses: peter-evans/create-pull-request@v4
uses: peter-evans/create-pull-request@v6
with:
base: main
branch: dotnet-file-sync
Expand Down
5 changes: 3 additions & 2 deletions .github/workflows/includes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,17 @@ jobs:
github_token: ${{ secrets.GITHUB_TOKEN }}

- name: 🤘 checkout
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
token: ${{ env.GH_TOKEN }}

- name: +Mᐁ includes
uses: devlooped/actions-includes@v1

- name: ✍ pull request
uses: peter-evans/create-pull-request@v4
uses: peter-evans/create-pull-request@v6
with:
add-paths: '**/*.md'
base: main
branch: markdown-includes
delete-branch: true
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/sponsor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
steps:
- name: 🤘 checkout
if: env.token != ''
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: 💜 sponsor
if: env.token != ''
Expand Down
5 changes: 0 additions & 5 deletions .netconfig
Original file line number Diff line number Diff line change
Expand Up @@ -102,11 +102,6 @@
sha = 0683ee777d7d878d4bf013d7deea352685135a05
etag = b8d789b5b6bea017cdcc8badcea888ad78de3e34298efca922054e9fb0e7b6b9
weak
[file "src/nuget.config"]
url = https://github.com/devlooped/oss/blob/main/src/nuget.config
sha = b2fa09bd9db6de89e37a8ba6705b5659e435dafd
etag = eb2d09e546aa1e11c0b464d9ed6ab2d3c028a1d86c3ac40a318053625fb72819
weak
[file ".github/workflows/combine-prs.yml"]
url = https://github.com/devlooped/oss/blob/main/.github/workflows/combine-prs.yml
sha = c1610886eba42cb250e3894aed40c0a258cd383d
Expand Down
8 changes: 3 additions & 5 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,14 +95,12 @@ snapshots of the day the release build runs, fetched from:
[![Kori Francis](https://raw.githubusercontent.com/devlooped/sponsors/main/.github/avatars/kfrancis.png "Kori Francis")](https://github.com/kfrancis)
[![Toni Wenzel](https://raw.githubusercontent.com/devlooped/sponsors/main/.github/avatars/twenzel.png "Toni Wenzel")](https://github.com/twenzel)
[![Giorgi Dalakishvili](https://raw.githubusercontent.com/devlooped/sponsors/main/.github/avatars/Giorgi.png "Giorgi Dalakishvili")](https://github.com/Giorgi)
[![Mike James](https://raw.githubusercontent.com/devlooped/sponsors/main/.github/avatars/MikeCodesDotNET.png "Mike James")](https://github.com/MikeCodesDotNET)
[![Uno Platform](https://raw.githubusercontent.com/devlooped/sponsors/main/.github/avatars/unoplatform.png "Uno Platform")](https://github.com/unoplatform)
[![Dan Siegel](https://raw.githubusercontent.com/devlooped/sponsors/main/.github/avatars/dansiegel.png "Dan Siegel")](https://github.com/dansiegel)
[![Reuben Swartz](https://raw.githubusercontent.com/devlooped/sponsors/main/.github/avatars/rbnswartz.png "Reuben Swartz")](https://github.com/rbnswartz)
[![Jacob Foshee](https://raw.githubusercontent.com/devlooped/sponsors/main/.github/avatars/jfoshee.png "Jacob Foshee")](https://github.com/jfoshee)
[![](https://raw.githubusercontent.com/devlooped/sponsors/main/.github/avatars/Mrxx99.png "")](https://github.com/Mrxx99)
[![Eric Johnson](https://raw.githubusercontent.com/devlooped/sponsors/main/.github/avatars/eajhnsn1.png "Eric Johnson")](https://github.com/eajhnsn1)
[![Norman Mackay](https://raw.githubusercontent.com/devlooped/sponsors/main/.github/avatars/mackayn.png "Norman Mackay")](https://github.com/mackayn)
[![Certify The Web](https://raw.githubusercontent.com/devlooped/sponsors/main/.github/avatars/certifytheweb.png "Certify The Web")](https://github.com/certifytheweb)
[![Ix Technologies B.V.](https://raw.githubusercontent.com/devlooped/sponsors/main/.github/avatars/IxTechnologies.png "Ix Technologies B.V.")](https://github.com/IxTechnologies)
[![David JENNI](https://raw.githubusercontent.com/devlooped/sponsors/main/.github/avatars/davidjenni.png "David JENNI")](https://github.com/davidjenni)
[![Jonathan ](https://raw.githubusercontent.com/devlooped/sponsors/main/.github/avatars/Jonathan-Hickey.png "Jonathan ")](https://github.com/Jonathan-Hickey)
Expand All @@ -112,14 +110,14 @@ snapshots of the day the release build runs, fetched from:
[![Seann Alexander](https://raw.githubusercontent.com/devlooped/sponsors/main/.github/avatars/seanalexander.png "Seann Alexander")](https://github.com/seanalexander)
[![Tino Hager](https://raw.githubusercontent.com/devlooped/sponsors/main/.github/avatars/tinohager.png "Tino Hager")](https://github.com/tinohager)
[![Mark Seemann](https://raw.githubusercontent.com/devlooped/sponsors/main/.github/avatars/ploeh.png "Mark Seemann")](https://github.com/ploeh)
[![Angelo Belchior](https://raw.githubusercontent.com/devlooped/sponsors/main/.github/avatars/angelobelchior.png "Angelo Belchior")](https://github.com/angelobelchior)
[![Ken Bonny](https://raw.githubusercontent.com/devlooped/sponsors/main/.github/avatars/KenBonny.png "Ken Bonny")](https://github.com/KenBonny)
[![Simon Cropp](https://raw.githubusercontent.com/devlooped/sponsors/main/.github/avatars/SimonCropp.png "Simon Cropp")](https://github.com/SimonCropp)
[![agileworks-eu](https://raw.githubusercontent.com/devlooped/sponsors/main/.github/avatars/agileworks-eu.png "agileworks-eu")](https://github.com/agileworks-eu)
[![sorahex](https://raw.githubusercontent.com/devlooped/sponsors/main/.github/avatars/sorahex.png "sorahex")](https://github.com/sorahex)
[![Zheyu Shen](https://raw.githubusercontent.com/devlooped/sponsors/main/.github/avatars/arsdragonfly.png "Zheyu Shen")](https://github.com/arsdragonfly)
[![Vezel](https://raw.githubusercontent.com/devlooped/sponsors/main/.github/avatars/vezel-dev.png "Vezel")](https://github.com/vezel-dev)
[![Georg Jung](https://raw.githubusercontent.com/devlooped/sponsors/main/.github/avatars/georg-jung.png "Georg Jung")](https://github.com/georg-jung)
[![ChilliCream](https://raw.githubusercontent.com/devlooped/sponsors/main/.github/avatars/ChilliCream.png "ChilliCream")](https://github.com/ChilliCream)
[![4OTC](https://raw.githubusercontent.com/devlooped/sponsors/main/.github/avatars/4OTC.png "4OTC")](https://github.com/4OTC)


<!-- sponsors.md -->
Expand Down
16 changes: 15 additions & 1 deletion src/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,8 @@

<PropertyGroup Label="Version" Condition="$(VersionLabel) != ''">
<_VersionLabel>$(VersionLabel.Replace('refs/heads/', ''))</_VersionLabel>
<_VersionLabel>$(_VersionLabel.Replace('refs/tags/v', ''))</_VersionLabel>

<!-- For PRs, we just need a fixed package version numbered after the PR # itself, so remove the commits # at the end -->
<_VersionLabel Condition="$(_VersionLabel.Contains('refs/pull/'))">$(VersionLabel.TrimEnd('.0123456789'))</_VersionLabel>
<!-- Next replace the prefix for simply 'pr', so we end up with 'pr99/merge' by default -->
Expand All @@ -128,7 +130,9 @@
<_VersionLabel>$(_VersionLabel.Replace('/', '-'))</_VersionLabel>

<!-- Set sanitized version to the actual version suffix used in build/pack -->
<VersionSuffix>$(_VersionLabel)</VersionSuffix>
<VersionSuffix Condition="!$(VersionLabel.Contains('refs/tags/'))">$(_VersionLabel)</VersionSuffix>
<!-- Special case for tags, the label is actually the version. Backs compat since passed-in value overrides MSBuild-set one -->
<Version Condition="$(VersionLabel.Contains('refs/tags/'))">$(_VersionLabel)</Version>
</PropertyGroup>

<ItemGroup Label="ThisAssembly.Project">
Expand All @@ -142,6 +146,16 @@
<ProjectProperty Include="PublicKeyToken" />
</ItemGroup>

<ItemGroup Label="Throw">
<Using Include="System.ArgumentException" Static="true" />
<Using Include="System.ArgumentOutOfRangeException" Static="true" />
<Using Include="System.ArgumentNullException" Static="true" />
</ItemGroup>

<Import Project="Directory.props" Condition="Exists('Directory.props')"/>
<Import Project="Directory.props.user" Condition="Exists('Directory.props.user')" />

<!-- Implemented by SDK in .targets, guaranteeing it's overwritten. Added here since we add a DependsOnTargets to it.
Covers backwards compatiblity with non-SDK projects. -->
<Target Name="InitializeSourceControlInformation" />
</Project>
37 changes: 37 additions & 0 deletions src/SponsorLink/Analyzer/Analyzer.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<AssemblyName>SponsorableLib.Analyzers</AssemblyName>
<TargetFramework>netstandard2.0</TargetFramework>
<IsRoslynComponent>true</IsRoslynComponent>
<PackFolder>analyzers/dotnet/roslyn4.0</PackFolder>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<CustomAfterMicrosoftCSharpTargets>$(MSBuildThisFileDirectory)..\SponsorLink.targets</CustomAfterMicrosoftCSharpTargets>
<MergeAnalyzerAssemblies>true</MergeAnalyzerAssemblies>
<ImplicitUsings>disable</ImplicitUsings>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="NuGetizer" Version="1.2.2" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="4.3.1" Pack="false" />
<PackageReference Include="PolySharp" Version="1.14.1" PrivateAssets="all" />
<PackageReference Include="ThisAssembly.AssemblyInfo" Version="1.4.3" PrivateAssets="all" />
<PackageReference Include="ThisAssembly.Git" Version="1.4.3" PrivateAssets="all" />
<PackageReference Include="ThisAssembly.Constants" Version="1.4.3" PrivateAssets="all" />
<PackageReference Include="ThisAssembly.Strings" Version="1.4.3" PrivateAssets="all" />
<PackageReference Include="ThisAssembly.Project" Version="1.4.3" PrivateAssets="all" />
</ItemGroup>

<ItemGroup>
<InternalsVisibleTo Include="Tests" />
</ItemGroup>

<ItemGroup>
<None Update="buildTransitive\SponsorableLib.targets" Pack="true" />
</ItemGroup>

<ItemGroup>
<Compile Remove="C:\Code\devlooped.oss\src\SponsorLink\SponsorLink\ThisAssembly.cs" />
</ItemGroup>

</Project>
11 changes: 11 additions & 0 deletions src/SponsorLink/Analyzer/Properties/launchSettings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"profiles": {
"SponsorableLib": {
"commandName": "DebugRoslynComponent",
"targetProject": "..\\Tests\\Tests.csproj",
"environmentVariables": {
"SPONSORLINK_TRACE": "true"
}
}
}
}
25 changes: 25 additions & 0 deletions src/SponsorLink/Analyzer/StatusReportingAnalyzer.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
using System.Collections.Immutable;
using Devlooped.Sponsors;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.Diagnostics;
using static Devlooped.Sponsors.SponsorLink;

namespace Analyzer;

[DiagnosticAnalyzer(LanguageNames.CSharp)]
public class StatusReportingAnalyzer : DiagnosticAnalyzer
{
public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics => ImmutableArray<DiagnosticDescriptor>.Empty;

public override void Initialize(AnalysisContext context)
{
context.EnableConcurrentExecution();
context.ConfigureGeneratedCodeAnalysis(GeneratedCodeAnalysisFlags.None);

context.RegisterCodeBlockAction(c =>
{
var status = Diagnostics.GetStatus(Funding.Product);
Tracing.Trace($"Status: {status}");
});
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="Devlooped.Sponsors.targets"/>
</Project>
47 changes: 47 additions & 0 deletions src/SponsorLink/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
<Project>

<PropertyGroup>
<GenerateDocumentationFile>false</GenerateDocumentationFile>
<LangVersion>latest</LangVersion>
<ImplicitUsings>true</ImplicitUsings>
<Nullable>annotations</Nullable>
<PackOnBuild>true</PackOnBuild>
<!-- Avoid deleting older packed versions to avoid rebuild errors (since package is in same solution, which is uncommon) -->
<EnablePackCleanup>false</EnablePackCleanup>
<PackageOutputPath>$([System.IO.Path]::GetFullPath('$(MSBuildThisFileDirectory)bin'))</PackageOutputPath>

<RestoreSources>https://pkg.kzu.app/index.json;https://api.nuget.org/v3/index.json</RestoreSources>
<RestoreSources Condition="Exists('$(PackageOutputPath)')">$(PackageOutputPath);$(RestoreSources)</RestoreSources>

<!-- Roslyn caches analyzers aggressively so we are better off using a very dynamic version number
for local builds where a quick devloop is key. We bump version every 10 seconds -->
<Epoc>$([System.DateTime]::Parse("2024-03-15"))</Epoc>
<TotalDays>$([System.DateTime]::UtcNow.Subtract($(Epoc)).TotalDays)</TotalDays>
<Days>$([System.Math]::Truncate($(TotalDays)))</Days>
<Seconds>$([System.Math]::Floor($([MSBuild]::Divide($([System.DateTime]::UtcNow.TimeOfDay.TotalSeconds), 10))))</Seconds>
<Version>42.$(Days).$(Seconds)</Version>

<Product>SponsorableLib</Product>
</PropertyGroup>

<ItemGroup>
<!--<Constant Include="Funding.Product" Value="$(Product)" />
<Constant Include="Funding.AnalyzerPrefix" Value="SLIB" />-->
<!--<Constant Include="Funding.GraceDays" Value="21" />-->
</ItemGroup>

<!-- DOGFOODING LOCAL BUILDS -->
<!-- Create a Directory.targets.user alongside this file, with the following content
(update the version number to the number of the built local package): -->
<!--
<Project>
<ItemGroup Condition="Exists('$(DevPath)')">
<PackageReference Update="@(PackageReference -> WithMetadataValue('Identity', 'Devlooped.SponsorLink'))"
Version="42.42.6587" />
</ItemGroup>
</Project>
-->

</Project>
8 changes: 8 additions & 0 deletions src/SponsorLink/Directory.Build.targets
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<Project>

<ItemGroup Condition="Exists('$(PackageOutputPath)\SponsorableLib.$(Version).nupkg')">
<PackageReference Update="@(PackageReference -> WithMetadataValue('Identity', 'SponsorableLib'))"
Version="$(Version)" />
</ItemGroup>

</Project>
21 changes: 21 additions & 0 deletions src/SponsorLink/Library/Library.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<AssemblyName>SponsorableLib</AssemblyName>
<TargetFramework>netstandard2.0</TargetFramework>
<PackNone>true</PackNone>
<PackageId>SponsorableLib</PackageId>
<Description>Sample library incorporating SponsorLink checks</Description>
<PackOnBuild>true</PackOnBuild>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="NuGetizer" Version="1.2.2" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\Analyzer\Analyzer.csproj" ReferenceOutputAssembly="false" OutputType="Analyzer" />
</ItemGroup>

</Project>
5 changes: 5 additions & 0 deletions src/SponsorLink/Library/MyClass.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
namespace SponsorableLib;

public class MyClass
{
}
Loading

0 comments on commit a92b84d

Please sign in to comment.