Skip to content

Commit fb4431f

Browse files
committed
Bump files with dotnet-file sync
# devlooped/oss - Add nuget.org as first restore source, for convenience devlooped/oss@3f294a1 - Automatically set/include icon.png and readme.md devlooped/oss@e260665 - If PackFolder is specified, assume IsPackable=true devlooped/oss@b0249cf - Automatically retry failed tests up to 5 times devlooped/oss@8bc16a7 - Ensure GNU grep is used on macOS devlooped/oss@964caa3 - Ignore TestResults folders devlooped/oss@a9f9d3f
1 parent 75ac3c4 commit fb4431f

File tree

6 files changed

+112
-26
lines changed

6 files changed

+112
-26
lines changed

.github/workflows/build.yml

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,41 @@ jobs:
5454
- name: 🙏 build
5555
run: dotnet build -m:1 -p:VersionLabel="$GITHUB_REF.$GITHUB_RUN_NUMBER"
5656

57+
- name: ⚙ GNU grep
58+
if: matrix.os == 'macOS-latest'
59+
run: |
60+
brew install grep
61+
echo 'export PATH="/usr/local/opt/grep/libexec/gnubin:$PATH"' >> .bash_profile
62+
5763
- name: 🧪 test
58-
run: dotnet test --no-build -m:1 --blame-hang --blame-hang-timeout 5m
64+
shell: bash --noprofile --norc {0}
65+
env:
66+
LC_ALL: en_US.utf8
67+
run: |
68+
[ -f .bash_profile ] && source .bash_profile
69+
counter=0
70+
exitcode=0
71+
reset="\e[0m"
72+
warn="\e[0;33m"
73+
while [ $counter -lt 6 ]
74+
do
75+
if [ $filter ]
76+
then
77+
echo -e "${warn}Retry $counter for $filter ${reset}"
78+
fi
79+
# run test and forward output also to a file in addition to stdout (tee command)
80+
dotnet test --no-build -m:1 --blame-hang --blame-hang-timeout 5m --filter=$filter | tee ./output.log
81+
# capture dotnet test exit status, different from tee
82+
exitcode=${PIPESTATUS[0]}
83+
if [ $exitcode == 0 ]
84+
then
85+
exit 0
86+
fi
87+
# cat output, get failed test names, join as DisplayName=TEST with |, remove trailing |.
88+
filter=$(cat ./output.log | grep -o -P '(?<=\sFailed\s)\w*' | awk 'BEGIN { ORS="|" } { print("DisplayName=" $0) }' | grep -o -P '.*(?=\|$)')
89+
((counter++))
90+
done
91+
exit $exitcode
5992
6093
- name: 📦 pack
6194
run: dotnet pack -m:1 -p:VersionLabel="$GITHUB_REF.$GITHUB_RUN_NUMBER"

