From a2a5b6d220761d07f2a6e2e7904405e2996f43cc Mon Sep 17 00:00:00 2001 From: Alex Rennie-Lis Date: Tue, 16 Jun 2026 23:40:28 +0100 Subject: [PATCH] Completed build script --- build.sh | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/build.sh b/build.sh index f3a04e7..5b83a16 100644 --- a/build.sh +++ b/build.sh @@ -16,17 +16,18 @@ cp -r usr ${name}_${version}_all/; dpkg-deb --build --root-owner-group ${name}_${version}_all +# Successful build if [ $? -eq 0 ]; then RELEASE_ID=$(curl -s -H "Authorization: token ${GIT_TOKEN}" \ "https://git.unblue.uk/api/v1/repos/Unblue/${name}/releases/tags/v${version}" | jq '.id') - echo curl -X POST "https://git.unblue.uk/api/v1/repos/Unblue/${name}/releases/${RELEASE_ID}/assets" \ - -H "Authorization: token ${GIT_TOKEN}" \ - -H "Content-Type: multipart/form-data" \ - -F "attachment=@${name}_${version}_all.deb" - - curl -X POST "https://git.unblue.uk/api/v1/repos/Unblue/${name}/releases/${RELEASE_ID}/assets" \ - -H "Authorization: token ${GIT_TOKEN}" \ - -H "Content-Type: multipart/form-data" \ - -F "attachment=@${name}_${version}_all.deb" + if [ "$RELEASE_ID" != "null" ]; then + # Push release + curl -X POST "https://git.unblue.uk/api/v1/repos/Unblue/${name}/releases/${RELEASE_ID}/assets" \ + -H "Authorization: token ${GIT_TOKEN}" \ + -H "Content-Type: multipart/form-data" \ + -F "attachment=@${name}_${version}_all.deb" + else + echo "WARNING! No release ID. Build successful, but will NOT push release to repository". + fi fi \ No newline at end of file