Bump GitVersion.MsBuild from 6.0.3 to 6.0.4 #229
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: [ master ] | |
pull_request: | |
branches: [ master ] | |
release: | |
types: [ published ] | |
workflow_dispatch: | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true | |
permissions: | |
checks: write | |
packages: read | |
jobs: | |
run-tests: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- uses: actions/cache@v4 | |
with: | |
path: ~/.nuget/packages | |
key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj') }} | |
restore-keys: | | |
${{ runner.os }}-nuget- | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: 8.0.x | |
source-url: https://nuget.pkg.github.com/prplecake/index.json | |
env: | |
NUGET_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Test | |
run: dotnet test --verbosity normal --logger "trx" --results-directory "./TestResults" /p:CollectCoverage=true /p:CoverletOutputFormat=opencover /p:Exclude="[BunnyDDNS.*.Tests?]*" | |
- uses: dorny/test-reporter@v1 | |
if: always() | |
with: | |
name: .NET Test Results | |
path: TestResults/*.trx | |
reporter: dotnet-trx | |
- name: Upload coverage reports to Codecov | |
uses: codecov/codecov-action@v4 | |
publish: | |
strategy: | |
matrix: | |
rid: [ | |
linux-x64, linux-arm64, | |
win-x64, osx-x64, | |
] | |
permissions: | |
contents: write | |
packages: read | |
checks: write | |
runs-on: ubuntu-latest | |
name: publish-${{matrix.rid}} | |
if: github.event_name == 'release' | |
needs: run-tests | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- uses: actions/cache@v4 | |
with: | |
path: ~/.nuget/packages | |
key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj') }} | |
restore-keys: | | |
${{ runner.os }}-nuget- | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: 8.0.x | |
source-url: https://nuget.pkg.github.com/prplecake/index.json | |
env: | |
NUGET_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Publish CLI (${{matrix.rid}}) | |
run: | | |
dotnet publish src/BunnyDDNS.CLI/BunnyDDNS.CLI.csproj -c Release -r ${{matrix.rid}} --self-contained -p:PublishSingleFile=true -p:PublishReadyToRun=true | |
zip -j ddns-bunny.net-${{ github.ref_name }}-${{matrix.rid}}.zip src/BunnyDDNS.CLI/bin/Release/net8.0/${{matrix.rid}}/publish/* README.md LICENSE | |
- name: Release | |
uses: softprops/action-gh-release@v2 | |
if: startsWith(github.ref, 'refs/tags/') | |
with: | |
files: ddns-bunny.net-*.zip | |
test-release: | |
strategy: | |
matrix: | |
rid: [ | |
linux-x64, linux-arm64, | |
win-x64, osx-x64, | |
] | |
runs-on: ubuntu-latest | |
name: Test Release (${{matrix.rid}}) | |
needs: publish | |
permissions: | |
contents: write | |
packages: read | |
steps: | |
- name: Download release | |
uses: robinraju/release-downloader@v1 | |
with: | |
latest: true | |
fileName: ddns-bunny.net-${{ github.ref_name }}-${{ matrix.rid }}.zip | |
extract: true | |
out-file-path: release | |
- name: Test Release Package | |
id: testReleasePackage | |
run: | | |
cd release; ls | |
count=$(ls | wc -l) | |
if [ $count -ne $EXPECTED_COUNT ]; then | |
echo "Expected $EXPECTED_COUNT files, found $count" | |
exit 1 | |
fi | |
env: | |
EXPECTED_COUNT: 5 | |
- name: Delete Release | |
if: always() && (steps.testReleasePackage.outcome == 'failure') | |
run: | | |
gh release delete ${{ github.ref_name }} --yes | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |