Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ updates:
Web:
patterns:
- "Microsoft.AspNetCore*"
OpenTelemetry:
patterns:
- "OpenTelemetry*"
Tests:
patterns:
- "Microsoft.NET.Test*"
Expand Down
22 changes: 15 additions & 7 deletions .github/workflows/includes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ on:
jobs:
includes:
runs-on: ubuntu-latest
env:
PR_TOKEN: ${{ secrets.DEVLOOPED_TOKEN || secrets.GH_TOKEN }}
permissions:
contents: write
pull-requests: write
Expand All @@ -21,16 +23,16 @@ jobs:
with:
name: ${{ secrets.BOT_NAME }}
email: ${{ secrets.BOT_EMAIL }}
gh_token: ${{ secrets.GH_TOKEN }}
gh_token: ${{ env.PR_TOKEN }}
github_token: ${{ secrets.GITHUB_TOKEN }}

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

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

- name: 📝 OSMF EULA
shell: pwsh
Expand All @@ -50,18 +52,24 @@ jobs:
((get-content -raw $file) -replace '\$product\$',$product).trim() | set-content $file

- name: ✍ pull request
uses: peter-evans/create-pull-request@v6
if: env.PR_TOKEN != ''
uses: peter-evans/create-pull-request@v8
with:
add-paths: |
**.md
osmfeula.txt
*.txt
base: main
branch: markdown-includes
delete-branch: true
labels: docs
labels: dependencies
author: ${{ env.BOT_AUTHOR }}
committer: ${{ env.BOT_AUTHOR }}
commit-message: +Mᐁ includes
title: +Mᐁ includes
body: +Mᐁ includes
token: ${{ env.GH_TOKEN }}
token: ${{ env.PR_TOKEN }}

- name: ⚠️ skip pull request
if: env.PR_TOKEN == ''
shell: bash
run: echo "::warning::Skipping PR creation because neither DEVLOOPED_TOKEN nor GH_TOKEN is configured. GITHUB_TOKEN cannot create pull requests in this repository."
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,17 +1,24 @@
bin
obj
out
artifacts
pack
agent-tools
terminals
TestResults
results
BenchmarkDotNet.Artifacts
mcps
/app
/temp
.vs
.vscode
.genaiscript
.idea
local.settings.json
.env
.next
*.local

*.suo
*.sdf
Expand All @@ -25,6 +32,7 @@ local.settings.json
*.binlog
*.zip
__azurite*.*
AzuriteConfig
__*__

