22set -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
1112fi
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"
1516mkdir -p " $DEB_DIR /usr/local/bin"
1617mkdir -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
2324cat > " $DEB_DIR /DEBIAN/control" << EOF
2425Package: docker-ai
25- Version: $VERSION
26+ Version: $VERSION_NUMBER
2627Architecture: amd64
2728Maintainer: Ajay <[email protected] > 2829Description: An AI-powered CLI for Docker.
3233echo " Building Debian package..."
3334dpkg-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