Skip to content

Commit 4b77870

Browse files
committed
🖆 Apply kzu/oss template via dotnet-file
1 parent e0ac0ff commit 4b77870

8 files changed

+88
-61
lines changed

.github/FUNDING.yml

+1-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1 @@
1-
custom: https://paypal.me/kzu
2-
patreon: danielkzu
3-
open_collective: kzu
4-
liberapay: kzu
1+
github: devloooped

.github/workflows/build.yml

+18-8
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,23 @@ defaults:
1616
shell: bash
1717

1818
jobs:
19+
dotnet-format:
20+
runs-on: ubuntu-latest
21+
steps:
22+
- name: 🤘 checkout
23+
uses: actions/checkout@v2
24+
- name: ⚙ dotnet 3.1.x
25+
uses: actions/setup-dotnet@v1
26+
with:
27+
dotnet-version: 3.1.x
28+
- name: ✓ ensure format
29+
run: |
30+
dotnet tool update -g --version 4.1.* dotnet-format
31+
dotnet format -f src --check -v:diag
32+
1933
build:
2034
name: build-${{ matrix.os }}
35+
needs: dotnet-format
2136
runs-on: ${{ matrix.os }}
2237
strategy:
2338
matrix:
@@ -42,27 +57,22 @@ jobs:
4257
with:
4358
dotnet-version: 2.1.x
4459

