Skip to content

Commit c219074

Browse files
committed
fix: Correctly name artifact in build script
1 parent 4f9bf6c commit c219074

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

scripts/build_packages.sh

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,17 @@
22
set -e
33

44
# This script builds the debian package.
5-
# The VERSION argument is passed from the GitHub workflow.
6-
VERSION=${1#v} # a v prefix from the tag
5+
# The VERSION argument is passed from the GitHub workflow (e.g., v0.3.0)
6+
VERSION_TAG=${1}
7+
VERSION_NUMBER=${1#v} # a v prefix from the tag
78

8-
if [ -z "$VERSION" ]; then
9-
echo "Usage: $0 <version>"
9+
if [ -z "$VERSION_TAG" ]; then
10+
echo "Usage: $0 <version_tag>"
1011
exit 1
1112
fi
1213

13-
# Create the package structure
14-
DEB_DIR="docker-ai_${VERSION}_amd64"
14+
# Create the package structure using the full tag (e.g., docker-ai_v0.3.0_amd64)
15+
DEB_DIR="docker-ai_${VERSION_TAG}_amd64"
1516
mkdir -p "$DEB_DIR/usr/local/bin"
1617
mkdir -p "$DEB_DIR/DEBIAN"
1718

@@ -22,7 +23,7 @@ GOOS=linux GOARCH=amd64 go build -o "$DEB_DIR/usr/local/bin/docker-ai" ./cmd/doc
2223
# Create the debian control file
2324
cat > "$DEB_DIR/DEBIAN/control" <<EOF
2425
Package: docker-ai
25-
Version: $VERSION
26+
Version: $VERSION_NUMBER
2627
Architecture: amd64
2728
Maintainer: Ajay <[email protected]>
2829
Description: An AI-powered CLI for Docker.
@@ -32,4 +33,7 @@ EOF
3233
echo "Building Debian package..."
3334
dpkg-deb --build "$DEB_DIR"
3435

35-
echo "Package created: ${DEB_DIR}.deb"
36+
# Rename the package to include the 'v' from the tag, for consistency
37+
mv "${DEB_DIR}.deb" "docker-ai_${VERSION_TAG}_amd64.deb"
38+
39+
echo "Package created and renamed to: docker-ai_${VERSION_TAG}_amd64.deb"

0 commit comments

Comments
 (0)