Nuget Publish #39
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: Nuget Publish | |
on: | |
release: | |
types: [published] | |
workflow_run: | |
workflows: [Create Tag And Release] | |
types: | |
- completed | |
jobs: | |
build: | |
runs-on: ubuntu-20.04 | |
name: Nuget Publish | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Setup .Net | |
uses: actions/setup-dotnet@v4 | |
- name: Get Tag for workflow_run | |
if: ${{ github.event_name == 'workflow_run' }} | |
id: get-tag | |
run: | | |
git fetch --tags | |
TAG_NAME=$(git describe --tags --abbrev=0) | |
# Remove 'v' prefix if exists | |
CLEAN_TAG_NAME=${TAG_NAME#v} | |
echo "tag_name=${CLEAN_TAG_NAME}" >> $GITHUB_ENV | |
echo "new tag from tags ${CLEAN_TAG_NAME}" | |
- name: Nuget Package And Upload | |
uses: actions-opensource/publish-nuget@v5 | |
with: | |
path: ./CSharp.OpenSource.LinqToKql | |
releaseVersion: ${{ github.event.release.tag_name || env.tag_name }} | |
repoUrl: ${{ github.server_url }}/${{ github.repository }} | |
nugetToken: ${{ secrets.NUGET_AUTH_TOKEN }} | |
nugetSource: https://api.nuget.org/v3/index.json |