ci: Added Gitea Actions config 👷

This commit is contained in:
2024-10-24 16:36:25 +13:00
parent e1cac1e31d
commit afc24185d3
4 changed files with 109 additions and 0 deletions

24
scripts/build.sh Executable file
View File

@@ -0,0 +1,24 @@
#!/bin/bash
mkdir -p ./build/tmp
echo "Made temporary directory"
# Package up the release
tar -czf "./build/ugly-queue-${1}.tar.gz" \
--exclude='./vendor' \
--exclude='./tests' \
--exclude='./build' \
.
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 -H "Authorization: token ${GITEA_TOKEN}" \
--upload-file "build/ugly-queue-${1}.tar.gz" \
"${GITEA_HOST}/api/packages/cybercinch/composer?version=${1}"