Import OSCW runner
All checks were successful
ci/woodpecker/push/build Pipeline was successful

This commit is contained in:
2022-07-24 22:38:42 +02:00
commit b9cfdb1fd5
5 changed files with 98 additions and 0 deletions

22
files/github_publish Normal file
View File

@@ -0,0 +1,22 @@
#!/bin/bash
GITHUB_USERNAME="${1}"
GITHUB_TOKEN="${2}"
ASSET_NAME="${3}"
echo "Creating new GitHub release '${CI_COMMIT_TAG}'"
RESULT=$(curl --user "${GITHUB_USERNAME}:${GITHUB_TOKEN}" -X POST https://api.github.com/repos/${CI_REPO}/releases -d \
"{
\"tag_name\": \"${CI_COMMIT_TAG}\",
\"target_commitish\": \"${CI_COMMIT_SHA}\",
\"name\": \"${CI_COMMIT_TAG}\",
\"draft\": false,
\"prerelease\": false
}")
echo "Create release result: ${RESULT}"
RELEASE_ID=$(echo "${RESULT}" | python -c 'import json,sys;print(json.load(sys.stdin)["id"])')
echo "Publishing artifact: ${ASSET_NAME}"
curl --user "${GITHUB_USERNAME}:${GITHUB_TOKEN}" -X POST https://uploads.github.com/repos/${CI_REPO}/releases/${RELEASE_ID}/assets?name=${ASSET_NAME} \
--header 'Content-Type: text/javascript ' --upload-file ${ASSET_NAME}