mirror of
https://git.um-react.app/um/um-react.git
synced 2025-11-28 03:23:02 +00:00
ci: get started on ci build
This commit is contained in:
21
scripts/publish.sh
Executable file
21
scripts/publish.sh
Executable file
@@ -0,0 +1,21 @@
|
||||
#!/bin/bash -ex
|
||||
|
||||
BRANCH_NAME="$(git branch --show-current)"
|
||||
|
||||
publish_gitea() {
|
||||
local ZIP_NAME="$1"
|
||||
local URL="${DRONE_GITEA_SERVER}/api/packages/${DRONE_REPO_NAMESPACE}/generic/${DRONE_REPO_NAME}/${DRONE_BUILD_NUMBER}/${ZIP_NAME}"
|
||||
sha256sum "${ZIP_NAME}"
|
||||
curl -sLifu "um-release-bot:${GITEA_API_KEY}" -T "${ZIP_NAME}" "${URL}"
|
||||
echo "Uploaded to: ${URL}"
|
||||
}
|
||||
|
||||
# Only publish main branch by default
|
||||
if [[ "${BRANCH_NAME}" = "main" ]]; then
|
||||
echo 'prepare to publish...'
|
||||
|
||||
if [[ -n "${GITEA_API_KEY}" ]]; then
|
||||
echo "Publish to gitea..."
|
||||
publish_gitea "um-react.zip"
|
||||
fi
|
||||
fi
|
||||
Reference in New Issue
Block a user