diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 8abf716..c4d23db 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -22,19 +22,27 @@ jobs: - name: Extract version from tag id: version - run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT + run: | + VERSION=${GITHUB_REF#refs/tags/v} + PREFIX=${VERSION%%-*} + SUFFIX="" + if [[ "$VERSION" == *-* ]]; then + SUFFIX=${VERSION#*-} + fi + echo "PREFIX=$PREFIX" >> $GITHUB_OUTPUT + echo "SUFFIX=$SUFFIX" >> $GITHUB_OUTPUT - name: Restore dependencies run: dotnet restore - name: Build - run: dotnet build --configuration Release --no-restore + run: dotnet build --configuration Release --no-restore -p:VersionPrefix=${{ steps.version.outputs.PREFIX }} -p:VersionSuffix=${{ steps.version.outputs.SUFFIX }} - name: Test run: dotnet test --configuration Release --no-build --verbosity normal - name: Pack - run: dotnet pack --configuration Release --no-build --output ./nupkg /p:PackageVersion=${{ steps.version.outputs.VERSION }} + run: dotnet pack --configuration Release --no-build --output ./nupkg - name: Push to NuGet run: dotnet nuget push ./nupkg/*.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json --skip-duplicate diff --git a/Directory.Build.props b/Directory.Build.props index 4b66fc7..682668f 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -10,6 +10,18 @@ README.md + + + 1.0.0 + 1.0.0.0 + $(VersionPrefix).0 + + true @@ -26,6 +38,16 @@ enable + + + true + $(MSBuildThisFileDirectory)NginxApiClient-KeyFile.snk + 00240000048000009400000006020000002400005253413100040000010001006925f3c2d5b1d9d2e8f1652e5b23f223390e09b94ee66a09657c6cdff11ec6a428188a58073e5029240e2d6844b7e50f25b6dd48ed1e536a7c4ad2d0ffa8617371fa8601bc5bf32c50dbd702bebd07dd999e589ac6fe9f380e325c9c6f38ea8ce7653f15932ab0c53c2d27c8a10a51dcc8ce876699a94b2c09879b2368f2f3a7 + + enable diff --git a/NginxApiClient-KeyFile.snk b/NginxApiClient-KeyFile.snk new file mode 100644 index 0000000..3d6889b Binary files /dev/null and b/NginxApiClient-KeyFile.snk differ diff --git a/examples/Directory.Build.props b/examples/Directory.Build.props new file mode 100644 index 0000000..e2be616 --- /dev/null +++ b/examples/Directory.Build.props @@ -0,0 +1,9 @@ + + + + + + false + + + diff --git a/src/NginxApiClient/NginxApiClient.csproj b/src/NginxApiClient/NginxApiClient.csproj index 343854b..d4436ce 100644 --- a/src/NginxApiClient/NginxApiClient.csproj +++ b/src/NginxApiClient/NginxApiClient.csproj @@ -15,10 +15,10 @@ - - - - + + + +