mirror of
https://git.unlock-music.dev/um/web.git
synced 2024-12-29 23:35:04 +08:00
ci: upload to gitea packages instead of s3
This commit is contained in:
parent
e2b81f666d
commit
f2d7d6c2e3
28
.drone.yml
28
.drone.yml
@ -15,23 +15,13 @@ steps:
|
|||||||
- ./scripts/build-and-package.sh legacy
|
- ./scripts/build-and-package.sh legacy
|
||||||
- ./scripts/build-and-package.sh extension
|
- ./scripts/build-and-package.sh extension
|
||||||
- ./scripts/build-and-package.sh modern
|
- ./scripts/build-and-package.sh modern
|
||||||
- sha256sum *.zip > sha256sum.txt
|
|
||||||
- mkdir -p upload
|
|
||||||
- mv *.zip sha256sum.txt upload/
|
|
||||||
|
|
||||||
- name: upload
|
- name: upload artifact
|
||||||
image: "plugins/s3"
|
image: busybox:1.34-glibc
|
||||||
settings:
|
environment:
|
||||||
path_style: true
|
DRONE_GITEA_SERVER: https://git.unlock-music.dev
|
||||||
endpoint:
|
GITEA_API_KEY:
|
||||||
from_secret: S3_ENDPOINT
|
from_secret: GITEA_API_KEY
|
||||||
access_key:
|
commands:
|
||||||
from_secret: S3_ACCESS_KEY
|
- apt-get update && apt-get install -y curl
|
||||||
secret_key:
|
- ./scripts/upload-packages.sh
|
||||||
from_secret: S3_SECRET_KEY
|
|
||||||
bucket:
|
|
||||||
from_secret: S3_BUCKET
|
|
||||||
region: "auto"
|
|
||||||
source: "upload/*"
|
|
||||||
strip_prefix: "upload/"
|
|
||||||
target: "${DRONE_REPO}/${DRONE_BUILD_NUMBER}/"
|
|
||||||
|
14
scripts/upload-packages.sh
Normal file
14
scripts/upload-packages.sh
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
set -ex
|
||||||
|
|
||||||
|
cd "$(git rev-parse --show-toplevel)"
|
||||||
|
|
||||||
|
URL_BASE="$DRONE_GITEA_SERVER/api/packages/${DRONE_REPO_NAMESPACE}/generic/${DRONE_REPO_NAME}-build"
|
||||||
|
|
||||||
|
for ZIP_NAME in *.zip; do
|
||||||
|
UPLOAD_URL="${URL_BASE}/${DRONE_BUILD_NUMBER}/${ZIP_NAME}"
|
||||||
|
sha256sum "${ZIP_NAME}"
|
||||||
|
curl -sLifu "um-release-bot:$GITEA_API_KEY" -T "${ZIP_NAME}" "${UPLOAD_URL}"
|
||||||
|
echo "Uploaded to: ${UPLOAD_URL}"
|
||||||
|
done
|
Loading…
Reference in New Issue
Block a user