Skip to content

Bump xunit.v3 to 3.2.1 (#123) #137

Bump xunit.v3 to 3.2.1 (#123)

Bump xunit.v3 to 3.2.1 (#123) #137

Workflow file for this run

name: CI
on:
push:
branches:
- "main"
tags:
- "v*"
permissions:
id-token: write
contents: write
packages: write
jobs:
build:
name: CI Build
uses: ./.github/workflows/build.yml
secrets: inherit
pack:
name: Create NuGet packages
needs: [build]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Set Dev version
if: github.ref == 'refs/heads/main'
run: |
version="$(git describe --long --tags | sed 's/^v//;0,/-/s//./')"
if [ -z "${version}" ]; then
version="0.0.0.$(git rev-list --count HEAD)-g$(git rev-parse --short HEAD)"
fi
echo "VERSION=${version}" >> $GITHUB_ENV
- name: Set Release version
if: startsWith(github.ref, 'refs/tags/v')
run: echo "VERSION=${GITHUB_REF_NAME#v}" >> $GITHUB_ENV
- name: Pack artifacts
run: dotnet pack -p:PackageVersion="${{ env.VERSION }}" -o packages
- name: Upload artifacts
uses: actions/upload-artifact@v5
with:
name: packages
path: packages/*nupkg
github:
name: Deploy to GitHub
needs: [pack]
runs-on: ubuntu-latest
steps:
- name: Download artifacts
uses: actions/download-artifact@v6
with:
name: packages
- name: Push to pkg.github.com
run: |
dotnet nuget push "*.nupkg" \
--skip-duplicate \
-k ${{ secrets.GITHUB_TOKEN }} \
-s https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json
release:
name: Create GitHub release
needs: [pack]
if: startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Download artifacts
uses: actions/download-artifact@v6
with:
name: packages
path: packages
- name: Create GitHub Release
run: gh release create ${{ github.ref_name }} packages/*nupkg
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
nuget:
name: Deploy to NuGet
needs: [release]
if: startsWith(github.ref, 'refs/tags/v')
runs-on: ubuntu-latest
steps:
- name: Download artifacts
uses: actions/download-artifact@v6
with:
name: packages
- name: NuGet Login
uses: NuGet/login@v1
id: login
with:
user: ${{ vars.NUGET_USER }}
- name: Push to nuget.org
run: |
dotnet nuget push "*.nupkg" \
-k ${{ steps.login.outputs.NUGET_API_KEY }} \
-s https://api.nuget.org/v3/index.json