Skip to content

release-vpax-cli

release-vpax-cli #8

name: release-vpax-cli
on:
workflow_dispatch:
env:
PROJECT: Dax.Vpax.CLI
jobs:
release:
if: github.ref == 'refs/heads/master'
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: nbgv
uses: dotnet/[email protected]
id: nbgv
with:
path: src/${{ env.PROJECT }}
- name: dotnet pack
run: dotnet pack 'src/${{ env.PROJECT }}/${{ env.PROJECT }}.csproj' -c Release -o .
- name: nuget push
run: dotnet nuget push './${{ env.PROJECT }}.${{ steps.nbgv.outputs.NuGetPackageVersion }}.nupkg' -k "$NUGET_API_KEY" -s https://api.nuget.org/v3/index.json
env:
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}
- name: create release
run: |
PRERELEASE_FLAG=$([[ "${{ steps.nbgv.outputs.PrereleaseVersion }}" != "" ]] && echo "--prerelease" || echo "")
gh release create ${{ env.RELEASE_TAG }} --title ${{ env.RELEASE_TAG }} --target $GITHUB_SHA --generate-notes --draft $PRERELEASE_FLAG
env:
RELEASE_TAG: ${{ env.PROJECT }}_${{ steps.nbgv.outputs.NuGetPackageVersion }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}