From 3030c671d27a94e18c9e30c48bff0c91428ff2eb Mon Sep 17 00:00:00 2001 From: JustFixMe Date: Mon, 27 Nov 2023 23:19:03 +0400 Subject: [PATCH] fix nuget versioning --- .gitea/workflows/publish-nuget.yaml | 5 +---- Railway/Railway.csproj | 9 +++++++++ 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/.gitea/workflows/publish-nuget.yaml b/.gitea/workflows/publish-nuget.yaml index b24b90d..7f03daa 100644 --- a/.gitea/workflows/publish-nuget.yaml +++ b/.gitea/workflows/publish-nuget.yaml @@ -21,16 +21,13 @@ jobs: - name: Restore dependencies run: dotnet restore Railway/Railway.csproj - - name: Build - run: dotnet build --no-restore --configuration Release Railway/Railway.csproj - - name: Setup nuget source run: dotnet nuget add source --name gitea_registry https://gitea.jstdev.ru/api/packages/just/nuget/index.json - name: Create the package env: RELEASE_VERSION: ${{ gitea.event.release.tag_name }} - run: dotnet pack --no-build --configuration Release --output nupkgs Railway/Railway.csproj `echo $RELEASE_VERSION | sed -E 's|^(v([0-9]+(\.[0-9]+){2}))(-([a-z0-9]+)){1}|--property:ReleaseVersion=\2 --property:VersionSuffix=\5|; s|^(v([0-9]+(\.[0-9]+){2}))$|--property:ReleaseVersion=\2|'` + run: dotnet pack --no-restore --configuration Release --output nupkgs Railway/Railway.csproj `sed -E 's|^(v([0-9]+(\.[0-9]+){2}))(-([a-z0-9]+)){1}|--property:ReleaseVersion=\2 --property:VersionSuffix=\5|; s|^(v([0-9]+(\.[0-9]+){2}))$|--property:ReleaseVersion=\2|'` - name: Publish the package to Gitea run: dotnet nuget push --source gitea_registry --api-key ${{ secrets.NUGET_PACKAGE_TOKEN }} nupkgs/*.nupkg diff --git a/Railway/Railway.csproj b/Railway/Railway.csproj index c92b5f7..627009b 100644 --- a/Railway/Railway.csproj +++ b/Railway/Railway.csproj @@ -9,6 +9,15 @@ Just.Railway + + 1.0.0 + + $(VersionSuffix) + $(ReleaseVersion) + + $(ReleaseVersion) + +