Skip to content

Publish Nuget

Publish Nuget #61

Workflow file for this run

name: Publish Nuget
on:
workflow_dispatch:
# push:
# branches:
# - main
# paths:
# - source/libraries/**
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout crazor
uses: actions/checkout@v4
with:
path: Crazor
- name: Checkout adaptivecards
uses: actions/checkout@v4
with:
repository: microsoft/adaptivecards
path: AdaptiveCards
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 8.0.x
- name: Bump build version
id: bump
uses: vers-one/dotnet-project-version-updater@v1.5
with:
files: "**/libraries/**/Crazor*.csproj"
version: bump-build
- name: Restore dependencies
run: dotnet restore Crazor/source/CrazorLibraries.sln
- name: Build
run: dotnet build Crazor/source/CrazorLibraries.sln -c Debug --no-restore
- name: dotnet pack Crazor
run: |
dotnet pack --no-build ./Crazor/source/CrazorLibraries.sln -c Debug -o packages --include-symbols --property WarningLevel=0
# rm packages/Adaptive*
- name: Publish NuGet and symbols
id: nuget-push
uses: edumserrano/nuget-push@v1
with:
api-key: '${{ secrets.NUGET_KEY }}'
working-directory: 'packages'
fail-if-exists: false
# - name: Commit version changes
# uses: github-actions-x/commit@v2.9
# working-directory: 'packages'
# with:
# github-token: ${{ secrets.GITHUB_TOKEN }}
# commit-message: 'Updated package version for published packages'
- name: Commit new version changes
working-directory: ./Crazor
run: |
git config --global user.name "Github Action"
git config --global user.email "tomlm@users.noreply.github.com"
git commit -a -m "Bumped version for published nuget artifacts"
git push