Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 15 additions & 6 deletions .github/workflows/publish-nuget.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ name: Publish NuGet Package

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

jobs:
publish:
Expand All @@ -18,14 +18,23 @@ jobs:
with:
dotnet-version: 10.0.x

- name: Extract version from tag
id: get_version
run: echo "PACKAGE_VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_ENV

- name: Restore dependencies
run: dotnet restore
run: dotnet restore KSFramework.sln

- name: Build
run: dotnet build --configuration Release --no-restore
run: dotnet build KSFramework.sln --configuration Release --no-restore

- name: Pack NuGet
run: dotnet pack --configuration Release --no-build -o out
run: dotnet pack src/KSFramework/KSFramework.csproj \
--configuration Release \
-p:PackageVersion=${{ env.PACKAGE_VERSION }} \
--no-build -o out

- name: Push to NuGet
run: dotnet nuget push out/*.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json
run: dotnet nuget push out/*.nupkg \
--api-key ${{ secrets.NUGET_API_KEY }} \
--source https://api.nuget.org/v3/index.json
1 change: 0 additions & 1 deletion src/KSFramework/KSFramework.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

<PropertyGroup>
<PackageId>KSFramework</PackageId>
<Version>1.4.0</Version>
<Authors>Kamran Sadin</Authors>
<Company>Sadin</Company>
<CopyRight>Copyright (c) 2022 SadinCo.</CopyRight>
Expand Down