-
Notifications
You must be signed in to change notification settings - Fork 1
/
.gitlab-ci.yml
59 lines (54 loc) · 1.19 KB
/
.gitlab-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
image: python:latest
stages:
- lint
- build
- test
- deploy
check-job:
stage: lint
rules:
- if: $CI_PIPELINE_SOURCE == 'merge_request_event'
- if: $CI_COMMIT_TAG
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH
script:
- pip install hatch
- hatch run lint:lint
build-job:
stage: build
needs:
- check-job
rules:
- if: $CI_COMMIT_TAG
script:
- pip install hatch
- hatch build
artifacts:
paths:
- dist/*
deploy-pypi-job:
stage: deploy
needs:
- build-job
rules:
- if: $CI_COMMIT_TAG
variables:
PYTHON_KEYRING_BACKEND: keyring.backends.null.Keyring
script:
- pip install hatch
- hatch publish dist -u $HATCH_INDEX_USER - a $HATCH_INDEX_AUTH
release-gitlab-job:
stage: deploy
needs:
- build-job
rules:
- if: $CI_COMMIT_TAG
image: registry.gitlab.com/gitlab-org/release-cli:latest
script:
- apk update
- apk add git
release:
tag_name: $CI_COMMIT_TAG
description: |
| Commit | Description | Committed By |
|---|---|---|
$(git log $CI_COMMIT_TAG...$(git tag --sort=-creatordate | grep -A 1 $CI_COMMIT_TAG | tail -n 1) --no-merges --pretty="format:| %h | %s | %cN |")