nmreval/tools/upload_gitea.sh
Dominik Demuth f7a17f22cf
All checks were successful
Build AppImage / Explore-Gitea-Actions (push) Successful in 1m3s
action_test (#170)
Co-authored-by: Dominik Demuth <dominik.demuth@physik.tu-darmstadt.de>
Reviewed-on: #170
2023-12-06 17:05:25 +00:00

39 lines
1.5 KiB
Bash
Executable File

#!/bin/bash
if [ -z ${GO_PIPELINE_LABEL} ]; then
echo "GO_PIPELINE_LABEL is not set. doing nothing"
else
APPIMAGE=NMReval-${GO_PIPELINE_LABEL}-x86_64.AppImage
ZSYNC=NMReval-${GO_PIPELINE_LABEL}-x86_64.AppImage.zsync
GITEA_OWNER=IPKM
echo "Upload AppImage started"
#
# AppImage
#
# versioned
curl -sS --user ${UPLOAD_USER}:${UPLOAD_TOKEN} \
--upload-file $APPIMAGE \
https://gitea.pkm.physik.tu-darmstadt.de/api/packages/${GITEA_OWNER}/generic/NMReval/${GO_PIPELINE_LABEL}/$APPIMAGE
# latest
curl -sS --user ${UPLOAD_USER}:${UPLOAD_TOKEN} -X DELETE \
https://gitea.pkm.physik.tu-darmstadt.de/api/packages/${GITEA_OWNER}/generic/NMReval/latest/NMReval-latest-x86_64.Appimage
curl -sS --user ${UPLOAD_USER}:${UPLOAD_TOKEN} \
--upload-file $APPIMAGE \
https://gitea.pkm.physik.tu-darmstadt.de/api/packages/${GITEA_OWNER}/generic/NMReval/latest/NMReval-latest-x86_64.Appimage
#
# zsync files
#
# versioned
curl -sS --user ${UPLOAD_USER}:${UPLOAD_TOKEN} \
--upload-file $ZSYNC \
https://gitea.pkm.physik.tu-darmstadt.de/api/packages/${GITEA_OWNER}/generic/NMReval/${GO_PIPELINE_LABEL}/$ZSYNC
# latest
curl -sS --user ${UPLOAD_USER}:${UPLOAD_TOKEN} -X DELETE \
https://gitea.pkm.physik.tu-darmstadt.de/api/packages/${GITEA_OWNER}/generic/NMReval/latest/NMReval-latest-x86_64.Appimage.zsync
curl -sS --user ${UPLOAD_USER}:${UPLOAD_TOKEN} \
--upload-file $ZSYNC \
https://gitea.pkm.physik.tu-darmstadt.de/api/packages/${GITEA_OWNER}/generic/NMReval/latest/NMReval-latest-x86_64.Appimage.zsync
fi