chore: bump xunit.runner.visualstudio from 2.5.7 to 3.0.1 #158
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 CI | |
on: | |
push: | |
paths-ignore: | |
- '**.md' | |
tags: | |
- 'v*' | |
pull_request: | |
jobs: | |
test: | |
strategy: | |
matrix: | |
os: [ubuntu-latest, windows-latest, macos-latest] | |
name: Build and test on ${{ matrix.os }} | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: '9.x' | |
- name: Build and test | |
run: dotnet test -p:CollectCoverage=true -c Debug -o sayit-${{ matrix.os }}-${{ github.sha }} | |
- name: Upload debug artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: sayit-${{ matrix.os }}-${{ github.sha }} | |
path: sayit-${{ matrix.os }}-${{ github.sha }} | |
publish: | |
needs: test | |
strategy: | |
matrix: | |
config: | |
- {os: ubuntu-latest, rid: "linux-x64", id: "linux" } | |
- {os: windows-latest, rid: "win-x64", id: "win" } | |
- {os: macos-latest, rid: "osx-x64", id: "osx" } | |
name: Create draft release on ${{ matrix.config.os }} | |
runs-on: ${{ matrix.config.os }} | |
if: startsWith(github.ref, 'refs/tags/v') | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: '9.x' | |
- name: Set version variable (Linux and MacOS) | |
if: matrix.config.id != 'win' | |
run: echo "VER=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV | |
- name: Set version variable (Windows) | |
if: matrix.config.id == 'win' | |
run: echo "VER=$(($env:GITHUB_REF -split '/')[-1] -replace ' ','')" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append | |
- name: Build release artifacts | |
run: | | |
dotnet publish -c Release -o sayit-${{ env.VER }}-${{ matrix.config.id }} | |
dotnet publish -c Release -r ${{ matrix.config.rid }} --self-contained -p:PublishSingleFile=true -p:PublishReadyToRun=true -o sayit-${{ env.VER }}-${{ matrix.config.id }}-sc | |
- name: Zip artifacts (Linux and MacOS) | |
if: matrix.config.id != 'win' | |
run: | | |
zip -r sayit-${{ env.VER }}-${{ matrix.config.id }}.zip sayit-${{ env.VER }}-${{ matrix.config.id }} | |
zip -r sayit-${{ env.VER }}-${{ matrix.config.id }}-sc.zip sayit-${{ env.VER }}-${{ matrix.config.id }}-sc | |
- name: Zip artifacts (Windows) | |
if: matrix.config.id == 'win' | |
run: | | |
Compress-Archive -Path sayit-${{ env.VER }}-${{ matrix.config.id }} -DestinationPath sayit-${{ env.VER }}-${{ matrix.config.id }}.zip | |
Compress-Archive -Path sayit-${{ env.VER }}-${{ matrix.config.id }}-sc -DestinationPath sayit-${{ env.VER }}-${{ matrix.config.id }}-sc.zip | |
- name: Create draft release | |
uses: softprops/action-gh-release@v2 | |
with: | |
draft: true | |
files: ./*.zip | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |