Update dotnet-desktop.yml #16
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build and Publish NuGet | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
build: | |
runs-on: windows-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Display Git Tag Version | |
run: | | |
TAG=$(git describe --tags --abbrev=0 2>&1) | |
if [ $? -eq 0 ]; then | |
echo "Git Tag Version: $TAG" | |
else | |
echo "No tags found" | |
fi | |
shell: bash | |
- name: Add MSBuild to PATH | |
run: | | |
echo "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Current\Bin" >> $GITHUB_PATH | |
- name: Build with MSBuild | |
run: | | |
& "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Current\Bin\MSBuild.exe" DbfLibrary\DbfLibrary.csproj /p:Configuration=Release /p:Platform="Any CPU" /p:OutputPath="DbfLibrary\bin\Release\" | |
- name: Display directory structure | |
run: tree /f /a | |
- name: Pack | |
run: nuget pack DbfLibrary\DbfLibrary\DbfLibrary.csproj -Properties Configuration=Release -OutputDirectory out | |
- name: Push NuGet package | |
run: dotnet nuget push out/*.nupkg -k ${{secrets.NUGET_API_KEY}} -s https://api.nuget.org/v3/index.json |