Skip to content

attempting to publish-pkg nuget-pack workflow #35

attempting to publish-pkg nuget-pack workflow

attempting to publish-pkg nuget-pack workflow #35

Workflow file for this run

name: Create release
# On push to master branch. i.e. when we merge a PR.
on:
push:
branches: [ master, VFL/WI00764279/NCN-Diagrams-Move-WTG.Blazor.Diagrams-to-nuget.org ]
tags:
- "*"
workflow_dispatch:
env:
PACKAGE_PATH: /home/runner/work/Blazor.Diagrams/Blazor.Diagrams/src/Blazor.Diagrams/bin/Release/*.nupkg
jobs:
publish-pkg:
name: Build - Release
runs-on: ubuntu-latest
steps:
- name: Extract tag name
id: tag_name
uses: actions/[email protected]
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
result-encoding: string
script: |
return context.payload.ref.replace(/^refs\/tags\//, '');
- name: Checkout
uses: actions/checkout@v3
- name: Setup dotnet
uses: actions/setup-dotnet@v3
with:
dotnet-version: |
6.0.x
3.1.x
- name: Create NuGet Packages
run: dotnet pack --configuration Release /p:CommitID=${{ github.sha }} /p:TagVersion=${{ steps.tag_name.outputs.result }}
# Upload package as an atrifact to the GitHub action
- name: Upload packages
uses: actions/upload-artifact@v3
with:
name: package
path: ${{ env.PACKAGE_PATH }}
retention-days: 5
# - name: Publish NuGet Package to NuGet Gallery
# run: |
# nuget setapikey ${{ secrets.NUGET_API_KEY }}
# nuget push bin/WTG.Z.Blazor.Diagrams.${{ steps.tag_name.outputs.result }}.nupkg -Source https://api.nuget.org/v3/index.json