-
Notifications
You must be signed in to change notification settings - Fork 0
54 lines (52 loc) · 1.4 KB
/
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
on:
pull_request:
branches:
- master
push:
branches:
- master
tags:
- "*"
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: setup Python
uses: actions/setup-python@v4
with:
python-version: "3.8"
- name: install
run: pip install .
- name: compile
run: python -m compileall .
publish:
runs-on: ubuntu-latest
needs: test
if: success() && github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
steps:
- uses: actions/checkout@v4
- name: setup Python
uses: actions/setup-python@v4
with:
python-version: "3.8"
- name: install
run: pip install .[dev]
- name: get changelog entry
id: changelog
run: python tools/extract-changelog-entry.py ${GITHUB_REF#refs/tags/} > changelog_entry
- name: build package
run: python setup.py bdist_wheel
- name: publish package
uses: pypa/[email protected]
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
- name: create Release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
body_path: changelog_entry