Merge branch 'feature/ci' into 'master'

Set up CI to automate releases

See merge request cherrypicker/unl0kr!12
This commit is contained in:
Johannes Marbach 2023-02-25 19:13:53 +00:00
commit 79b59b929f

43
.gitlab-ci.yml Normal file
View file

@ -0,0 +1,43 @@
stages:
- prepare_release
- release
prepare:release:
stage: prepare_release
image: python:latest
rules:
- if: $CI_COMMIT_TAG
before_script:
- pip install git-archive-all
script:
- git-archive-all unl0kr.tar.gz
after_script:
- echo "JOB_ID=$CI_JOB_ID" >> job.env
artifacts:
paths:
- unl0kr.tar.gz
expire_in: never
reports:
dotenv: job.env
create:release:
stage: release
image: registry.gitlab.com/gitlab-org/release-cli:latest
rules:
- if: $CI_COMMIT_TAG
needs:
- job: prepare:release
artifacts: true
variables:
TAG: '$CI_COMMIT_SHA'
script:
- echo "do it"
release:
name: 'Release $TAG'
tag_name: '$TAG'
ref: '$TAG'
description: 'Release $TAG'
assets:
links:
- name: "unl0kr.tar.gz"
url: "https://gitlab.com/cherrypicker/unl0kr/-/jobs/$JOB_ID/artifacts/file/unl0kr.tar.gz"