-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
08c7947
commit 88a66d6
Showing
1 changed file
with
42 additions
and
0 deletions.
There are no files selected for viewing
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
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 |