Files
ugly-queue/scripts/build.sh

31 lines
953 B
Bash
Raw Normal View History

2024-10-24 16:36:25 +13:00
#!/bin/bash
mkdir -p ./build/
2024-10-24 16:36:25 +13:00
echo "Made temporary directory"
# Package up the release (Needs to be .zip for upload to gitea)
zip -r "./build/ugly-queue.zip" \
. \
-x './vendor/*' \
-x './tests/*' \
-x './build/*' \
-x './.git/*' \
-x './.idea/*' \
-x './.github/*' \
-x './scripts/*'
2024-10-24 16:36:25 +13:00
RELEASE_ID=$(curl --silent -X 'GET' "${GITEA_HOST}/api/v1/repos/cybercinch/ugly-queue/releases/latest" \
-H "accept: application/json" \
-H "Authorization: token ${GITEA_TOKEN}" | jq -r .id)
# Attach to release
curl --silent -X 'POST' "${GITEA_HOST}/api/v1/repos/cybercinch/ugly-queue/releases/${RELEASE_ID}/assets?name=ugly-queue-${1}.tar.gz" \
-H "Authorization: token ${GITEA_TOKEN}" \
--form attachment="@build/ugly-queue-${1}.tar.gz"
# Upload the artifact to composer registry
2024-10-24 16:58:31 +13:00
curl --user "cibot:${GITEA_TOKEN}" \
--upload-file "build/ugly-queue.zip" \
"${GITEA_HOST}/api/packages/cybercinch/composer?version=${1}"