Skip to content

Instantly share code, notes, and snippets.

@foontzoot
Created June 15, 2023 14:57
Show Gist options
  • Save foontzoot/f253efc9c530994032a1a793a4247f68 to your computer and use it in GitHub Desktop.
Save foontzoot/f253efc9c530994032a1a793a4247f68 to your computer and use it in GitHub Desktop.
name: publish Ardalis.Extensions to nuget
on:
workflow_dispatch:
push:
branches:
- main # Your default release branch
paths:
- 'src/Ardalis.Extensions/**'
jobs:
publish:
name: list on nuget
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2.3.4
# Required for a specific dotnet version that doesn't come with ubuntu-latest / windows-latest
# Visit bit.ly/2synnZl to see the list of SDKs that are pre-installed with ubuntu-latest / windows-latest
- name: Setup dotnet
uses: actions/setup-dotnet@v1
with:
dotnet-version: 6.0.x
# Publish
- name: publish on version change
uses: rohith/publish-nuget@v2
with:
PROJECT_FILE_PATH: src/Ardalis.Extensions/Ardalis.Extensions.csproj # Relative to repository root
# VERSION_FILE_PATH: Directory.Build.props # Filepath with version info, relative to repository root. Defaults to project file
VERSION_REGEX: <Version>(.*)<\/Version> # Regex pattern to extract version info in a capturing group
TAG_COMMIT: true # Flag to enable / disable git tagging
TAG_FORMAT: v* # Format of the git tag, [*] gets replaced with version
NUGET_KEY: ${{secrets.NUGET_API_KEY}} # nuget.org API key
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment