Skip to content

Commit d6e27c3

Browse files
committed
Move to GitHub Actions for CI and releases
As part of this we automate the creation of releases now that that's easy to do.
1 parent f881e7a commit d6e27c3

File tree

6 files changed

+239
-177
lines changed

6 files changed

+239
-177
lines changed

.circleci/config.yml

-172
This file was deleted.

.github/workflows/check.yml

+119
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
name: Check
2+
3+
on:
4+
pull_request:
5+
6+
jobs:
7+
test:
8+
name: Test
9+
runs-on: ubuntu-latest
10+
11+
strategy:
12+
matrix:
13+
python-version: ["3.6", "3.7", "3.8", "3.9"]
14+
django-version: ["2.2", "3.0", "3.1", "3.2", "4.0"]
15+
exclude:
16+
# Python 3.6 is not supported beyond Django 3.2
17+
- python-version: "3.6"
18+
django-version: "4.0"
19+
# Python 3.7 is not supported beyond Django 3.2
20+
- python-version: "3.7"
21+
django-version: "4.0"
22+
23+
steps:
24+
- name: Checkout
25+
uses: actions/checkout@v3
26+
27+
- name: Set up Python ${{ matrix.python-version }}
28+
uses: actions/setup-python@v4
29+
with:
30+
python-version: ${{ matrix.python-version }}
31+
cache: poetry
32+
33+
- name: Set up Poetry
34+
uses: abatilo/actions-poetry@v2
35+
with:
36+
# Need to use version < 1.2.0 in order to support Python 3.6
37+
poetry-version: 1.1.15
38+
39+
- name: Set up dependencies
40+
run: poetry install
41+
42+
- name: Run tests
43+
run: poetry run ./runtests
44+
45+
lint:
46+
name: Lint
47+
runs-on: ubuntu-latest
48+
49+
strategy:
50+
matrix:
51+
python-version: ["3.6", "3.7", "3.8", "3.9"]
52+
django-version: ["2.2", "3.0", "3.1", "3.2", "4.0"]
53+
exclude:
54+
# Python 3.6 is not supported beyond Django 3.2
55+
- python-version: "3.6"
56+
django-version: "4.0"
57+
# Python 3.7 is not supported beyond Django 3.2
58+
- python-version: "3.7"
59+
django-version: "4.0"
60+
61+
steps:
62+
- name: Checkout
63+
uses: actions/checkout@v3
64+
65+
- name: Set up Python ${{ matrix.python-version }}
66+
uses: actions/setup-python@v4
67+
with:
68+
python-version: ${{ matrix.python-version }}
69+
cache: poetry
70+
71+
- name: Set up Poetry
72+
uses: abatilo/actions-poetry@v2
73+
with:
74+
# Need to use version < 1.2.0 in order to support Python 3.6
75+
poetry-version: 1.1.15
76+
77+
- name: Set up dependencies
78+
run: poetry install
79+
80+
- name: Run linters
81+
run: poetry run flake8 --jobs=auto --format=github
82+
83+
type-check:
84+
name: Type Check
85+
runs-on: ubuntu-latest
86+
87+
strategy:
88+
matrix:
89+
python-version: ["3.6", "3.7", "3.8", "3.9"]
90+
django-version: ["2.2", "3.0", "3.1", "3.2", "4.0"]
91+
exclude:
92+
# Python 3.6 is not supported beyond Django 3.2
93+
- python-version: "3.6"
94+
django-version: "4.0"
95+
# Python 3.7 is not supported beyond Django 3.2
96+
- python-version: "3.7"
97+
django-version: "4.0"
98+
99+
steps:
100+
- name: Checkout
101+
uses: actions/checkout@v3
102+
103+
- name: Set up Python ${{ matrix.python-version }}
104+
uses: actions/setup-python@v4
105+
with:
106+
python-version: ${{ matrix.python-version }}
107+
cache: poetry
108+
109+
- name: Set up Poetry
110+
uses: abatilo/actions-poetry@v2
111+
with:
112+
# Need to use version < 1.2.0 in order to support Python 3.6
113+
poetry-version: 1.1.15
114+
115+
- name: Set up dependencies
116+
run: poetry install
117+
118+
- name: Run type checking
119+
run: poetry run ./script/type-check

.github/workflows/publish.yml

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Create Release & Publish to PYPI
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
jobs:
9+
run-checks:
10+
uses: ./.github/workflows/check.yml
11+
12+
publish:
13+
runs-on: ubuntu-latest
14+
needs:
15+
- run-checks
16+
steps:
17+
# Using v2 or later strips tag annotations https://github.com/actions/checkout/issues/290
18+
- uses: actions/checkout@v1
19+
20+
- name: Set up Python
21+
uses: actions/setup-python@v4
22+
with:
23+
python-version: '3.7'
24+
25+
- name: Set up Poetry
26+
uses: abatilo/actions-poetry@v2
27+
with:
28+
# Need to use version < 1.2.0 in order to support Python 3.6
29+
poetry-version: 1.1.15
30+
31+
- name: Build
32+
run: poetry build
33+
34+
- name: Publish to PyPI
35+
run: |
36+
poetry config pypi-token.pypi "${{ secrets.DLQ_PYPI_TOKEN }}"
37+
poetry publish
38+
39+
- name: Create GitHub Release
40+
uses: ncipollo/release-action@v1
41+
with:
42+
body: ${{ steps.tag_data.outputs.git-tag-annotation }}

DEVELOPMENT.md

+3-4
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,14 @@ Tests are run with `./runtests`
77
## Releasing
88

99
CI handles releasing to PyPI.
10-
Releases on GitHub are created manually.
10+
Releases on GitHub are created automatically, using the message from the annotated tag.
1111

1212
Here's how to do a release:
1313

1414
- Get all the desired changes into `master`
1515
- Wait for CI to pass that
1616
- Add a bump commit (see previous "Declare vX.Y.Z" commits; `poetry version` may be useful here)
1717
- Push that commit on master
18-
- Create a tag of that version number (`git tag v$(poetry version --short)`)
18+
- Create a tag of that version number, with a description of the changes in the annotation (`git tag v$(poetry version --short) --annotate`)
1919
- Push the tag (`git push --tags`)
20-
- CI will build & deploy that release
21-
- Create a Release on GitHub, ideally with a summary of changes
20+
- CI will build & deploy that release as a GitHub Release and to PyPI

0 commit comments

Comments
 (0)