image: docker:stable variables: DOCKER_TLS_CERTDIR: "/certs" services: - docker:19.03.8-dind before_script: - docker info stages: - build - create-release-package - releasetag build: stage: build before_script: - apk update && apk add make > /dev/null script: - make build-docker artifacts: name: "$CI_COMMIT_SHORT_SHA-$CI_JOB_NAME" paths: - build only: refs: - master create-release-package: stage: create-release-package variables: GIT_STRATEGY: none dependencies: - build before_script: - apk update && apk add zip > /dev/null script: - mv build/docker/pumptools-public.zip ./pumptools.zip - rm -r build - find . -mindepth 1 ! -regex '^./pumptools.zip' -delete - unzip pumptools.zip - rm pumptools.zip artifacts: name: "$CI_COMMIT_SHORT_SHA-$CI_JOB_NAME" paths: - ./* only: refs: - master releasetag: stage: releasetag dependencies: [] before_script: - apk update && apk add curl > /dev/null script: - | 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.}\"}" \ --header "Content-Type: application/json" \ --header "Private-Token: ${CI_PRIVATE_TOKEN}" \ --request POST \ "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/releases" only: - tags