Skip to content

Workflow file for this run

name: Release .NET Tool
on:
push:
tags:
"cli-v[0-9]+.[0-9]+.[0-9]+"
defaults:
run:
working-directory: src/PwSafeClient.CLI
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Extract Version
if: ${{ github.ref_type == 'tag' }}
working-directory: .
run: |
version=$(./build/extract_version "${GITHUB_REF#refs/tags/}")
echo "VERSION=$version" >> $GITHUB_ENV
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 8.0.x
- name: Restore dependencies
run: dotnet restore
- name: Build
run: dotnet build --configuration Release --no-restore /p:Version=$VERSION
- name: Pack
run: dotnet pack --no-restore --no-build /p:PackageVersion=$VERSION
- name: Upload
if: github.ref_type == 'tag' && startsWith(github.ref, 'refs/tags/cli-v')
run: dotnet nuget push nupkg/*.nupkg -k ${{ secrets.NUGET_API_KEY }} -s https://api.nuget.org/v3/index.json