20 lines
379 B
Bash
Executable File
20 lines
379 B
Bash
Executable File
#! /bin/sh
|
|
|
|
set -e
|
|
|
|
PACKAGE=${GITHUB_REPOSITORY#*/}
|
|
VERSION=$GITHUB_REF_NAME.$(date +%Y-%m-%dt%H.%M.%S)
|
|
|
|
for path in "$@"; do
|
|
fn=$(basename "$path")
|
|
url=$GITHUB_SERVER_URL/api/packages/$GITHUB_ACTOR/generic/$PACKAGE/$VERSION/$fn
|
|
echo $url
|
|
set
|
|
curl \
|
|
--fail \
|
|
--include \
|
|
--user "$GITHUB_ACTOR:$PACKAGE_API_TOKEN" \
|
|
--upload-file "$path" \
|
|
$url
|
|
done
|