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
9 changes: 9 additions & 0 deletions .github/.github_changelog_generator
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
usernames-as-github-logins=true
issues_wo_labels=true
pr_wo_labels=true
exclude-labels=bydesign,dependencies,duplicate,question,invalid,wontfix,need info
enhancement-label=:sparkles: Implemented enhancements:
bugs-label=:bug: Fixed bugs:
issues-label=:hammer: Other:
pr-label=:twisted_rightwards_arrows: Merged:
unreleased=false
51 changes: 33 additions & 18 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,14 @@

name: build
on:
workflow_dispatch:
push:
branches: [ main, dev, 'feature/*', 'rel/*' ]
paths-ignore:
- changelog.md
- code-of-conduct.md
- security.md
- support.md
pull_request:
types: [opened, synchronize, reopened]

Expand All @@ -21,48 +27,57 @@ jobs:
steps:
- name: 🤘 checkout
uses: actions/checkout@v2
with:
submodules: recursive
fetch-depth: 0

- name: ⚙ dotnet
uses: actions/setup-dotnet@v1
with:
dotnet-version: '6.0.102'

- name: ✓ ensure format
run: |
dotnet tool update -g dotnet-format --version 5.0.* --add-source https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/v3/index.json
dotnet format --check -v:diag
run: dotnet format --verify-no-changes -v:diag --exclude ~/.nuget

build:
name: build-${{ matrix.os }}
needs: dotnet-format
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macOS-latest]
os: [windows-latest, ubuntu-latest, macOS-latest]
steps:
- name: 🤘 checkout
uses: actions/checkout@v2
with:
submodules: recursive
fetch-depth: 0

- name: ⚙ dotnet
uses: actions/setup-dotnet@v1
with:
dotnet-version: '6.0.101'

- name: 🙏 build
run: dotnet build -m:1 -bl:build.binlog -p:VersionLabel="$GITHUB_REF.$GITHUB_RUN_NUMBER" -p:RepositoryBranch=${GITHUB_REF#refs/*/}
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 -d $GITHUB_WORKSPACE/logs/${{ matrix.os }}.txt -r $GITHUB_WORKSPACE/logs
uses: ./.github/workflows/test

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

- name: 🔼 logs
if: always()
uses: actions/upload-artifact@v2
with:
name: ${{ matrix.os }}
path: |
**/*.binlog
logs/**/*.*

# Only push CI package to sleet feed if building on ubuntu (fastest)
- name: 🚀 sleet
env:
SLEET_CONNECTION: ${{ secrets.SLEET_CONNECTION }}
if: matrix.os == 'ubuntu-latest' && env.SLEET_CONNECTION != ''
run: |
dotnet tool install -g --version 3.2.0 sleet
sleet push bin --config none -f --verbose -p "SLEET_FEED_CONTAINER=nuget" -p "SLEET_FEED_CONNECTIONSTRING=${{ secrets.SLEET_CONNECTION }}" -p "SLEET_FEED_TYPE=azure"
dotnet tool install -g --version 4.0.18 sleet
sleet push bin --config none -f --verbose -p "SLEET_FEED_CONTAINER=nuget" -p "SLEET_FEED_CONNECTIONSTRING=${{ secrets.SLEET_CONNECTION }}" -p "SLEET_FEED_TYPE=azure" || echo "No packages found"
15 changes: 10 additions & 5 deletions .github/workflows/changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
on:
release:
types: [released]
workflow_dispatch:

env:
GH_TOKEN: ${{ secrets.GH_TOKEN }}
Expand All @@ -23,15 +24,19 @@ jobs:
ref: main
token: ${{ env.GH_TOKEN }}

- name: ⚙ changelog
uses: faberNovel/github-changelog-generator-action@master
- name: ⚙ ruby
uses: ruby/setup-ruby@v1
with:
options: --token ${{ secrets.GITHUB_TOKEN }} --o changelog.md
ruby-version: 3.0.3

- name: ⚙ changelog
run: |
gem install github_changelog_generator
github_changelog_generator --user ${GITHUB_REPOSITORY%/*} --project ${GITHUB_REPOSITORY##*/} --token ${{ secrets.GITHUB_TOKEN }} --o changelog.md --config-file .github/.github_changelog_generator

- name: 🚀 changelog
run: |
git config --local user.name github-actions
git config --local user.email github-actions@github.com
git add changelog.md
git commit -m "🖉 Update changelog with ${GITHUB_REF#refs/*/}"
git push
(git commit -m "🖉 Update changelog with ${GITHUB_REF#refs/*/}" && git push) || echo "Done"
61 changes: 61 additions & 0 deletions .github/workflows/dotnet-file.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# Synchronizes .netconfig-configured files with dotnet-file
name: dotnet-file
on:
workflow_dispatch:
schedule:
- cron: "0 0 * * *"
push:
branches: [ 'dotnet-file' ]

env:
DOTNET_NOLOGO: true
GH_TOKEN: ${{ secrets.GH_TOKEN }}

jobs:
sync:
runs-on: windows-latest
steps:
- name: 🔍 GH_TOKEN
if: env.GH_TOKEN == ''
shell: bash
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: echo "GH_TOKEN=${GITHUB_TOKEN}" >> $GITHUB_ENV

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

- name: 🔄 sync
run: |
dotnet tool update -g dotnet-gcm
dotnet gcm store --protocol=https --host=github.com --username=$env:GITHUB_ACTOR --password=$env:GH_TOKEN
gh auth status

dotnet tool update -g dotnet-file
dotnet file sync -c:$env:TEMP\dotnet-file.md
if (test-path $env:TEMP\dotnet-file.md) {
echo 'CHANGES<<EOF' >> $env:GITHUB_ENV
cat $env:TEMP\dotnet-file.md >> $env:GITHUB_ENV
echo 'EOF' >> $env:GITHUB_ENV
cat $env:TEMP\dotnet-file.md
} else {
echo 'No changelog was generated'
}

- name: ✍ pull request
uses: peter-evans/create-pull-request@v3
with:
base: main
branch: dotnet-file-sync
delete-branch: true
labels: dependencies
commit-message: ⬆️ Bump files with dotnet-file sync

${{ env.CHANGES }}
title: "Bump files with dotnet-file sync"
body: ${{ env.CHANGES }}
token: ${{ env.GH_TOKEN }}
44 changes: 0 additions & 44 deletions .github/workflows/pages.yml

This file was deleted.

25 changes: 15 additions & 10 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,21 +20,26 @@ jobs:
with:
submodules: recursive
fetch-depth: 0


- name: ⚙ dotnet
uses: actions/setup-dotnet@v1
with:
dotnet-version: '6.0.101'

- name: 🙏 build
run: dotnet build -m:1 -bl:build.binlog -p:version=${GITHUB_REF#refs/*/v} -p:RepositoryBranch=${GITHUB_REF#refs/*/}
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
uses: ./.github/workflows/test

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

- name: 🔼 logs
if: ${{ always() }}
uses: actions/upload-artifact@v2
with:
path: '**/*.binlog'
run: dotnet pack -m:1 -p:version=${GITHUB_REF#refs/*/v}

- name: 🚀 nuget
run: dotnet nuget push ./bin/**/*.nupkg -s https://api.nuget.org/v3/index.json -k ${{secrets.NUGET_API_KEY}} --skip-duplicate
17 changes: 8 additions & 9 deletions .github/workflows/release-artifacts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,19 @@ jobs:
- name: 🏷 current
run: echo "CURRENT_TAG=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV

- name: ⚙ dotnet
uses: actions/setup-dotnet@v1
with:
dotnet-version: '6.0.x'

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

- name: 🧪 test
run: dotnet test --no-build -m:1
uses: ./.github/workflows/test

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

- name: 🔼 logs
if: ${{ always() }}
uses: actions/upload-artifact@v2
with:
path: '**/*.binlog'
run: dotnet pack -m:1 -p:version=${GITHUB_REF#refs/*/v}

- name: 🔽 gh
run: |
Expand Down
21 changes: 13 additions & 8 deletions .github/workflows/release-notes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,22 @@ jobs:
- name: 🏷 since
run: echo "SINCE_TAG=$(git describe --abbrev=0 --tags $(git rev-list --tags --skip=1 --max-count=1))" >> $GITHUB_ENV

- name: ⚙ ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: 3.0.3

- name: ⚙ changelog
uses: faberNovel/github-changelog-generator-action@master
if: env.SINCE_TAG != ''
with:
options: --token ${{ secrets.GITHUB_TOKEN }} --since-tag ${{ env.SINCE_TAG }} --o changelog.md
run: |
gem install github_changelog_generator
github_changelog_generator --since-tag ${{ env.SINCE_TAG }} --user ${GITHUB_REPOSITORY%/*} --project ${GITHUB_REPOSITORY##*/} --token ${{ secrets.GITHUB_TOKEN }} --o changelog.md --config-file .github/.github_changelog_generator

- name: ⚙ changelog
uses: faberNovel/github-changelog-generator-action@master
if: env.SINCE_TAG == ''
with:
options: --token ${{ secrets.GITHUB_TOKEN }} --o changelog.md
run: |
gem install github_changelog_generator
github_changelog_generator --user ${GITHUB_REPOSITORY%/*} --project ${GITHUB_REPOSITORY##*/} --token ${{ secrets.GITHUB_TOKEN }} --o changelog.md --config-file .github/.github_changelog_generator

- name: 🖉 release
shell: pwsh
Expand All @@ -42,7 +47,7 @@ jobs:
ConvertFrom-Json |
select -ExpandProperty id

$notes = (Get-Content .\changelog.md | where { !($_ -like '\*') } | %{ $_.replace('\#', '\\#') }) -join '\n'
$notes = (Get-Content .\changelog.md | where { !($_ -like '\*') } | %{ $_.replace('\', '\\').replace('"', "'").replace('undefined', 'un-defined') }) -join '\n'
$headers = @{ 'Accept'='application/vnd.github.v3+json;charset=utf-8'; 'Authorization' = "bearer $env:GITHUB_TOKEN" }
$body = '{ "body":"' + $notes + '" }'

Expand All @@ -53,4 +58,4 @@ jobs:
iwr -Body $body "$env:GITHUB_API_URL/repos/$env:GITHUB_REPOSITORY/releases/$id" -Method PATCH -Headers $headers |
select -ExpandProperty Content |
ConvertFrom-Json |
ConvertTo-Json
ConvertTo-Json
34 changes: 34 additions & 0 deletions .github/workflows/test/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: test
description: runs dotnet tests with retry
runs:
using: "composite"
steps:
- name: 🧪 test
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
4 changes: 0 additions & 4 deletions .github_changelog_generator

This file was deleted.

Loading