.nuget
Expand Down
47 changes: 37 additions & 10 deletions .netconfig
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
weak
[file ".gitignore"]
url = https://github.com/devlooped/oss/blob/main/.gitignore
sha = 3776526342afb3f57da7e80f2095e5fdca3c31c9
etag = 11767f73556aa4c6c8bcc153b77ee8e8114f99fa3b885b0a7d66d082f91e77b3
sha = ff61659751374b95c7a8a0477c908a8119f756f0
etag = e5865f083db45081a7b4eaa518018971b34e6ef93f917ac510dea96d27f792b3
weak
[file ".gitattributes"]
url = https://github.com/devlooped/oss/blob/main/.gitattributes
Expand All @@ -25,23 +25,23 @@
weak
[file ".github/workflows/includes.yml"]
url = https://github.com/devlooped/oss/blob/main/.github/workflows/includes.yml
sha = 26e8cb798ce72dec7072db826cc9694d456797bd
etag = df06492eeb2daaae4168d71bbb643f5da2693b67cdd58c42ffa44a191ee99b69
sha = d571412f07b0fb3c40023dc906f64906d7ed2b46
etag = ab627107749577bb619b024aff93027359b66b4c3f5a85a36b235e428387cd17
weak
[file "src/Directory.Build.props"]
url = https://github.com/devlooped/oss/blob/main/src/Directory.Build.props
sha = c509be4378ff6789df4f66338cb88119453c0975
etag = cbbdc1a4d3030f353f3e5306a6c380238dd4ed0945aad2d56ba87b49fcfcd66d
sha = 6e2438919e108aeb75106dc0737c45f5e55d5f42
etag = f1d6384abf18d8d891ce5e835a10c73fe029c42151374be96d7e4af43d189c65
weak
[file "src/Directory.Build.targets"]
url = https://github.com/devlooped/oss/blob/main/src/Directory.Build.targets
sha = 4339749ef4b8f66def75931df09ef99c149f8421
etag = 8b4492765755c030c4c351e058a92f53ab493cab440c1c0ef431f6635c4dae0e
sha = dcd5f0a9a00a5b0c23d41a71dcc66ea41dc5f75d
etag = 2cca66d8a1adbae24dc2efee53a55fa09949242eb35b86c5fd66425da18c6107
weak
[file ".github/dependabot.yml"]
url = https://github.com/devlooped/oss/blob/main/.github/dependabot.yml
sha = e733294084fb3e75d517a2e961e87df8faae7dc6
etag = 3bf8d9214a15c049ca5cfe80d212a8cbe4753b8a638a9804ef73d34c7def9618
sha = 387f0616b2c56adc4f33f2858da818f7e0d92ef3
etag = a1aaba1440e5ee2a7b7f93fc0fb004d4e1d4d9780350c753f7c429e37241345a
weak
[file ".github/workflows/changelog.config"]
url = https://github.com/devlooped/oss/blob/main/.github/workflows/changelog.config
Expand Down Expand Up @@ -111,3 +111,30 @@
sha = 0c23e24704625cf75b2cb1fdc566cef7e20af313
etag = 310df162242c95ed19ed12e3c96a65f77e558b46dced676ad5255eb12caafe75
weak
[file ".netconfig"]
url = https://github.com/devlooped/oss/blob/main/.netconfig
skip
[file "readme.md"]
url = https://github.com/devlooped/oss/blob/main/readme.md
skip
[file "readme.tmp.md"]
url = https://github.com/devlooped/oss/blob/main/readme.tmp.md
skip
[file "oss.cs"]
url = https://github.com/devlooped/oss/blob/main/oss.cs
skip
[file "Directory.Build.rsp"]
url = https://github.com/devlooped/oss/blob/main/Directory.Build.rsp
skip
[file "src/kzu.snk"]
url = https://github.com/devlooped/oss/blob/main/src/kzu.snk
skip
[file ".github/workflows/combine-prs.yml"]
url = https://github.com/devlooped/oss/blob/main/.github/workflows/combine-prs.yml
skip
[file ".github/workflows/dotnet-file-core.yml"]
url = https://github.com/devlooped/oss/blob/main/.github/workflows/dotnet-file-core.yml
skip
[file ".github/actions/dotnet/action.yml"]
url = https://github.com/devlooped/oss/blob/main/.github/actions/dotnet/action.yml
skip
22 changes: 21 additions & 1 deletion src/Directory.Build.props
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<Project>
<Project TreatAsLocalProperty="VersionPrefix">
<!-- To extend/change the defaults, create a Directory.props alongside this file -->

<PropertyGroup Label="CI" Condition="'$(CI)' == ''">
Expand Down Expand Up @@ -43,6 +43,13 @@

<!-- Ensure MSBuild tooling can access package artifacts always via PKG_[PackageId] -->
<GeneratePathProperty>true</GeneratePathProperty>
<!-- Avoid warnings for test projects when we run dotnet pack on the whole solution. -->
<WarnOnPackingNonPackableProject>false</WarnOnPackingNonPackableProject>
<!-- See https://learn.microsoft.com/en-us/nuget/consume-packages/package-references-in-project-files#prunepackagereference-specification -->
<RestoreEnablePackagePruning>true</RestoreEnablePackagePruning>

<!-- Needed to improve nuget default for empty PackageId. Workaround for https://github.com/NuGet/Home/issues/14928 -->
<ImportNuGetBuildTasksPackTargetsFromSdk>false</ImportNuGetBuildTasksPackTargetsFromSdk>
</PropertyGroup>

<PropertyGroup Label="Build">
Expand Down Expand Up @@ -134,6 +141,15 @@
<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>

