Skip to content

Commit

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

- Generate API documentation for non-tests projects by default devlooped/oss@32213f2
- Add nuget.org as first restore source, for convenience devlooped/oss@3f294a1
- Automatically set/include icon.png and readme.md devlooped/oss@e260665
- Automatically retry failed tests up to 5 times devlooped/oss@8bc16a7
- Ensure GNU grep is used on macOS devlooped/oss@964caa3
- List of excluded labels should be coma separated devlooped/oss@a9a7616
- If PackFolder is specified, assume IsPackable=true devlooped/oss@b0249cf
- Ignore TestResults folders devlooped/oss@a9f9d3f
  • Loading branch information
kzu committed Oct 13, 2021
1 parent 294db88 commit 4b3fd74
Show file tree
Hide file tree
Showing 7 changed files with 117 additions and 29 deletions.
35 changes: 34 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,41 @@ jobs:
- name: 🙏 build
run: dotnet build -m:1 -p:VersionLabel="$GITHUB_REF.$GITHUB_RUN_NUMBER"

- name: ⚙ GNU grep
if: matrix.os == 'macOS-latest'
run: |
brew install grep
echo 'export PATH="/usr/local/opt/grep/libexec/gnubin:$PATH"' >> .bash_profile
- name: 🧪 test
run: dotnet test --no-build -m:1 --blame-hang --blame-hang-timeout 5m
shell: bash --noprofile --norc {0}
env:
LC_ALL: en_US.utf8
run: |
[ -f .bash_profile ] && source .bash_profile
counter=0
exitcode=0
reset="\e[0m"
warn="\e[0;33m"
while [ $counter -lt 6 ]
do
if [ $filter ]
then
echo -e "${warn}Retry $counter for $filter ${reset}"
fi
# run test and forward output also to a file in addition to stdout (tee command)
dotnet test --no-build -m:1 --blame-hang --blame-hang-timeout 5m --filter=$filter | tee ./output.log
# capture dotnet test exit status, different from tee
exitcode=${PIPESTATUS[0]}
if [ $exitcode == 0 ]
then
exit 0
fi
# cat output, get failed test names, join as DisplayName=TEST with |, remove trailing |.
filter=$(cat ./output.log | grep -o -P '(?<=\sFailed\s)\w*' | awk 'BEGIN { ORS="|" } { print("DisplayName=" $0) }' | grep -o -P '.*(?=\|$)')
((counter++))
done
exit $exitcode
- name: 📦 pack
run: dotnet pack -m:1 -p:VersionLabel="$GITHUB_REF.$GITHUB_RUN_NUMBER"
Expand Down
35 changes: 34 additions & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,41 @@ jobs:
- name: 🙏 build
run: dotnet build -m:1 -p:version=${GITHUB_REF#refs/*/v}

- name: ⚙ GNU grep
if: matrix.os == 'macOS-latest'
run: |
brew install grep
echo 'export PATH="/usr/local/opt/grep/libexec/gnubin:$PATH"' >> .bash_profile
- name: 🧪 test
run: dotnet test --no-build -m:1
shell: bash --noprofile --norc {0}
env:
LC_ALL: en_US.utf8
run: |
[ -f .bash_profile ] && source .bash_profile
counter=0
exitcode=0
reset="\e[0m"
warn="\e[0;33m"
while [ $counter -lt 6 ]
do
if [ $filter ]
then
echo -e "${warn}Retry $counter for $filter ${reset}"
fi
# run test and forward output also to a file in addition to stdout (tee command)
dotnet test --no-build -m:1 --blame-hang --blame-hang-timeout 5m --filter=$filter | tee ./output.log
# capture dotnet test exit status, different from tee
exitcode=${PIPESTATUS[0]}
if [ $exitcode == 0 ]
then
exit 0
fi
# cat output, get failed test names, join as DisplayName=TEST with |, remove trailing |.
filter=$(cat ./output.log | grep -o -P '(?<=\sFailed\s)\w*' | awk 'BEGIN { ORS="|" } { print("DisplayName=" $0) }' | grep -o -P '.*(?=\|$)')
((counter++))
done
exit $exitcode
- name: 📦 pack
run: dotnet pack -m:1 -p:version=${GITHUB_REF#refs/*/v}
Expand Down
2 changes: 1 addition & 1 deletion .github_changelog_generator
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ usernames-as-github-logins=true
header-label=
issues_wo_labels=true
pr_wo_labels=true
exclude-labels=bydesign;dependencies,duplicate,question,invalid,wontfix,need info
exclude-labels=bydesign,dependencies,duplicate,question,invalid,wontfix,need info
enhancement-label=:sparkles: Implemented enhancements:
bugs-label=:bug: Fixed bugs:
issues-label=:hammer: Other:
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ bin
obj
artifacts
pack
TestResults
.vs
.vscode

Expand All @@ -26,4 +27,4 @@ _site
.jekyll-metadata
.jekyll-cache
Gemfile.lock
package-lock.json
package-lock.json
24 changes: 12 additions & 12 deletions .netconfig
Original file line number Diff line number Diff line change
Expand Up @@ -48,19 +48,19 @@
sha = 0683ee777d7d878d4bf013d7deea352685135a05
[file ".github/workflows/build.yml"]
url = https://github.com/devlooped/oss/blob/main/.github/workflows/build.yml
etag = 91e9a208cd134bd7b71d7419800c613bc50a30e21e605607528721f2acdeab86
etag = ef5ed75b1e23292dd7af196a11f04760aa5ad4a3f374095395da9abc2de3f24f
weak
sha = fc5889d5387e2d5aa7aba279b2aa12251cf08cb2
sha = 964caa363fe9cd8ef01c8a5d8e3fd07d1aed35ae
[file ".github_changelog_generator"]
url = https://github.com/devlooped/oss/blob/main/.github_changelog_generator
etag = 0b4d83a50ec36784192f4cba2eb2e84aef663601420614294d490e2cc0d2df4d
etag = 73c55fc67df88885e402f87d24c36cd5df6a08604ae1c3256ee0413d115975c6
weak
sha = b92dfed302a3da2630b6243a46c3d89b3007adaa
sha = a9a7616a242f5ba5c910c3f1c93bb38c4b2fbd8d
[file ".gitignore"]
url = https://github.com/devlooped/oss/blob/main/.gitignore
etag = 925782b685859e07040442303b411bebd1c75b4fe4e075f547e067f33f323814
etag = e6ba96dc8c185a4e9c64f7c2c8003ef86e8f73624865ff7f6ae955aad55a164e
weak
sha = fa83a5161ba52bc5d510ce0ba75ee0b1f8d4bc63
sha = a9f9d3f5db6dd0714f52da61e35ab233fd0a1642
[file "Directory.Build.rsp"]
url = https://github.com/devlooped/oss/blob/main/Directory.Build.rsp
etag = 6a6c6e1d3895df953abf14c82b0899e3eea75cdcd679f6212dcfea15183d73d6
Expand Down Expand Up @@ -103,14 +103,14 @@
sha = a0f58a6d63e48ae6e55944c556d0bc94476dc8df
[file "src/Directory.Build.props"]
url = https://github.com/devlooped/oss/blob/main/src/Directory.Build.props
etag = ae2606c157b9725ce8c707e30d9768fb0bad901ac34065d3cd75fc2bdbc5f8cf
etag = a44fa4e71022b1c5f9684ec65815f69b47d51d0289e58bd9396606bd88e4244a
weak
sha = 52d6c40aaa460ac48fc74c03324c6b1db7ae170d
sha = e2606657b68d2980cc3cae181c59baa3d847ab75
[file "src/Directory.Build.targets"]
url = https://github.com/devlooped/oss/blob/main/src/Directory.Build.targets
etag = 126357bbdcfd2ee087986bd27f1817926f6585fba7eda4c9acb36975474fd1b7
etag = a69e9c33e8b3efde55f99aa22a3c5a8db371cf5142f7db78e4e2984d805f287e
weak
sha = fde1f6f17926f429a52e64de5ec355bb643e25bc
sha = e2606657b68d2980cc3cae181c59baa3d847ab75
[file "src/kzu.snk"]
url = https://github.com/devlooped/oss/blob/main/src/kzu.snk
skip
Expand All @@ -131,8 +131,8 @@
weak
[file ".github/workflows/publish.yml"]
url = https://github.com/devlooped/oss/blob/main/.github/workflows/publish.yml
sha = 55c0b32601e94e1eed35028a0cad510c6bcbb265
etag = ad8681ee3f191f796944135772b74565c470e349464e793aa664c888f7784b7a
sha = 964caa363fe9cd8ef01c8a5d8e3fd07d1aed35ae
etag = d6369e92c55eb78322ff39d26fc4ef1996b691a8ce05392395ab393e14ddb940
weak
[file ".github/workflows/release-artifacts.yml"]
url = https://github.com/devlooped/oss/blob/main/.github/workflows/release-artifacts.yml
Expand Down
20 changes: 9 additions & 11 deletions src/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,13 @@
<Copyright>Copyright (C) Daniel Cazzulino and Contributors. All rights reserved.</Copyright>
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
<PackageLicenseExpression>MIT</PackageLicenseExpression>

<!-- Pick src-level readme+icon automatically -->
<PackageIcon Condition="Exists('$(MSBuildThisFileDirectory)icon.png')">icon.png</PackageIcon>
<PackageReadmeFile Condition="Exists('$(MSBuildThisFileDirectory)readme.md')">readme.md</PackageReadmeFile>
<!-- Pick project-level readme+icon overrides automatically -->
<PackageIcon Condition="Exists('$(MSBuildProjectDirectory)\icon.png')">icon.png</PackageIcon>
<PackageReadmeFile Condition="Exists('$(MSBuildProjectDirectory)\readme.md')">readme.md</PackageReadmeFile>

<PublishRepositoryUrl>true</PublishRepositoryUrl>
<GenerateRepositoryUrlAttribute>true</GenerateRepositoryUrlAttribute>
Expand All @@ -32,21 +38,13 @@

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

<ItemGroup Label="NuGet">
<!-- This is compatible with nugetizer and SDK pack -->
<None Include="$(MSBuildThisFileDirectory)icon.png" Link="icon.png"
Pack="true"
Visible="false"
PackagePath="%(Filename)%(Extension)"
Condition="Exists('$(MSBuildThisFileDirectory)icon.png')" />
</ItemGroup>

<PropertyGroup Label="Build">
<Configuration Condition="'$(Configuration)' == '' and $(CI)">Release</Configuration>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<GenerateDocumentationFile Condition="$(MSBuildProjectName.Contains('Tests'))">false</GenerateDocumentationFile>
<LangVersion>Latest</LangVersion>

<!-- See https://docs.microsoft.com/en-us/dotnet/standard/assembly/reference-assemblies -->
Expand Down
27 changes: 25 additions & 2 deletions src/Directory.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@
<DefineConstants>CI;$(DefineConstants)</DefineConstants>
</PropertyGroup>

<PropertyGroup Condition="'$(IsPackable)' == '' and '$(PackAsTool)' == 'true'">
<IsPackable>true</IsPackable>
<PropertyGroup Condition="'$(IsPackable)' == ''">
<IsPackable Condition="'$(PackAsTool)' == 'true'">true</IsPackable>
<IsPackable Condition="'$(PackFolder)' != ''">true</IsPackable>
</PropertyGroup>

<PropertyGroup Condition="'$(IsPackable)' == ''">
Expand All @@ -23,6 +24,28 @@
<IsPackable Condition="'$(PackageId)' == ''">false</IsPackable>
<IsPackable Condition="'$(PackageId)' != ''">true</IsPackable>
</PropertyGroup>

<ItemGroup Condition="'$(IsPackable)' == 'true'" Label="NuGet">
<!-- This is compatible with nugetizer and SDK pack -->

<!-- Project-level icon/readme will already be part of None items -->
<None Update="@(None -> WithMetadataValue('Filename', 'icon'))"
Pack="true" PackagePath="%(Filename)%(Extension)"
Condition="'$(PackageIcon)' != ''" />

<None Update="@(None -> WithMetadataValue('Filename', 'readme'))"
Pack="true" PackagePath="%(Filename)%(Extension)"
Condition="'$(PackageReadmeFile)' != ''" />

<!-- src-level will need explicit inclusion -->
<None Include="$(MSBuildThisFileDirectory)icon.png" Link="icon.png" Visible="false"
Pack="true" PackagePath="%(Filename)%(Extension)"
Condition="Exists('$(MSBuildThisFileDirectory)icon.png') and !Exists('$(MSBuildProjectDirectory)icon.png')" />

<None Include="$(MSBuildThisFileDirectory)readme.md" Link="readme.md" Visible="false"
Pack="true" PackagePath="%(Filename)%(Extension)"
Condition="Exists('$(MSBuildThisFileDirectory)readme.md') and !Exists('$(MSBuildProjectDirectory)readme.md')" />
</ItemGroup>

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

0 comments on commit 4b3fd74

Please sign in to comment.