Skip to content

chore: update publish command #5

chore: update publish command

chore: update publish command #5

Workflow file for this run

name: publish
on:
push:
branches:
- master
paths:
- 'src/Dena.CodeAnalysis.Testing/Dena.CodeAnalysis.Testing.csproj'
pull_request:
paths:
- 'src/Dena.CodeAnalysis.Testing/Dena.CodeAnalysis.Testing.csproj'
jobs:
check-bump-version:
runs-on: ubuntu-latest
outputs:
new-version: ${{ steps.diff.outputs.version }}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 200
- name: Get version from csproj
run: |
version="$(grep -o --color=never "<PackageVersion>[0-9]\+\.[0-9]\+\.[0-9]\+" src/Dena.CodeAnalysis.Testing/Dena.CodeAnalysis.Testing.csproj | sed 's/<PackageVersion>//')"
echo "version=$version" >> "$GITHUB_OUTPUT"
id: diff
publish:
needs: check-bump-version
if: ${{ needs.check-bump-version.outputs.new-version }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@main
- name: Setup .NET
uses: actions/setup-dotnet@main
with:
dotnet-version: '5.0.x'
- name: dotnet build
run: dotnet build ./Dena.CodeAnalysis.Testing.sln --configuration Release
- name: Create NuPkg
run: dotnet pack ./src/Dena.CodeAnalysis.Testing --include-symbols --configuration Release -o ./nupkg
- name: Publish NuPkg
run: dotnet nuget push ./nupkg/Dena.CodeAnalysis.Testing.*.symbols.nupkg -s https://api.nuget.org/v3/index.json --api-key $NUGET_AUTH_TOKEN
env:
NUGET_AUTH_TOKEN: ${{ secrets.APIKEY }}