mirror of
https://framagit.org/framasoft/framadate/framadate
synced 2026-07-25 10:53:50 +00:00
Merge branch 'push-artifacts-to-tags-notes' into 'master'
On tag, upload artifacts to project and update tag note See merge request framasoft/framadate/framadate!356
This commit is contained in:
commit
bf3313118a
1 changed files with 10 additions and 0 deletions
|
|
@ -47,6 +47,16 @@ pages:
|
|||
- mkdir .public
|
||||
- cp latest.zip .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:
|
||||
paths:
|
||||
- public
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue