Commit 90bab2b3 authored by Jgiannelos's avatar Jgiannelos
Browse files

Add automation for CI releases

* On new tag
  * ensure artifacts don't expire
  * publish a new release
  * link the packages created as artifacts
parent 777907e5
Pipeline #377 passed with stages
in 2 minutes and 17 seconds
...@@ -2,6 +2,7 @@ stages: ...@@ -2,6 +2,7 @@ stages:
- lint - lint
- test - test
- package - package
- release
lint: lint:
stage: lint stage: lint
...@@ -23,9 +24,10 @@ build_python: ...@@ -23,9 +24,10 @@ build_python:
image: python:latest image: python:latest
script: script:
- python setup.py sdist - python setup.py sdist
- cp dist/maps-deduped-tilelist*.tar.gz .
artifacts: artifacts:
paths: paths:
- dist/maps-deduped-tilelist*.tar.gz - maps-deduped-tilelist*.tar.gz
build_debian: build_debian:
stage: package stage: package
...@@ -38,3 +40,55 @@ build_debian: ...@@ -38,3 +40,55 @@ build_debian:
artifacts: artifacts:
paths: paths:
- python3-maps-deduped-tilelist*.deb - python3-maps-deduped-tilelist*.deb
publish_debian_package:
rules:
- if: $CI_COMMIT_TAG
stage: release
image: registry.gitlab.com/gitlab-org/release-cli:latest
script:
- echo "Ensure debian artifacts don't expire for $CI_COMMIT_TAG"
needs:
- job: build_debian
artifacts: true
artifacts:
paths:
- python3-maps-deduped-tilelist*.deb
expire_in: never
publish_python_package:
rules:
- if: $CI_COMMIT_TAG
stage: release
image: registry.gitlab.com/gitlab-org/release-cli:latest
script:
- echo "Ensure python artifacts don't expire for $CI_COMMIT_TAG"
needs:
- job: build_python
artifacts: true
artifacts:
paths:
- maps-deduped-tilelist*.tar.gz
expire_in: never
release:
rules:
- if: $CI_COMMIT_TAG
stage: release
image: registry.gitlab.com/gitlab-org/release-cli:latest
needs:
- job: publish_debian_package
- job: publish_python_package
script:
- echo 'Create a new release for $CI_COMMIT_TAG'
release:
tag_name: "$CI_COMMIT_TAG"
description: "$CI_COMMIT_TAG"
assets:
links:
- name: Debian package
url: "$CI_API_V4_URL/projects/$CI_PROJECT_ID/jobs/artifacts/$CI_COMMIT_TAG/download?job=publish_debian_package"
link_type: package
- name: Python package
url: "$CI_API_V4_URL/projects/$CI_PROJECT_ID/jobs/artifacts/$CI_COMMIT_TAG/download?job=publish_python_package"
link_type: package
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment