fix: add wrapper version suffix to package versions for unique releases

The APT repository update was failing with exit code 254 because
reprepro rejected duplicate packages. When multiple releases use the
same Claude Desktop version (e.g., v1.3.0, v1.3.1, v1.3.2 all using
claude1.1.799), the packages had identical versions causing conflicts.

Changes:
- Add --release-tag flag to build.sh to accept the full release tag
- Extract wrapper version from tag (v1.3.2+claude1.1.799 -> 1.3.2)
- Append wrapper version as Debian revision suffix (1.1.799-1.3.2)
- Update CI workflows to pass release tag on tag builds

This ensures each release produces packages with unique versions that
APT can properly handle for upgrades (1.1.799-1.3.2 > 1.1.799-1.3.1).

Fixes workflow failure in run #21318689829

Co-Authored-By: Claude <claude@anthropic.com>
This commit is contained in:
Claude
2026-01-24 17:36:42 +00:00
parent 90ac042c35
commit 3e587d3059
4 changed files with 40 additions and 4 deletions

View File

@@ -12,6 +12,11 @@ on:
description: "Suffix for the artifact name (e.g., deb, appimage, rpm)"
required: true
type: string
release_tag:
description: "Optional release tag (e.g., v1.3.2+claude1.1.799) to derive wrapper version"
required: false
type: string
default: ""
jobs:
build:
@@ -38,7 +43,11 @@ jobs:
- name: Run build script
run: |
./build.sh ${{ inputs.build_flags }}
TAG_FLAG=""
if [[ -n "${{ inputs.release_tag }}" ]]; then
TAG_FLAG="--release-tag ${{ inputs.release_tag }}"
fi
./build.sh ${{ inputs.build_flags }} $TAG_FLAG
- name: Upload AMD64 Artifact
uses: actions/upload-artifact@v4

View File

@@ -12,6 +12,11 @@ on:
description: "Suffix for the artifact name (e.g., deb, appimage, rpm)"
required: true
type: string
release_tag:
description: "Optional release tag (e.g., v1.3.2+claude1.1.799) to derive wrapper version"
required: false
type: string
default: ""
jobs:
build:
@@ -38,7 +43,11 @@ jobs:
- name: Run build script
run: |
./build.sh ${{ inputs.build_flags }}
TAG_FLAG=""
if [[ -n "${{ inputs.release_tag }}" ]]; then
TAG_FLAG="--release-tag ${{ inputs.release_tag }}"
fi
./build.sh ${{ inputs.build_flags }} $TAG_FLAG
- name: Upload ARM64 Artifact
uses: actions/upload-artifact@v4

View File

@@ -47,6 +47,7 @@ jobs:
with:
build_flags: ${{ matrix.flags }}
artifact_suffix: ${{ matrix.artifact_suffix }}
release_tag: ${{ startsWith(github.ref, 'refs/tags/v') && github.ref_name || '' }}
build-arm64:
name: Build Packages (arm64 - ${{ matrix.artifact_suffix }})
@@ -70,6 +71,7 @@ jobs:
with:
build_flags: ${{ matrix.flags }}
artifact_suffix: ${{ matrix.artifact_suffix }}
release_tag: ${{ startsWith(github.ref, 'refs/tags/v') && github.ref_name || '' }}
release:
name: Create Release

View File

@@ -11,6 +11,7 @@ distro_family='' # debian, rpm, or unknown
claude_download_url=''
claude_exe_filename=''
version=''
release_tag='' # Optional release tag (e.g., v1.3.2+claude1.1.799) for unique package versions
build_format='' # Will be set based on distro if not specified
cleanup_action='yes'
perform_cleanup=false
@@ -185,7 +186,7 @@ parse_arguments() {
while (( $# > 0 )); do
case "$1" in
-b|--build|-c|--clean|-e|--exe)
-b|--build|-c|--clean|-e|--exe|-r|--release-tag)
if [[ -z ${2:-} || $2 == -* ]]; then
echo "Error: Argument for $1 is missing" >&2
exit 1
@@ -194,6 +195,7 @@ parse_arguments() {
-b|--build) build_format="$2" ;;
-c|--clean) cleanup_action="$2" ;;
-e|--exe) local_exe_path="$2" ;;
-r|--release-tag) release_tag="$2" ;;
esac
shift 2
;;
@@ -202,11 +204,12 @@ parse_arguments() {
shift
;;
-h|--help)
echo "Usage: $0 [--build deb|rpm|appimage] [--clean yes|no] [--exe /path/to/installer.exe] [--test-flags]"
echo "Usage: $0 [--build deb|rpm|appimage] [--clean yes|no] [--exe /path/to/installer.exe] [--release-tag TAG] [--test-flags]"
echo ' --build: Specify the build format (deb, rpm, or appimage).'
echo " Default: auto-detected based on distro (current: $build_format)"
echo ' --clean: Specify whether to clean intermediate build files (yes or no). Default: yes'
echo ' --exe: Use a local Claude installer exe instead of downloading'
echo ' --release-tag: Release tag (e.g., v1.3.2+claude1.1.799) to append wrapper version to package'
echo ' --test-flags: Parse flags, print results, and exit without building.'
exit 0
;;
@@ -529,6 +532,19 @@ download_claude_installer() {
fi
echo "Detected Claude version: $version"
# Extract wrapper version from release tag if provided (e.g., v1.3.2+claude1.1.799 -> 1.3.2)
if [[ -n $release_tag ]]; then
local wrapper_version
# Extract version between 'v' and '+claude' (e.g., v1.3.2+claude1.1.799 -> 1.3.2)
wrapper_version=$(echo "$release_tag" | LC_ALL=C grep -oP '^v\K[0-9]+\.[0-9]+\.[0-9]+(?=\+claude)')
if [[ -n $wrapper_version ]]; then
version="${version}-${wrapper_version}"
echo "Package version with wrapper suffix: $version"
else
echo "Warning: Could not extract wrapper version from release tag: $release_tag" >&2
fi
fi
if ! 7z x -y "$nupkg_path_relative"; then
echo 'Failed to extract nupkg' >&2
cd "$project_root" || exit 1