You've already forked ugly-queue
31 lines
953 B
Bash
Executable File
31 lines
953 B
Bash
Executable File
#!/bin/bash
|
|
|
|
mkdir -p ./build/
|
|
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/*'
|
|
|
|
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
|
|
curl --user "cibot:${GITEA_TOKEN}" \
|
|
--upload-file "build/ugly-queue.zip" \
|
|
"${GITEA_HOST}/api/packages/cybercinch/composer?version=${1}"
|