<!-- In order for latest from main/master to always be greatest when using -prerelease switch on install/run,
we change the scheme as follows:
- main/master remain as today: VersionPrefix: 42.42.${{ github.run_number }} (from yaml)
- others: VersionPrefix: 42.42.0-[label].${{ github.run_number }}
-->
<IsMaster Condition="$(VersionLabel.Contains('refs/heads/main')) or $(VersionLabel.Contains('refs/heads/master'))">true</IsMaster>
<VersionPrefix Condition="'$(IsMaster)' != 'true'">42.42.0</VersionPrefix>
<VersionSuffix Condition="'$(IsMaster)' != 'true'">$(VersionSuffix).$(GITHUB_RUN_NUMBER)</VersionSuffix>
</PropertyGroup>

<ItemGroup Label="ThisAssembly.Project">
Expand All @@ -153,6 +169,10 @@
<Using Include="System.ArgumentNullException" Static="true" />
</ItemGroup>

<ItemGroup Label="OSMF" Condition="Exists('$(MSBuildThisFileDirectory)..\osmfeula.txt')">
<Content Include="$(MSBuildThisFileDirectory)..\osmfeula.txt" Link="osmfeula.txt" Pack="true" PackagePath="OSMFEULA.txt" Visible="false" />
</ItemGroup>

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

Expand Down
28 changes: 27 additions & 1 deletion src/Directory.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,22 @@
<IsPackable Condition="'$(PackageId)' != ''">true</IsPackable>
</PropertyGroup>

<PropertyGroup>
<!-- Save original PackageId to restore post-import -->
<_PackageId>$(PackageId)</_PackageId>
<!-- Since we set ImportNuGetBuildTasksPackTargetsFromSdk=false, the Sdk.targets doesn't even provide the path for this property :/ -->
<NuGetBuildTasksPackTargets Condition="'$(NuGetBuildTasksPackTargets)' == ''">$(MSBuildSDKsPath)\..\NuGet.Build.Tasks.Pack.targets</NuGetBuildTasksPackTargets>
</PropertyGroup>

<Import Project="$(NuGetBuildTasksPackTargets)" Condition="Exists('$(NuGetBuildTasksPackTargets)') And '$(NuGetize)' != 'true'" />

<PropertyGroup>
<!-- Revert the forced PackageId by the NuGet SDK targets for non-packable projects, see https://github.com/NuGet/Home/issues/14928 -->
<PackageId Condition="'$(IsPackable)' == 'false'">$(_PackageId)</PackageId>
<!-- If no PackageId was originally provided, ensure IsPackable is false -->
<IsPackable Condition="'$(_PackageId)' == ''">false</IsPackable>
</PropertyGroup>

<ItemGroup Condition="'$(IsPackable)' == 'true'" Label="NuGet">
<!-- This is compatible with nugetizer and SDK pack -->
<!-- Only difference is we don't copy either to output directory -->
Expand Down Expand Up @@ -174,7 +190,7 @@

<Target Name="UpdatePackageMetadata"
BeforeTargets="PrepareForBuild;GenerateMSBuildEditorConfigFileShouldRun;GetAssemblyVersion;GetPackageMetadata;GenerateNuspec;Pack"
DependsOnTargets="EnsureProjectInformation"
DependsOnTargets="EnsureProjectInformation;UpdatePackageLicense"
Condition="'$(SourceControlInformationFeatureSupported)' == 'true' And
'$(IsPackable)' == 'true'">
<PropertyGroup>
Expand All @@ -184,6 +200,16 @@
</PropertyGroup>
</Target>

<Target Name="UpdatePackageLicense">
<!-- If project has a None/Content item with PackagePath=OSMFEULA.txt -->
<PropertyGroup Condition="@(None -> WithMetadataValue('PackagePath', 'OSMFEULA.txt')) != '' or @(Content -> WithMetadataValue('PackagePath', 'OSMFEULA.txt')) != ''">
<PackageLicenseExpression></PackageLicenseExpression>
<PackageLicenseFile>OSMFEULA.txt</PackageLicenseFile>
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
</PropertyGroup>
</Target>


<!-- Import before UsingTask because first to declare tasks wins -->
<Import Project="Directory.targets" Condition="Exists('Directory.targets')"/>
<Import Project="Directory.targets.user" Condition="Exists('Directory.targets.user')" />
Expand Down
Loading