Skip to content

v0.0.0.2

v0.0.0.2 #34

Workflow file for this run

# yaml-language-server: $schema=https://json.schemastore.org/github-workflow.json
name: Publish
on:
release:
types: [created]
env:
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
defaults:
run:
shell: pwsh
jobs:
publish:
runs-on: windows-latest
permissions:
id-token: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Get all history to allow automatic versioning using MinVer
# Install the .NET SDK indicated in the global.json file
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: '6.0.x'
- name: Extract version from tag
id: get_version
run: |
VERSION=${GITHUB_REF#refs/tags/}
VERSION=${VERSION#v}
echo "VERSION=$VERSION" >> $GITHUB_OUTPUT
shell: bash
env:
GITHUB_REF: ${{ github.ref }}
# Create the NuGet package in the folder from the environment variable NuGetDirectory
- run: dotnet pack TALXIS.DevKit.Build.sln --configuration Release -p:PackageVersion=${{ steps.get_version.outputs.VERSION }} -p:Version=${{ steps.get_version.outputs.VERSION }}
- name: NuGet login (OIDC → temp API key)
uses: NuGet/login@v1
id: login
with:
user: ${{ secrets.NUGET_USER }}
- name: Publish NuGet package
run: |
dotnet nuget push **\bin\Release\*.nupkg --api-key $env:NUGET_AUTH_TOKEN --source https://api.nuget.org/v3/index.json
env:
NUGET_AUTH_TOKEN: ${{ steps.login.outputs.NUGET_API_KEY }}