45-
- name: ✓ check formatting
46-
run: |
47-
dotnet tool update -g --version 4.1.* dotnet-format >nul || dotnet tool list -g
48-
dotnet format -f src --check -v:diag
49-
5060
- name: 🙏 build
51-
run: dotnet build -m:1 -bl:build.binlog -p:VersionLabel="$GITHUB_REF.$GITHUB_RUN_NUMBER"
61+
run: dotnet build -m:1 -bl:build.binlog -p:VersionLabel="$GITHUB_REF.$GITHUB_RUN_NUMBER" -p:RepositoryBranch=${GITHUB_REF#refs/*/}
5262

5363
- name: 🧪 test
5464
run: dotnet test --no-build -m:1 --blame-hang --blame-hang-timeout 5m -d $GITHUB_WORKSPACE/logs/${{ matrix.os }}.txt -r $GITHUB_WORKSPACE/logs
5565

5666
- name: 📦 pack
57-
run: dotnet pack -m:1 -bl:pack.binlog -p:VersionLabel="$GITHUB_REF.$GITHUB_RUN_NUMBER"
67+
run: dotnet pack -m:1 -bl:pack.binlog -p:VersionLabel="$GITHUB_REF.$GITHUB_RUN_NUMBER" -p:RepositoryBranch=${GITHUB_REF#refs/*/}
5868

5969
- name: 🔼 logs
6070
if: always()
6171
uses: actions/upload-artifact@v2
6272
with:
6373
name: ${{ matrix.os }}
6474
path: |
65-
*.binlog
75+
**/*.binlog
6676
logs/**/*.*
6777
6878
# Only push CI package to sleet feed if building on ubuntu (fastest)

.github/workflows/release.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -35,19 +35,19 @@ jobs:
3535
dotnet-version: 2.1.x
3636

3737
- name: 🙏 build
38-
run: dotnet build -m:1 -bl:build.binlog -p:version=${GITHUB_REF#refs/*/v}
38+
run: dotnet build -m:1 -bl:build.binlog -p:version=${GITHUB_REF#refs/*/v} -p:RepositoryBranch=${GITHUB_REF#refs/*/}
3939

4040
- name: 🧪 test
4141
run: dotnet test --no-build -m:1
4242

4343
- name: 📦 pack
44-
run: dotnet pack -m:1 -bl:pack.binlog -p:version=${GITHUB_REF#refs/*/v}
44+
run: dotnet pack -m:1 -bl:pack.binlog -p:version=${GITHUB_REF#refs/*/v} -p:RepositoryBranch=${GITHUB_REF#refs/*/}
4545

4646
- name: 🔼 logs
4747
if: ${{ always() }}
4848
uses: actions/upload-artifact@v2
4949
with:
50-
path: '*.binlog'
50+
path: '**/*.binlog'
5151

5252
- name: 🚀 nuget
5353
run: dotnet nuget push ./bin/**/*.nupkg -s https://api.nuget.org/v3/index.json -k ${{secrets.NUGET_API_KEY}} --skip-duplicate

.netconfig

+10-6
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
weak
2020
[file ".github/FUNDING.yml"]
2121
url = https://github.com/kzu/oss/blob/main/.github/FUNDING.yml
22-
etag = dbc0e0c56e48bf06a70f50ba2fdaf6f048bb81ac8558b743c8e919487da3bfcf
22+
etag = 175f855cce8867cc01b44fd7b0d9985f7280d7b545db9ec8e1b07eca8ef85f82
2323
weak
2424
[file ".github/ISSUE_TEMPLATE/bug.md"]
2525
url = https://github.com/kzu/oss/blob/main/.github/ISSUE_TEMPLATE/bug.md
@@ -31,11 +31,11 @@
3131
weak
3232
[file ".github/workflows/build.yml"]
3333
url = https://github.com/kzu/oss/blob/main/.github/workflows/build.yml
34-
etag = c56db40b37f8dbcff13aea20eefc263caf825d17d86b0dc055ce504d8cb8ae9d
34+
etag = 868172e62b2cac855039731fd1ea929f0a569f675586903450d24bc232c43ea9
3535
weak
3636
[file ".github/workflows/release.yml"]
3737
url = https://github.com/kzu/oss/blob/main/.github/workflows/release.yml
38-
etag = 0142be91e1ec4607aa398975c4e066ea07f9a610b412eaf53f9f2f9d86aa70fc
38+
etag = 9035cfc96bc6340476e196699695b49a19066039e8774497659413f8a8cb8e2a
3939
weak
4040
[file ".github/workflows/tag.yml"]
4141
url = https://github.com/kzu/oss/blob/main/.github/workflows/tag.yml
@@ -67,15 +67,15 @@
6767
weak
6868
[file "security.md"]
6969
url = https://github.com/kzu/oss/blob/main/security.md
70-
etag = 80070e3a380796b13d180b82f43694eac9e7a29d8d2f8549ccb2920fd5c88828
70+
etag = fc8101fd914820db3e6b42d608dc46aefbc60c830ac721ed3917daead3727dbd
7171
weak
7272
[file "src/Directory.Build.props"]
7373
url = https://github.com/kzu/oss/blob/main/src/Directory.Build.props
74-
etag = d0b93d7533832a4d62cff69c71540bad3284bf92a7d2096b1a91607d72099d2b
74+
etag = 1ea71942b9ff7830612ceb3a2927c0d011c54891a7653b07ef01b914347e306f
7575
weak
7676
[file "src/Directory.Build.targets"]
7777
url = https://github.com/kzu/oss/blob/main/src/Directory.Build.targets
78-
etag = a8ae94f091decde21c9f9b2d851647c1cb573746956c29448346d0ccb1478652
78+
etag = 236390b1c5b2576d6d013656e24f6d74a0042a0e4071a19e8c626cf6b7005b54
7979
weak
8080
[file "src/kzu.snk"]
8181
url = https://github.com/kzu/oss/blob/main/src/kzu.snk
@@ -85,3 +85,7 @@
8585
url = https://github.com/kzu/oss/blob/main/.github/ISSUE_TEMPLATE/config.yml
8686
etag = b5ce64e6967276086eb89f86f57364da9c4deac988c7e0e04810a4f8caaa1400
8787
weak
88+
[file "support.md"]
89+
url = https://github.com/devlooped/oss/blob/main/support.md
90+
etag = 2d47e2fc4fdfa3515203d452674566e3df507461f9938f451a06d79deb687d24
91+
weak

security.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
## Reporting a Vulnerability
44

5-
Security issues and bugs should be reported privately by emailing hello@clarius.org.
5+
Security issues and bugs should be reported privately by emailing security@devlooped.com.
66
You should receive a response within 24 hours. If for some reason you do not, please follow up via email to ensure we received your
7-
original message and ping [@kzu](https://twitter.com/kzu) on Twitter.
7+
original message and ping [@devlooped](https://twitter.com/devlooped) on Twitter.
88

99
Please do not open issues for anything you think might have a security implication.

src/Directory.Build.props

+26-23
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,23 @@
11
<Project>
22
<!-- To extend/change the defaults, create a Directory.props alongside this file -->
33

4+
<PropertyGroup Label="CI" Condition="'$(CI)' == ''">
5+
<CI>false</CI>
6+
<!-- GH, CircleCI, GitLab and BitBucket already use CI -->
7+
<CI Condition="'$(TF_BUILD)' == 'true' or
8+
'$(TEAMCITY_VERSION)' != '' or
9+
'$(APPVEYOR)' != '' or
10+
'$(BuildRunner)' == 'MyGet' or
11+
'$(JENKINS_URL)' != '' or
12+
'$(TRAVIS)' == 'true' or
13+
'$(BUDDY)' == 'true'">true</CI>
14+
</PropertyGroup>
15+
16+
<PropertyGroup>
17+
<!-- The Microsoft.Managed.Core.targets use this property to use deterministic source paths in CI builds -->
18+
<ContinuousIntegrationBuild>$(CI)</ContinuousIntegrationBuild>
19+
</PropertyGroup>
20+
421
<PropertyGroup Label="NuGet">
522
<Authors>kzu</Authors>
623
<Copyright>Copyright (C) Daniel Cazzulino and Contributors. All rights reserved.</Copyright>
@@ -21,11 +38,10 @@
2138

2239
<ItemGroup Label="NuGet">
2340
<!-- This is compatible with nugetizer and SDK pack -->
24-
<Content Include="$(MSBuildThisFileDirectory)icon.png" Link="icon.png"
25-
CopyToOutputDirectory="PreserveNewest"
26-
Pack="true"
27-
Visible="false"
28-
PackagePath="%(Filename)%(Extension)" />
41+
<None Include="$(MSBuildThisFileDirectory)icon.png" Link="icon.png"
42+
Pack="true"
43+
Visible="false"
44+
PackagePath="%(Filename)%(Extension)" />
2945
</ItemGroup>
3046

3147
<PropertyGroup Label="Build">
@@ -68,6 +84,11 @@
6884

6985
<!-- See: https://www.cazzulino.com/project-dependencies-as-project-references.html -->
7086
<AddSyntheticProjectReferencesForSolutionDependencies>false</AddSyntheticProjectReferencesForSolutionDependencies>
87+
88+
<!-- Don't warn for packages using semver 2.0 -->
89+
<NoWarn>NU5105;$(NoWarn)</NoWarn>
90+
<!-- Turn warnings into errors in CI or Release builds -->
91+
<WarningsAsErrors Condition="$(CI) or '$(Configuration)' == 'Release'">true</WarningsAsErrors>
7192
</PropertyGroup>
7293

7394
<PropertyGroup Label="Version">
@@ -106,23 +127,5 @@
106127
<ProjectProperty Include="PublicKeyToken" />
107128
</ItemGroup>
108129

109-
110-
<PropertyGroup Label="CI" Condition="'$(CI)' == ''">
111-
<CI>false</CI>
112-
<!-- GH, CircleCI, GitLab and BitBucket already use CI -->
113-
<CI Condition="'$(TF_BUILD)' == 'true' or
114-
'$(TEAMCITY_VERSION)' != '' or
115-
'$(APPVEYOR)' != '' or
116-
'$(BuildRunner)' == 'MyGet' or
117-
'$(JENKINS_URL)' != '' or
118-
'$(TRAVIS)' == 'true' or
119-
'$(BUDDY)' == 'true'">true</CI>
120-
</PropertyGroup>
121-
122-
<PropertyGroup>
123-
<!-- The Microsoft.Managed.Core.targets use this property to use deterministic source paths in CI builds -->
124-
<ContinuousIntegrationBuild>$(CI)</ContinuousIntegrationBuild>
125-
</PropertyGroup>
126-
127130
<Import Project="Directory.props" Condition="Exists('Directory.props')"/>
128131
</Project>

src/Directory.Build.targets

+19-15
Original file line numberDiff line numberDiff line change
@@ -59,32 +59,36 @@
5959
</ItemGroup>
6060

6161
<!-- Make sure the source control info is available before calling source generators -->
62-
<Target Name="EnsureProjectInformation" BeforeTargets="GenerateMSBuildEditorConfigFileShouldRun" DependsOnTargets="InitializeSourceControlInformation" />
62+
<Target Name="EnsureProjectInformation"
63+
BeforeTargets="GenerateMSBuildEditorConfigFileShouldRun"
64+
AfterTargets="InitializeSourceControlInformation"
65+
DependsOnTargets="InitializeSourceControlInformation">
66+
67+
<PropertyGroup Condition="'$(SourceControlInformationFeatureSupported)' == 'true'">
68+
<!-- The project must specify PublishRepositoryUrl=true in order to publish the URL, in order to prevent inadvertent leak of internal URL. -->
69+
<RepositoryUrl Condition="'$(RepositoryUrl)' == '' and '$(PublishRepositoryUrl)' == 'true'">$(PrivateRepositoryUrl)</RepositoryUrl>
70+
</PropertyGroup>
71+
72+
<PropertyGroup Condition="'$(SourceRevisionId)' != ''">
73+
<RepositoryCommit Condition="'$(RepositoryCommit)' == ''">$(SourceRevisionId)</RepositoryCommit>
74+
<RepositorySha Condition="'$(RepositorySha)' == ''">$(SourceRevisionId.Substring(0, 9))</RepositorySha>
75+
<!-- This allows the commit label added to the InformationalVersion to be the short sha instead :) -->
76+
<SourceRevisionId>$(RepositorySha)</SourceRevisionId>
77+
</PropertyGroup>
6378

64-
<Target Name="_InitializeRepositoryProperties"
65-
DependsOnTargets="InitializeSourceControlInformation"
66-
Condition="'$(SourceControlInformationFeatureSupported)' == 'true'">
67-
<PropertyGroup>
68-
</PropertyGroup>
6979
</Target>
7080

7181
<!-- Always append the link to the direct source tree for the current build -->
7282
<Target Name="UpdatePackageMetadata"
7383
BeforeTargets="PrepareForBuild;GenerateMSBuildEditorConfigFileShouldRun;GetAssemblyVersion;GetPackageMetadata;GenerateNuspec;Pack"
74-
DependsOnTargets="InitializeSourceControlInformation"
84+
DependsOnTargets="EnsureProjectInformation"
7585
Condition="'$(SourceControlInformationFeatureSupported)' == 'true' And
7686
'$(IsPackable)' == 'true'">
7787
<PropertyGroup>
78-
<!-- The project must specify PublishRepositoryUrl=true in order to publish the URL, in order to prevent inadvertent leak of internal URL. -->
79-
<RepositoryUrl Condition="'$(RepositoryUrl)' == '' and '$(PublishRepositoryUrl)' == 'true'">$(PrivateRepositoryUrl)</RepositoryUrl>
8088
<PackageProjectUrl Condition="'$(PackageProjectUrl)' == '' and '$(PublishRepositoryUrl)' == 'true'">$(RepositoryUrl)</PackageProjectUrl>
89+
<Description Condition="'$(RepositorySha)' != '' and '$(RepositoryUrl)' != ''">$(Description)
8190

82-
<RepositoryCommit Condition="'$(RepositoryCommit)' == ''">$(SourceRevisionId)</RepositoryCommit>
83-
<RepositorySha Condition="'$(SourceRevisionId)' != ''">$(SourceRevisionId.Substring(0, 9))</RepositorySha>
84-
85-
<Description Condition="'$(SourceRevisionId)' != '' and '$(RepositoryUrl)' != ''">$(Description)
86-
87-
Built from $(RepositoryUrl)/tree/$(SourceRevisionId.Substring(0, 9))
91+
Built from $(RepositoryUrl)/tree/$(RepositorySha)
8892
</Description>
8993
<PackageDescription>$(Description)</PackageDescription>
9094
</PropertyGroup>

support.md

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Support
2+
3+
Support is typically available thorugh GitHub Discussions and Issues.
4+
5+
**Found a bug? File an issue.** If you found something that isn't working as expected and you can reproduce it, go to the repo Issues tab and file an issue.
6+
7+
**Want a new feature? Start a discussion.** It's always good to start a discussion (Discussion tab in the project, Ideas category) to explain the problem you're trying to solve before jumping in with the pull request. We may already have a solution in place or have an idea on ways to solve that issue. After the details are nailed down, we will migrate the discussion to a proper Issue (with the `enhancement`) label. At that point, we'd love to see your PRs :).
8+
9+
Consider [sponsoring](https://github.com/sponsors/devlooped) the project to get priority support and many other perks!

0 commit comments

Comments
 (0)