On tag, upload artifacts to project and update tag note
This commit is contained in:
parent
5b29497859
commit
ec53d9c504
@ -47,6 +47,16 @@ pages:
|
|||||||
- mkdir .public
|
- mkdir .public
|
||||||
- cp latest.zip .public
|
- cp latest.zip .public
|
||||||
- mv .public public
|
- mv .public public
|
||||||
|
- if [[ -z $GITLAB_API_TOKEN ]]; then exit; fi
|
||||||
|
- export PROJECT_API_URL="https://framagit.org/api/v4/projects/${CI_PROJECT_ID}"
|
||||||
|
- export DESCRIPTION_URL="${PROJECT_API_URL}/repository/tags/${CI_COMMIT_TAG}"
|
||||||
|
- export RELEASE_URL="${DESCRIPTION_URL}/release"
|
||||||
|
- 'export HEADER="Private-Token: ${GITLAB_API_TOKEN}"'
|
||||||
|
- export artifactUrl=$(curl --request POST --header "${HEADER}" --form "file=@public/latest.zip" "${PROJECT_API_URL}/uploads" | jq .url)
|
||||||
|
- export description=$(curl -s --header "${HEADER}" "${DESCRIPTION_URL}" | jq .release.description | sed -e 's@"@@g')
|
||||||
|
- if [[ $description == 'null' ]]; then export METHOD="POST"; echo -e 'You can download the release zip here:'" [latest.zip](${artifactUrl})" > /tmp/text; fi
|
||||||
|
- if [[ $description != 'null' ]]; then export METHOD="PUT"; echo -e "${description}\n\n"'You can download the release zip here:'" [latest.zip](${artifactUrl})" > /tmp/text; fi
|
||||||
|
- curl -s --request $METHOD --data-urlencode "description@/tmp/text" --header "${HEADER}" "${RELEASE_URL}"
|
||||||
artifacts:
|
artifacts:
|
||||||
paths:
|
paths:
|
||||||
- public
|
- public
|
||||||
|
Loading…
Reference in New Issue
Block a user