mockband/.gitea/publish.sh

24 lines
447 B
Bash
Raw Normal View History

2024-01-04 21:36:17 -07:00
#! /bin/sh
set -e
PACKAGE=${GITHUB_REPOSITORY#*/}
VERSION=$GITHUB_REF_NAME
BASE=$GITHUB_SERVER_URL/api/packages/$GITHUB_ACTOR/generic/$PACKAGE/$VERSION
for path in "$@"; do
fn=$(basename "$path")
echo "=== Upload $VERSION/$fn"
2024-01-04 23:12:51 -07:00
curl \
--user "$GITHUB_ACTOR:$PACKAGE_API_TOKEN" \
--request DELETE \
$BASE/$fn
2024-01-04 21:36:17 -07:00
curl \
--fail \
--user "$GITHUB_ACTOR:$PACKAGE_API_TOKEN" \
--upload-file "$path" \
$BASE/$fn
done