This repository has been archived by the owner on Jul 10, 2024. It is now read-only.
chore(deps): update xunit-dotnet monorepo #161
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: CICD | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- 'main' | |
- 'alpha' | |
- 'beta' | |
- 'dev' | |
pull_request: | |
types: [opened, reopened, synchronize] | |
merge_group: | |
jobs: | |
build-test: | |
name: Build & Test | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup .NET Core | |
uses: actions/setup-dotnet@v4 | |
with: | |
global-json-file: global.json | |
- name: .NET Build | |
run: dotnet build -c Release | |
- name: .NET Test | |
run: dotnet test -c Release --collect:"XPlat Code Coverage" | |
- name: Coverage | |
uses: codecov/codecov-action@v4 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} | |
file: coverage.cobertura.xml | |
fail_ci_if_error: true | |
create-release: | |
if: ${{ github.event_name != 'pull_request' }} | |
name: Create Release | |
runs-on: ubuntu-latest | |
needs: build-test | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup .NET Core | |
uses: actions/setup-dotnet@v4 | |
with: | |
global-json-file: global.json | |
- name: Configure Git | |
run: | | |
git config user.name "$GITHUB_ACTOR" | |
git config user.email "$GITHUB_ACTOR@users.noreply.github.com" | |
- name: Semantic Release | |
uses: cycjimmy/semantic-release-action@v4 | |
id: semantic | |
with: | |
dry_run: true | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: .NET Pack | |
run: dotnet pack -c Release -p:Version=${{ (steps.semantic.outputs.new_release_published && steps.semantic.outputs.new_release_version) || '0.0.1' }} | |
- name: .NET NuGet Push | |
if: steps.semantic.outputs.new_release_published == 'true' | |
run: dotnet nuget push src/**/*.nupkg -s https://api.nuget.org/v3/index.json -k ${{ secrets.NUGET_API_KEY }} --skip-duplicate | |
- name: Semantic Release | |
if: steps.semantic.outputs.new_release_published == 'true' | |
uses: cycjimmy/semantic-release-action@v4 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- uses: actions/upload-artifact@v4 | |
with: | |
name: NuGet Package | |
path: src/**/*.nupkg |