# Variables package_name=$(head -n1 go.mod | cut -d'/' -f2) version=$1 # deps apk add dpkg make go curl # Structure deb_folder="${package_name}_${version}-1_amd64" mkdir -vp \ "${deb_folder}/usr/local/bin" \ "${deb_folder}/lib/systemd/system" \ "${deb_folder}/DEBIAN" # Package content VERSION=$version make build cp -v "$package_name" "${deb_folder}/usr/local/bin/" cp -v "deb/${package_name}.service" "${deb_folder}/lib/systemd/system/" # DEBIAN cat - > "${deb_folder}/DEBIAN/control" < Description: A Prometheus Application version exporter for the Recycled Cloud EOF cp deb/postinst "${deb_folder}/DEBIAN/" cp deb/prerm "${deb_folder}/DEBIAN/" cp deb/postrm "${deb_folder}/DEBIAN/" # Package dpkg-deb --build --root-owner-group "$deb_folder" curl --fail \ -H "Authorization: token $2" \ --upload-file "${deb_folder}.deb" \ https://code.recycled.cloud/api/packages/RecycledCloud/debian/pool/bookworm/main/upload