Skip to content

Nuget Release

Nuget Release #5

Workflow file for this run

name: Release.yml
on:
release:
types: [published]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup dotnet
uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.x'
- name: Install dependencies
run: dotnet restore
- name: Get Current Date Time
id: t1
uses: Kaven-Universe/github-action-current-date-time@v1
with:
format: "YYYY_MM_DD HH_mm_ss_SSS"
- name: Calculate Version
run: |
let "MINOR = ${{ steps.t1.outputs.month }} * 100 + ${{ steps.t1.outputs.day }}"
let "REVISION = ${{ steps.t1.outputs.seconds }}"
let "BUILD = ${{ steps.t1.outputs.hours }} * 100 + ${{ steps.t1.outputs.minutes }}"
let "MAJOR = ${{ steps.t1.outputs.year }} - 2000"
echo "$MAJOR.$MINOR.$BUILD.$REVISION"
echo "VERSION=$MAJOR.$MINOR.$BUILD.$REVISION" >> $GITHUB_ENV
- name: Create Nuget Package
run: dotnet pack -c Release -p:Version=$VERSION --output nupkgs
- name: Push nuget
run: dotnet nuget push nupkgs/*.nupkg -k $NUGET_AUTH_TOKEN -s https://api.nuget.org/v3/index.json
env:
NUGET_AUTH_TOKEN: ${{ secrets.NUGET_TOKEN }}