2024-01-04 20:19:31 -07:00
|
|
|
#! /bin/sh
|
|
|
|
|
2024-01-04 20:29:40 -07:00
|
|
|
set -e
|
|
|
|
|
2024-01-04 20:19:31 -07:00
|
|
|
PACKAGE=${GITHUB_REPOSITORY#*/}
|
2024-01-04 21:01:53 -07:00
|
|
|
VERSION=$GITHUB_REF_NAME.$(date +%Y-%m-%dt%H.%M.%S)
|
2024-01-04 20:19:31 -07:00
|
|
|
|
|
|
|
for path in "$@"; do
|
|
|
|
fn=$(basename "$path")
|
2024-01-04 21:13:21 -07:00
|
|
|
url=$GITHUB_SERVER_URL/api/packages/$GITHUB_ACTOR/generic/$PACKAGE/$VERSION/$fn
|
|
|
|
echo $url
|
2024-01-04 20:44:07 -07:00
|
|
|
curl \
|
2024-01-04 21:13:21 -07:00
|
|
|
--fail \
|
2024-01-04 21:01:53 -07:00
|
|
|
--include \
|
2024-01-04 20:58:32 -07:00
|
|
|
--user "$GITHUB_ACTOR:$PACKAGE_API_TOKEN" \
|
2024-01-04 20:44:07 -07:00
|
|
|
--upload-file "$path" \
|
2024-01-04 21:13:21 -07:00
|
|
|
$url
|
2024-01-04 20:19:31 -07:00
|
|
|
done
|