Skip to content

Commit

Permalink
update gh-action
Browse files Browse the repository at this point in the history
  • Loading branch information
onenoteperpage committed Jun 26, 2024
1 parent 08c7947 commit 88a66d6
Showing 1 changed file with 42 additions and 0 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/nuget-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Publish NuGet Package

on:
push:
tags:
- 'v*.*.*'

jobs:
publish:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x

- name: Extract version number
id: extract_version
run: echo "::set-output name=VERSION::${GITHUB_REF/refs\/tags\/v/}"

- name: Update version in .csproj
run: |
VERSION=${{ steps.extract_version.outputs.VERSION }}
sed -i "s|<Version>.*</Version>|<Version>${VERSION}</Version>|" WhoIsChecker/WhoIsChecker.csproj
shell: bash

- name: Restore dependencies
run: dotnet restore

- name: Build the project
run: dotnet build --configuration Release

- name: Pack the project
run: dotnet pack --configuration Release

# - name: Publish to NuGet
# env:
# NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }}
# run: dotnet nuget push bin/Release/*.nupkg --api-key $NUGET_API_KEY --source https://api.nuget.org/v3/index.json

0 comments on commit 88a66d6

Please sign in to comment.