Skip to content

Commit 6d75300

Browse files
The assemblies carry the release's version, not 2.3.0 (#1679)
Nuget.yml passed the release's version as PackageVersion, which names a package but not the assemblies in it, and those took Version and FileVersion from Package.Build.props, which said 2.3.0. Both release workflows now pass Version and FileVersion, and the props name 2.6.0, the version under development, for a local build. Closes #1678. Claude-Session: https://claude.ai/code/session_012sonx8iAspMiwRwokT1Ura Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
1 parent fe953a0 commit 6d75300

3 files changed

Lines changed: 27 additions & 14 deletions

File tree

‎.github/workflows/Nuget.yml‎

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -43,38 +43,41 @@ jobs:
4343
4444
echo "version=$version" >> $GITHUB_OUTPUT
4545
46+
# Four numbers: the version without its prerelease or build suffix, and a zero.
47+
echo "file_version=${version%%[-+]*}.0" >> $GITHUB_OUTPUT
48+
4649
- name: 'Pack and publish AngouriMath'
4750
run: |
4851
cd Sources/AngouriMath
4952
dotnet restore AngouriMath.csproj
50-
dotnet build AngouriMath.csproj -c release
51-
dotnet pack AngouriMath.csproj -c release -p:PackageVersion=${{ steps.version.outputs.version }}
53+
dotnet build AngouriMath.csproj -c release -p:Version=${{ steps.version.outputs.version }} -p:FileVersion=${{ steps.version.outputs.file_version }}
54+
dotnet pack AngouriMath.csproj -c release -p:Version=${{ steps.version.outputs.version }} -p:FileVersion=${{ steps.version.outputs.file_version }}
5255
cd bin/release
5356
dotnet nuget push AngouriMath.${{ steps.version.outputs.version }}.nupkg --api-key ${{ secrets.NUGET_KEY }} --source nuget.org
5457
5558
- name: 'Pack and publish AngouriMath.FSharp'
5659
run: |
5760
cd Sources/Wrappers/AngouriMath.FSharp
5861
dotnet restore
59-
dotnet build -c Release
60-
dotnet pack -c Release -p:PackageVersion=${{ steps.version.outputs.version }}
62+
dotnet build -c Release -p:Version=${{ steps.version.outputs.version }} -p:FileVersion=${{ steps.version.outputs.file_version }}
63+
dotnet pack -c Release -p:Version=${{ steps.version.outputs.version }} -p:FileVersion=${{ steps.version.outputs.file_version }}
6164
cd bin/Release
6265
dotnet nuget push AngouriMath.FSharp.${{ steps.version.outputs.version }}.nupkg --api-key ${{ secrets.NUGET_KEY }} --source nuget.org
6366
6467
- name: 'Pack and publish AngouriMath.Interactive'
6568
run: |
6669
cd Sources/Wrappers/AngouriMath.Interactive
6770
dotnet restore
68-
dotnet build -c Release
69-
dotnet pack -c Release -p:PackageVersion=${{ steps.version.outputs.version }}
71+
dotnet build -c Release -p:Version=${{ steps.version.outputs.version }} -p:FileVersion=${{ steps.version.outputs.file_version }}
72+
dotnet pack -c Release -p:Version=${{ steps.version.outputs.version }} -p:FileVersion=${{ steps.version.outputs.file_version }}
7073
cd bin/Release
7174
dotnet nuget push AngouriMath.Interactive.${{ steps.version.outputs.version }}.nupkg --api-key ${{ secrets.NUGET_KEY }} --source nuget.org
7275
7376
- name: 'Pack and publish AngouriMath.Terminal'
7477
run: |
7578
cd Sources/Terminal/AngouriMath.Terminal
7679
dotnet restore
77-
dotnet build -c Release
78-
dotnet pack -c Release -p:PackageVersion=${{ steps.version.outputs.version }}
80+
dotnet build -c Release -p:Version=${{ steps.version.outputs.version }} -p:FileVersion=${{ steps.version.outputs.file_version }}
81+
dotnet pack -c Release -p:Version=${{ steps.version.outputs.version }} -p:FileVersion=${{ steps.version.outputs.file_version }}
7982
cd bin/Release
8083
dotnet nuget push AngouriMath.Terminal.${{ steps.version.outputs.version }}.nupkg --api-key ${{ secrets.NUGET_KEY }} --source nuget.org

‎Sources/Package.Build.props‎

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,12 @@
1313

1414
<PropertyGroup>
1515
<!--
16-
The version under development. The NuGet workflow overrides PackageVersion from the
17-
release tag, so what ships is named by the tag; this is what a local build and the
18-
assembly metadata carry.
16+
The version under development, which a local build carries. The NuGet and terminal release
17+
workflows pass the release tag's version as Version and FileVersion, so what ships carries
18+
the tag in its assemblies as well as in its package's name.
19+
https://github.com/asc-community/AngouriMath/issues/1678
1920
-->
20-
<Version>2.3.0</Version>
21+
<Version>2.6.0</Version>
2122

2223
<!--
2324
Pinned to the major for the whole of 2.x, and deliberately not tracking Version.
@@ -36,7 +37,7 @@
3637
can express that. FileVersion carries the release for anyone reading file properties.
3738
-->
3839
<AssemblyVersion>2.0.0.0</AssemblyVersion>
39-
<FileVersion>2.3.0.0</FileVersion>
40+
<FileVersion>2.6.0.0</FileVersion>
4041

4142
<Authors>WhiteBlackGoose and contributors</Authors>
4243
<Company>Angouri</Company>
Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
#!/bin/bash
22

33

4+
# The release's version, which the workflow passes as TERMINAL_VERSION, goes into the assemblies
5+
# as well as the package names: FileVersion is four numbers, the version without its suffix and
6+
# a zero. https://github.com/asc-community/AngouriMath/issues/1678
7+
version_properties=()
8+
if [ -n "${TERMINAL_VERSION:-}" ]; then
9+
version_properties=(-p:Version="$TERMINAL_VERSION" -p:FileVersion="${TERMINAL_VERSION%%[-+]*}.0")
10+
fi
11+
412
# Portable runtime identifiers: since .NET 8 a versioned one such as osx.12-arm64 is not
513
# recognised, and the publish fails with NETSDK1083.
614
for arch in linux-x64 linux-arm linux-arm64 win-x64 win-x86 osx-x64 osx-arm64
@@ -9,6 +17,7 @@ do
917
-r $arch \
1018
-c Release \
1119
-o ./publish-output/$arch \
12-
--self-contained
20+
--self-contained \
21+
"${version_properties[@]}"
1322
done
1423

0 commit comments

Comments
 (0)