This commit is contained in:
@@ -25,6 +25,7 @@ jobs:
|
|||||||
DJANGO_ALLOWED_HOSTS: "127.0.0.1,localhost"
|
DJANGO_ALLOWED_HOSTS: "127.0.0.1,localhost"
|
||||||
IMAGE_NAME: achievement_inputing_ci
|
IMAGE_NAME: achievement_inputing_ci
|
||||||
ALIST_URL: https://alist.spdis.top
|
ALIST_URL: https://alist.spdis.top
|
||||||
|
ALIST_PATH: /lanzouyunyouxiang/ci
|
||||||
ALIST_USER: ${{ secrets.ALIST_USER }}
|
ALIST_USER: ${{ secrets.ALIST_USER }}
|
||||||
ALIST_PASSWORD: ${{ secrets.ALIST_PASSWORD }}
|
ALIST_PASSWORD: ${{ secrets.ALIST_PASSWORD }}
|
||||||
GITEA_SERVER: ${{ github.server_url }}
|
GITEA_SERVER: ${{ github.server_url }}
|
||||||
@@ -94,10 +95,10 @@ jobs:
|
|||||||
cat "$GITHUB_WORKSPACE/login.json"
|
cat "$GITHUB_WORKSPACE/login.json"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
curl -sS -X POST "$BASE/api/fs/mkdir" -H "Authorization: $TOKEN" -H "Content-Type: application/json" -d "{\"path\":\"/ci\"}" >/dev/null 2>&1 || true
|
curl -sS -X POST "$BASE/api/fs/mkdir" -H "Authorization: $TOKEN" -H "Content-Type: application/json" -d "{\"path\":\"$ALIST_PATH\"}" >/dev/null 2>&1 || true
|
||||||
UPLOAD_STATUS=$(curl -sS -w "%{http_code}" -o /dev/null -X PUT "$BASE/api/fs/form" -H "Authorization: $TOKEN" -F "path=/ci" -F "file=@$GITHUB_WORKSPACE/$ART;type=application/x-tar")
|
UPLOAD_STATUS=$(curl -sS -w "%{http_code}" -o /dev/null -X PUT "$BASE/api/fs/form" -H "Authorization: $TOKEN" -F "path=$ALIST_PATH" -F "file=@$GITHUB_WORKSPACE/$ART;type=application/x-tar")
|
||||||
if [ "$UPLOAD_STATUS" -ge 400 ]; then
|
if [ "$UPLOAD_STATUS" -ge 400 ]; then
|
||||||
UPLOAD_STATUS=$(curl -sS -w "%{http_code}" -o /dev/null -X PUT "$BASE/api/fs/form" -H "Authorization: Bearer $TOKEN" -F "path=/ci" -F "file=@$GITHUB_WORKSPACE/$ART;type=application/x-tar")
|
UPLOAD_STATUS=$(curl -sS -w "%{http_code}" -o /dev/null -X PUT "$BASE/api/fs/form" -H "Authorization: Bearer $TOKEN" -F "path=$ALIST_PATH" -F "file=@$GITHUB_WORKSPACE/$ART;type=application/x-tar")
|
||||||
fi
|
fi
|
||||||
if [ "$UPLOAD_STATUS" -ge 400 ]; then
|
if [ "$UPLOAD_STATUS" -ge 400 ]; then
|
||||||
echo upload_failed
|
echo upload_failed
|
||||||
@@ -110,6 +111,6 @@ jobs:
|
|||||||
BRANCH=${GITHUB_REF#refs/heads/}
|
BRANCH=${GITHUB_REF#refs/heads/}
|
||||||
TAG="$VERSION"
|
TAG="$VERSION"
|
||||||
NAME="$VERSION"
|
NAME="$VERSION"
|
||||||
DL="${ALIST_URL%/}/ci/$ART"
|
DL="${ALIST_URL%/}${ALIST_PATH}/$ART"
|
||||||
JSON=$(printf '{"tag_name":"%s","target_commitish":"%s","name":"%s","body":"%s"}' "$TAG" "$BRANCH" "$NAME" "$DL")
|
JSON=$(printf '{"tag_name":"%s","target_commitish":"%s","name":"%s","body":"%s"}' "$TAG" "$BRANCH" "$NAME" "$DL")
|
||||||
curl -sS -X POST "$GITEA_SERVER/api/v1/repos/$GITEA_REPO/releases" -H "Content-Type: application/json" -H "Authorization: token $RELEASE_TOKEN" -d "$JSON"
|
curl -sS -X POST "$GITEA_SERVER/api/v1/repos/$GITEA_REPO/releases" -H "Content-Type: application/json" -H "Authorization: token $RELEASE_TOKEN" -d "$JSON"
|
||||||
|
|||||||
Reference in New Issue
Block a user