mockband/.gitea/publish.sh

28 lines
475 B
Bash
Raw Permalink 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
2024-01-08 13:13:42 -07:00
echo "=== Delete $VERSION"
2024-01-05 09:02:53 -07:00
curl \
--user "$GITHUB_ACTOR:$PACKAGE_API_TOKEN" \
--request DELETE \
$BASE
2024-01-08 13:13:42 -07:00
echo
2024-01-05 09:02:53 -07:00
2024-01-04 21:36:17 -07:00
for path in "$@"; do
fn=$(basename "$path")
echo "=== Upload $VERSION/$fn"
2024-01-04 23:12:51 -07:00
2024-01-04 21:36:17 -07:00
curl \
--fail \
--user "$GITHUB_ACTOR:$PACKAGE_API_TOKEN" \
--upload-file "$path" \
$BASE/$fn
2024-01-08 13:13:42 -07:00
echo
2024-01-04 21:36:17 -07:00
done