Skip to content

v0.26.0

v0.26.0 #44

Workflow file for this run

name: NuGet Publish
on:
release:
types: [ published ]
permissions:
contents: read
jobs:
publish:
runs-on: ubuntu-latest
# Only run for v* tags, skip cli-v* tags
if: startsWith(github.ref_name, 'v') && !startsWith(github.ref_name, 'cli-v')
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '9.0.x'
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build --no-restore --configuration Release
- name: Test
run: dotnet test --no-build --configuration Release --verbosity normal
- name: Extract version from tag
id: version
run: |
VERSION="${GITHUB_REF_NAME#v}"
if [ -z "$VERSION" ]; then
echo "::error::Could not extract version from GITHUB_REF_NAME='$GITHUB_REF_NAME'"
exit 1
fi
echo "VERSION=$VERSION" >> $GITHUB_OUTPUT
- name: Pack MiniPdf
run: dotnet pack src/MiniPdf/MiniPdf.csproj --no-build --configuration Release -p:PackageVersion="${{ steps.version.outputs.VERSION }}" --output ./nupkg
- name: Pack MiniPdf.Cli
run: dotnet pack src/MiniPdf.Cli/MiniPdf.Cli.csproj --no-build --configuration Release -p:PackageVersion="${{ steps.version.outputs.VERSION }}" --output ./nupkg
- name: Push to NuGet.org
run: dotnet nuget push ./nupkg/*.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json --skip-duplicate