forked from chaychoong/coveragepy-lcov
-
Notifications
You must be signed in to change notification settings - Fork 4
75 lines (60 loc) · 1.66 KB
/
release.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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
name: Release
on:
push:
branches:
- master
tags:
- "*.*.*"
jobs:
Release:
runs-on: ubuntu-20.04
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Get tag
id: tag
run: echo "tag=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
- name: Set up Python 3.6
uses: actions/setup-python@v5
with:
python-version: "3.6"
- name: Setup poetry
uses: abatilo/actions-poetry@v2
with:
poetry-version: "1.1.10"
- name: Update PATH
shell: bash
run: echo "$HOME/.local/bin" >> $GITHUB_PATH
- name: Configure poetry
shell: bash
run: poetry config virtualenvs.in-project true
- name: Poetry check & build
shell: bash
run: poetry check && poetry build
- name: Install dependencies
shell: bash
run: poetry install
- name: PyTest
shell: bash
run: poetry run pytest
- name: Mypy
shell: bash
run: poetry run mypy .
- name: Check Version
id: check-version
shell: bash
run: |
[[ "$(poetry version --short)" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]] \
|| echo "prerelease=true" >> $GITHUB_OUTPUT
- name: Create Release
uses: ncipollo/release-action@v1
with:
artifacts: "dist/*"
token: ${{ secrets.GITHUB_TOKEN }}
draft: false
prerelease: steps.check-version.outputs.prerelease == 'true'
- name: Publish to PyPI
env:
POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_TOKEN }}
shell: bash
run: poetry publish