mirror of
https://github.com/djhackersdev/bemanitools.git
synced 2025-02-19 20:11:55 +01:00
gitlab-ci: Build + automatic upload of tagged releases
This commit is contained in:
parent
865980991e
commit
f438f04f2a
@ -11,8 +11,7 @@ before_script:
|
|||||||
|
|
||||||
stages:
|
stages:
|
||||||
- build
|
- build
|
||||||
- create-release-package
|
- upload-release
|
||||||
- releasetag
|
|
||||||
|
|
||||||
build:
|
build:
|
||||||
stage: build
|
stage: build
|
||||||
@ -20,48 +19,28 @@ build:
|
|||||||
- apk update && apk add make > /dev/null
|
- apk update && apk add make > /dev/null
|
||||||
script:
|
script:
|
||||||
- make build-docker
|
- make build-docker
|
||||||
|
- mv build/docker/bemanitools.zip bemanitools.zip
|
||||||
artifacts:
|
artifacts:
|
||||||
name: "$CI_COMMIT_SHORT_SHA-$CI_JOB_NAME"
|
name: "$CI_COMMIT_SHORT_SHA-$CI_JOB_NAME"
|
||||||
paths:
|
paths:
|
||||||
- build
|
- bemanitools.zip
|
||||||
only:
|
only:
|
||||||
refs:
|
refs:
|
||||||
- master
|
- master
|
||||||
|
|
||||||
create-release-package:
|
upload-release:
|
||||||
stage: create-release-package
|
stage: upload-release
|
||||||
variables:
|
|
||||||
GIT_STRATEGY: none
|
|
||||||
dependencies:
|
dependencies:
|
||||||
- build
|
- build
|
||||||
before_script:
|
|
||||||
- apk update && apk add zip > /dev/null
|
|
||||||
script:
|
|
||||||
- mv build/docker/bemanitools.zip ./bemanitools.zip
|
|
||||||
- rm -r build
|
|
||||||
- find . -mindepth 1 ! -regex '^./bemanitools.zip' -delete
|
|
||||||
- unzip bemanitools.zip
|
|
||||||
- rm bemanitools.zip
|
|
||||||
artifacts:
|
|
||||||
name: "$CI_COMMIT_SHORT_SHA-$CI_JOB_NAME"
|
|
||||||
paths:
|
|
||||||
- ./*
|
|
||||||
only:
|
|
||||||
refs:
|
|
||||||
- master
|
|
||||||
|
|
||||||
releasetag:
|
|
||||||
stage: releasetag
|
|
||||||
dependencies: []
|
|
||||||
before_script:
|
before_script:
|
||||||
- apk update && apk add curl > /dev/null
|
- apk update && apk add curl > /dev/null
|
||||||
script:
|
script:
|
||||||
|
- ls -la ./
|
||||||
|
- echo "Uploading ${CI_PROJECT_NAME}-${CI_COMMIT_TAG}..."
|
||||||
- |
|
- |
|
||||||
curl --silent --show-error \
|
curl --silent --show-error \
|
||||||
--data "{\"tag_name\": \"${CI_COMMIT_TAG}\", \"name\": \"${CI_PROJECT_NAME}-${CI_COMMIT_TAG}\", \"description\": \"${CI_COMMIT_TAG_MESSAGE:-No release notes.}\"}" \
|
-F "key=${CI_UPLOAD_KEY}" \
|
||||||
--header "Content-Type: application/json" \
|
-F "filename=${CI_PROJECT_NAME}-v${CI_COMMIT_TAG}.zip" \
|
||||||
--header "Private-Token: ${CI_PRIVATE_TOKEN}" \
|
-F "file=@./bemanitools.zip" ${CI_UPLOAD_URL}
|
||||||
--request POST \
|
|
||||||
"${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/releases"
|
|
||||||
only:
|
only:
|
||||||
- tags
|
- tags
|
Loading…
x
Reference in New Issue
Block a user