Pull broadcast retry logic into a new RetryingBroadcastHttpHandler class #253
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: .NET | |
on: | |
push: | |
branches: ["main"] | |
pull_request: | |
branches: ["main"] | |
jobs: | |
build: | |
name: Build | |
runs-on: ubuntu-latest | |
permissions: | |
pull-requests: write | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v3 | |
with: | |
dotnet-version: 7.0.x | |
- name: Build | |
run: dotnet build | |
- name: Cache demos | |
id: cache-demos | |
uses: actions/cache@v3 | |
with: | |
path: demos | |
key: demos-${{ hashFiles('demos/download.sh') }} | |
- name: Download demos for integration test | |
if: steps.cache-demos.outputs.cache-hit != 'true' | |
working-directory: ./demos | |
run: ./download.sh | |
- name: Test | |
run: dotnet test | |
- name: Testing example projects with demo | |
working-directory: examples | |
run: | | |
dirs=($(find . -mindepth 1 -maxdepth 1 -type d)) | |
for dir in "${dirs[@]}"; do | |
if [[ "$dir" == "./DemoFile.Example.HttpBroadcast" ]]; then | |
echo "Building example: $dir..." | |
dotnet build -v quiet -c Release "$dir" | |
elif [[ "$dir" == *.Deadlock ]]; then | |
echo "Running Deadlock example: $dir..." | |
dotnet run -v quiet -c Release --project "$dir" -- ../demos/deadlock_47.dem | |
else | |
echo "Running CS2 example: $dir..." | |
dotnet run -v quiet -c Release --project "$dir" -- ../demos/navi-javelins-vs-9-pandas-fearless-m1-mirage.dem | |
fi | |
done | |
- name: Benchmark | |
if: github.ref != 'refs/heads/main' | |
id: benchmark | |
continue-on-error: true | |
run: | | |
dotnet run -c Release --project src/DemoFile.Benchmark -- --exporters=github | |
- name: Comment on PR with benchmark results | |
if: github.ref != 'refs/heads/main' && steps.benchmark.conclusion == 'success' | |
uses: thollander/actions-comment-pull-request@v2 | |
with: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
filePath: ./BenchmarkDotNet.Artifacts/results/DemoFile.Benchmark.DemoParserBenchmark-report-github.md | |
comment_tag: benchmark | |
deploy: | |
needs: [build] | |
if: github.ref == 'refs/heads/main' | |
name: Deploy | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v3 | |
with: | |
dotnet-version: 7.0.x | |
- name: Pull version from package.json | |
working-directory: src/DemoFile | |
run: | | |
VERSION=$(nbgv get-version -f json | jq -r '.NuGetPackageVersion') | |
echo "Current package version: $VERSION" | |
echo "VERSION=$VERSION" >> $GITHUB_ENV | |
echo "TAG=v$VERSION" >> $GITHUB_ENV | |
- uses: mukunku/[email protected] | |
id: checkTag | |
with: | |
tag: ${{ env.TAG }} | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Ensure release notes are available | |
if: ${{ steps.checkTag.outputs.exists == 'false' }} | |
run: grep -Fq "### $VERSION (`date -u '+%Y-%m-%d'`)" RELEASE_NOTES.md || exit 1 | |
- name: Version package and tag | |
if: ${{ steps.checkTag.outputs.exists == 'false' }} | |
run: | | |
git config --global user.name 'GitHub Actions' | |
git config --global user.email '[email protected]' | |
git tag $TAG | |
git push origin $TAG | |
- name: Publish to NuGet | |
if: ${{ steps.checkTag.outputs.exists == 'false' }} | |
run: | | |
dotnet pack -c Release | |
dotnet nuget push src/DemoFile/bin/Release/*.nupkg --source "https://api.nuget.org/v3/index.json" --api-key ${{secrets.NUGET_APIKEY}} | |
dotnet nuget push src/DemoFile.Game.*/bin/Release/*.nupkg --source "https://api.nuget.org/v3/index.json" --api-key ${{secrets.NUGET_APIKEY}} |