.github/workflows/publish.yml

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,41 @@ jobs:
2424
- name: 🙏 build
2525
run: dotnet build -m:1 -p:version=${GITHUB_REF#refs/*/v}
2626

27+
- name: ⚙ GNU grep
28+
if: matrix.os == 'macOS-latest'
29+
run: |
30+
brew install grep
31+
echo 'export PATH="/usr/local/opt/grep/libexec/gnubin:$PATH"' >> .bash_profile
32+
2733
- name: 🧪 test
28-
run: dotnet test --no-build -m:1
34+
shell: bash --noprofile --norc {0}
35+
env:
36+
LC_ALL: en_US.utf8
37+
run: |
38+
[ -f .bash_profile ] && source .bash_profile
39+
counter=0
40+
exitcode=0
41+
reset="\e[0m"
42+
warn="\e[0;33m"
43+
while [ $counter -lt 6 ]
44+
do
45+
if [ $filter ]
46+
then
47+
echo -e "${warn}Retry $counter for $filter ${reset}"
48+
fi
49+
# run test and forward output also to a file in addition to stdout (tee command)
50+
dotnet test --no-build -m:1 --blame-hang --blame-hang-timeout 5m --filter=$filter | tee ./output.log
51+
# capture dotnet test exit status, different from tee
52+
exitcode=${PIPESTATUS[0]}
53+
if [ $exitcode == 0 ]
54+
then
55+
exit 0
56+
fi
57+
# cat output, get failed test names, join as DisplayName=TEST with |, remove trailing |.
58+
filter=$(cat ./output.log | grep -o -P '(?<=\sFailed\s)\w*' | awk 'BEGIN { ORS="|" } { print("DisplayName=" $0) }' | grep -o -P '.*(?=\|$)')
59+
((counter++))
60+
done
61+
exit $exitcode
2962
3063
- name: 📦 pack
3164
run: dotnet pack -m:1 -p:version=${GITHUB_REF#refs/*/v}

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ bin
22
obj
33
artifacts
44
pack
5+
TestResults
56
.vs
67
.vscode
78

@@ -26,4 +27,4 @@ _site
2627
.jekyll-metadata
2728
.jekyll-cache
2829
Gemfile.lock
29-
package-lock.json
30+
package-lock.json

.netconfig

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@
5454
weak
5555
[file ".github/workflows/build.yml"]
5656
url = https://github.com/devlooped/oss/blob/main/.github/workflows/build.yml
57-
sha = fc5889d5387e2d5aa7aba279b2aa12251cf08cb2
58-
etag = 91e9a208cd134bd7b71d7419800c613bc50a30e21e605607528721f2acdeab86
57+
sha = 964caa363fe9cd8ef01c8a5d8e3fd07d1aed35ae
58+
etag = ef5ed75b1e23292dd7af196a11f04760aa5ad4a3f374095395da9abc2de3f24f
5959
weak
6060
[file ".github/workflows/changelog.yml"]
6161
url = https://github.com/devlooped/oss/blob/main/.github/workflows/changelog.yml
@@ -69,8 +69,8 @@
6969
weak
7070
[file ".github/workflows/publish.yml"]
7171
url = https://github.com/devlooped/oss/blob/main/.github/workflows/publish.yml
72-
sha = 55c0b32601e94e1eed35028a0cad510c6bcbb265
73-
etag = ad8681ee3f191f796944135772b74565c470e349464e793aa664c888f7784b7a
72+
sha = 964caa363fe9cd8ef01c8a5d8e3fd07d1aed35ae
73+
etag = d6369e92c55eb78322ff39d26fc4ef1996b691a8ce05392395ab393e14ddb940
7474
weak
7575
[file ".github/workflows/release-notes.yml"]
7676
url = https://github.com/devlooped/oss/blob/main/.github/workflows/release-notes.yml
@@ -84,8 +84,8 @@
8484
weak
8585
[file ".gitignore"]
8686
url = https://github.com/devlooped/oss/blob/main/.gitignore
87-
sha = fa83a5161ba52bc5d510ce0ba75ee0b1f8d4bc63
88-
etag = 925782b685859e07040442303b411bebd1c75b4fe4e075f547e067f33f323814
87+
sha = a9f9d3f5db6dd0714f52da61e35ab233fd0a1642
88+
etag = e6ba96dc8c185a4e9c64f7c2c8003ef86e8f73624865ff7f6ae955aad55a164e
8989
weak
9090
[file "Directory.Build.rsp"]
9191
url = https://github.com/devlooped/oss/blob/main/Directory.Build.rsp
@@ -114,13 +114,13 @@
114114
weak
115115
[file "src/Directory.Build.props"]
116116
url = https://github.com/devlooped/oss/blob/main/src/Directory.Build.props
117-
sha = 32213f2169e34df06da3e1589e52186f2cf57baf
118-
etag = afbaf6c253fd1a427ace8405cca937b62a60328c218ca794f501dc66cdf81180
117+
sha = e2606657b68d2980cc3cae181c59baa3d847ab75
118+
etag = a44fa4e71022b1c5f9684ec65815f69b47d51d0289e58bd9396606bd88e4244a
119119
weak
120120
[file "src/Directory.Build.targets"]
121121
url = https://github.com/devlooped/oss/blob/main/src/Directory.Build.targets
122-
sha = fde1f6f17926f429a52e64de5ec355bb643e25bc
123-
etag = 126357bbdcfd2ee087986bd27f1817926f6585fba7eda4c9acb36975474fd1b7
122+
sha = e2606657b68d2980cc3cae181c59baa3d847ab75
123+
etag = a69e9c33e8b3efde55f99aa22a3c5a8db371cf5142f7db78e4e2984d805f287e
124124
weak
125125
[file "src/kzu.snk"]
126126
url = https://github.com/devlooped/oss/blob/main/src/kzu.snk

src/Directory.Build.props

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,13 @@
2323
<Copyright>Copyright (C) Daniel Cazzulino and Contributors. All rights reserved.</Copyright>
2424
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
2525
<PackageLicenseExpression>MIT</PackageLicenseExpression>
26+
27+
<!-- Pick src-level readme+icon automatically -->
2628
<PackageIcon Condition="Exists('$(MSBuildThisFileDirectory)icon.png')">icon.png</PackageIcon>
29+
<PackageReadmeFile Condition="Exists('$(MSBuildThisFileDirectory)readme.md')">readme.md</PackageReadmeFile>
30+
<!-- Pick project-level readme+icon overrides automatically -->
31+
<PackageIcon Condition="Exists('$(MSBuildProjectDirectory)\icon.png')">icon.png</PackageIcon>
32+
<PackageReadmeFile Condition="Exists('$(MSBuildProjectDirectory)\readme.md')">readme.md</PackageReadmeFile>
2733

2834
<PublishRepositoryUrl>true</PublishRepositoryUrl>
2935
<GenerateRepositoryUrlAttribute>true</GenerateRepositoryUrlAttribute>
@@ -32,19 +38,9 @@
3238

3339
<!-- Use Directory.Packages.props if possible. NOTE: other MSBuild SDKs (i.e. NoTargets/Traversal) do not support central packages -->
3440
<ManagePackageVersionsCentrally Condition="Exists('$(MSBuildThisFileDirectory)Directory.Packages.props') AND ('$(MSBuildProjectExtension)' == '.csproj' OR '$(MSBuildProjectExtension)' == '.vbproj')">true</ManagePackageVersionsCentrally>
35-
<!-- Always add our my CI package feed first for easier dogfooding -->
36-
<RestoreSources>https://pkg.kzu.io/index.json;https://api.nuget.org/v3/index.json;$(RestoreSources)</RestoreSources>
41+
<RestoreSources>https://api.nuget.org/v3/index.json;https://pkg.kzu.io/index.json;$(RestoreSources)</RestoreSources>
3742
</PropertyGroup>
3843

39-
<ItemGroup Label="NuGet">
40-
<!-- This is compatible with nugetizer and SDK pack -->
41-
<None Include="$(MSBuildThisFileDirectory)icon.png" Link="icon.png"
42-
Pack="true"
43-
Visible="false"
44-
PackagePath="%(Filename)%(Extension)"
45-
Condition="Exists('$(MSBuildThisFileDirectory)icon.png')" />
46-
</ItemGroup>
47-
4844
<PropertyGroup Label="Build">
4945
<Configuration Condition="'$(Configuration)' == '' and $(CI)">Release</Configuration>
5046
<GenerateDocumentationFile>true</GenerateDocumentationFile>

src/Directory.Build.targets

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,9 @@
55
<DefineConstants>CI;$(DefineConstants)</DefineConstants>
66
</PropertyGroup>
77

8-
<PropertyGroup Condition="'$(IsPackable)' == '' and '$(PackAsTool)' == 'true'">
9-
<IsPackable>true</IsPackable>
8+
<PropertyGroup Condition="'$(IsPackable)' == ''">
9+
<IsPackable Condition="'$(PackAsTool)' == 'true'">true</IsPackable>
10+
<IsPackable Condition="'$(PackFolder)' != ''">true</IsPackable>
1011
</PropertyGroup>
1112

1213
<PropertyGroup Condition="'$(IsPackable)' == ''">
@@ -23,6 +24,28 @@
2324
<IsPackable Condition="'$(PackageId)' == ''">false</IsPackable>
2425
<IsPackable Condition="'$(PackageId)' != ''">true</IsPackable>
2526
</PropertyGroup>
27+
28+
<ItemGroup Condition="'$(IsPackable)' == 'true'" Label="NuGet">
29+
<!-- This is compatible with nugetizer and SDK pack -->
30+
31+
<!-- Project-level icon/readme will already be part of None items -->
32+
<None Update="@(None -> WithMetadataValue('Filename', 'icon'))"
33+
Pack="true" PackagePath="%(Filename)%(Extension)"
34+
Condition="'$(PackageIcon)' != ''" />
35+
36+
<None Update="@(None -> WithMetadataValue('Filename', 'readme'))"
37+
Pack="true" PackagePath="%(Filename)%(Extension)"
38+
Condition="'$(PackageReadmeFile)' != ''" />
39+
40+
<!-- src-level will need explicit inclusion -->
41+
<None Include="$(MSBuildThisFileDirectory)icon.png" Link="icon.png" Visible="false"
42+
Pack="true" PackagePath="%(Filename)%(Extension)"
43+
Condition="Exists('$(MSBuildThisFileDirectory)icon.png') and !Exists('$(MSBuildProjectDirectory)icon.png')" />
44+
45+
<None Include="$(MSBuildThisFileDirectory)readme.md" Link="readme.md" Visible="false"
46+
Pack="true" PackagePath="%(Filename)%(Extension)"
47+
Condition="Exists('$(MSBuildThisFileDirectory)readme.md') and !Exists('$(MSBuildProjectDirectory)readme.md')" />
48+
</ItemGroup>
2649

2750
<!-- Microsoft.NET.Sdk\targets\Microsoft.NET.DefaultAssemblyInfo.targets does this and is imported
2851
before Directory.Build.targets, but it's not imported for .msbuildproj -->

0 commit comments

Comments
 (0)