diff --git a/.github/workflows/Nuget.yml b/.github/workflows/Nuget.yml index 57962370e..4138de1db 100644 --- a/.github/workflows/Nuget.yml +++ b/.github/workflows/Nuget.yml @@ -43,12 +43,15 @@ jobs: echo "version=$version" >> $GITHUB_OUTPUT + # Four numbers: the version without its prerelease or build suffix, and a zero. + echo "file_version=${version%%[-+]*}.0" >> $GITHUB_OUTPUT + - name: 'Pack and publish AngouriMath' run: | cd Sources/AngouriMath dotnet restore AngouriMath.csproj - dotnet build AngouriMath.csproj -c release - dotnet pack AngouriMath.csproj -c release -p:PackageVersion=${{ steps.version.outputs.version }} + dotnet build AngouriMath.csproj -c release -p:Version=${{ steps.version.outputs.version }} -p:FileVersion=${{ steps.version.outputs.file_version }} + dotnet pack AngouriMath.csproj -c release -p:Version=${{ steps.version.outputs.version }} -p:FileVersion=${{ steps.version.outputs.file_version }} cd bin/release dotnet nuget push AngouriMath.${{ steps.version.outputs.version }}.nupkg --api-key ${{ secrets.NUGET_KEY }} --source nuget.org @@ -56,8 +59,8 @@ jobs: run: | cd Sources/Wrappers/AngouriMath.FSharp dotnet restore - dotnet build -c Release - dotnet pack -c Release -p:PackageVersion=${{ steps.version.outputs.version }} + dotnet build -c Release -p:Version=${{ steps.version.outputs.version }} -p:FileVersion=${{ steps.version.outputs.file_version }} + dotnet pack -c Release -p:Version=${{ steps.version.outputs.version }} -p:FileVersion=${{ steps.version.outputs.file_version }} cd bin/Release dotnet nuget push AngouriMath.FSharp.${{ steps.version.outputs.version }}.nupkg --api-key ${{ secrets.NUGET_KEY }} --source nuget.org @@ -65,8 +68,8 @@ jobs: run: | cd Sources/Wrappers/AngouriMath.Interactive dotnet restore - dotnet build -c Release - dotnet pack -c Release -p:PackageVersion=${{ steps.version.outputs.version }} + dotnet build -c Release -p:Version=${{ steps.version.outputs.version }} -p:FileVersion=${{ steps.version.outputs.file_version }} + dotnet pack -c Release -p:Version=${{ steps.version.outputs.version }} -p:FileVersion=${{ steps.version.outputs.file_version }} cd bin/Release dotnet nuget push AngouriMath.Interactive.${{ steps.version.outputs.version }}.nupkg --api-key ${{ secrets.NUGET_KEY }} --source nuget.org @@ -74,7 +77,7 @@ jobs: run: | cd Sources/Terminal/AngouriMath.Terminal dotnet restore - dotnet build -c Release - dotnet pack -c Release -p:PackageVersion=${{ steps.version.outputs.version }} + dotnet build -c Release -p:Version=${{ steps.version.outputs.version }} -p:FileVersion=${{ steps.version.outputs.file_version }} + dotnet pack -c Release -p:Version=${{ steps.version.outputs.version }} -p:FileVersion=${{ steps.version.outputs.file_version }} cd bin/Release dotnet nuget push AngouriMath.Terminal.${{ steps.version.outputs.version }}.nupkg --api-key ${{ secrets.NUGET_KEY }} --source nuget.org diff --git a/Sources/Package.Build.props b/Sources/Package.Build.props index c8f7cf00c..71a3c3c81 100644 --- a/Sources/Package.Build.props +++ b/Sources/Package.Build.props @@ -13,11 +13,12 @@ - 2.3.0 + 2.6.0 2.0.0.0 - 2.3.0.0 + 2.6.0.0 WhiteBlackGoose and contributors Angouri diff --git a/Sources/Terminal/AngouriMath.Terminal/publish.sh b/Sources/Terminal/AngouriMath.Terminal/publish.sh index 61e3df126..0e863343d 100755 --- a/Sources/Terminal/AngouriMath.Terminal/publish.sh +++ b/Sources/Terminal/AngouriMath.Terminal/publish.sh @@ -1,6 +1,14 @@ #!/bin/bash +# The release's version, which the workflow passes as TERMINAL_VERSION, goes into the assemblies +# as well as the package names: FileVersion is four numbers, the version without its suffix and +# a zero. https://github.com/asc-community/AngouriMath/issues/1678 +version_properties=() +if [ -n "${TERMINAL_VERSION:-}" ]; then + version_properties=(-p:Version="$TERMINAL_VERSION" -p:FileVersion="${TERMINAL_VERSION%%[-+]*}.0") +fi + # Portable runtime identifiers: since .NET 8 a versioned one such as osx.12-arm64 is not # recognised, and the publish fails with NETSDK1083. for arch in linux-x64 linux-arm linux-arm64 win-x64 win-x86 osx-x64 osx-arm64 @@ -9,6 +17,7 @@ do -r $arch \ -c Release \ -o ./publish-output/$arch \ - --self-contained + --self-contained \ + "${version_properties[@]}" done