-
Notifications
You must be signed in to change notification settings - Fork 30
106 lines (89 loc) · 2.51 KB
/
build.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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
name: Build
on: push
jobs:
test:
strategy:
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: ['3.9', '3.10', '3.11', '3.12']
runs-on: ${{ matrix.os }}
steps:
#----------------------------------------------
# check-out repo and set-up python and poetry
#----------------------------------------------
- name: Checkout
uses: actions/checkout@v3
- name: Install poetry
run: pipx install poetry
- name: Setup Python 3
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: 'poetry'
- name: Install project
run: poetry install --no-interaction
- name: Run tests
run: poetry run python -m unittest
build:
needs: test
runs-on: ubuntu-latest
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
steps:
#----------------------------------------------
# check-out repo and set-up python and poetry
#----------------------------------------------
- name: Checkout
uses: actions/checkout@v3
- name: Install poetry
run: pipx install poetry
- name: Setup Python 3
uses: actions/setup-python@v4
with:
python-version: '3.x'
cache: 'poetry'
- name: Build
run: poetry build --ansi --no-interaction
- uses: actions/upload-artifact@v2
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
with:
name: dist
path: dist
release:
needs: build
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Install poetry
run: pipx install poetry
- name: Setup Python 3
uses: actions/setup-python@v4
with:
python-version: '3.x'
cache: 'poetry'
- uses: actions/download-artifact@v2
with:
name: dist
path: dist
- name: Generate Changelog
id: changelog
uses: mikepenz/release-changelog-builder-action@v3
with:
owner: iamkroot
ignorePreReleases: true
commitMode: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Release(github)
if: ${{ ! env.ACT }}
uses: softprops/action-gh-release@v1
with:
files: dist/*.*
body: ${{steps.github_release.outputs.changelog}}
- name: Release(pypi)
run: poetry publish --ansi --no-interaction
env:
POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYPI_TOKEN }}
# vim:ft=yaml:ts=2:et: