2121 runs-on : ubuntu-latest
2222 steps :
2323 - uses : actions/checkout@v4
24+
25+ - name : Get name, version, and group from csproj files
26+ id : get_version
27+ run : |
28+ set -e
29+ VERSION=$(awk -F'[<>]' '/^[[:space:]]*<Version>/ {print $3}' QsNet/QsNet.csproj)
30+ echo "VERSION=$VERSION" >> $GITHUB_ENV
2431
2532 - name : Setup .NET
2633 uses : actions/setup-dotnet@v4
@@ -32,18 +39,16 @@ jobs:
3239
3340 - name : Build & Pack
3441 run : dotnet pack QsNet/QsNet.csproj -c Release -o ./artifacts
35-
42+
3643 - name : Push to NuGet
37- run : dotnet nuget push ./artifacts/*.nupkg \
38- --api-key ${{ secrets.NUGET_API_KEY }} \
39- --source https://api.nuget.org/v3/index.json \
40- --skip-duplicate
44+ run : dotnet nuget push ./artifacts/QsNet.$VERSION.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json --skip-duplicate
4145
4246 - name : Upload .nupkg artefact
4347 uses : actions/upload-artifact@v4
4448 with :
4549 name : nuget-package
4650 path : ./artifacts/*.nupkg
51+ retention-days : 7
4752 release :
4853 needs :
4954 - test
@@ -54,21 +59,19 @@ jobs:
5459 contents : write
5560 steps :
5661 - uses : actions/checkout@v4
57- - name : Get name, version, and group from Gradle files
58- id : get_version_and_name
62+ - name : Get name, version, and group from csproj files
63+ id : get_version
5964 run : |
6065 set -e
6166 VERSION=$(awk -F'[<>]' '/^[[:space:]]*<Version>/ {print $3}' QsNet/QsNet.csproj)
62- NAME=$(awk -F'[<>]' '/<PackageId>/ {print $3}' QsNet/QsNet.csproj)
6367 echo "VERSION=$VERSION" >> $GITHUB_ENV
64- echo "NAME=$NAME" >> $GITHUB_ENV
6568 - name : Create tag-specific CHANGELOG
6669 id : create_changelog
6770 run : |
6871 set -e
6972 CHANGELOG_PATH=$RUNNER_TEMP/CHANGELOG.md
7073 awk '/^##[[:space:]].*/ { if (count == 1) exit; count++; print } count == 1 && !/^##[[:space:]].*/ { print }' CHANGELOG.md | sed -e :a -e '/^\n*$/{$d;N;ba' -e '}' > $CHANGELOG_PATH
71- echo -en "\n[https://www.nuget.org/packages/$NAME ](https://www.nuget.org/packages/$NAME )" >> $CHANGELOG_PATH
74+ echo -en "\n[https://www.nuget.org/packages/QsNet ](https://www.nuget.org/packages/QsNet )" >> $CHANGELOG_PATH
7275 echo "CHANGELOG_PATH=$CHANGELOG_PATH" >> $GITHUB_ENV
7376 - name : Create release
7477 id : create_release
0 commit comments