Skip to content

Commit 57566c2

Browse files
committed
Merge branch 'github-actions'
2 parents f881e7a + ac85247 commit 57566c2

File tree

6 files changed

+232
-177
lines changed

6 files changed

+232
-177
lines changed

.circleci/config.yml

Lines changed: 0 additions & 172 deletions
This file was deleted.

.github/workflows/check.yml

Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
name: Check
2+
3+
on:
4+
pull_request:
5+
6+
jobs:
7+
test:
8+
name: Test
9+
runs-on: ubuntu-20.04
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 Poetry
28+
# Need to use version < 1.2.0 in order to support Python 3.6
29+
run: pipx install poetry==1.1.15
30+
31+
- name: Set up Python ${{ matrix.python-version }}
32+
uses: actions/setup-python@v4
33+
with:
34+
python-version: ${{ matrix.python-version }}
35+
cache: poetry
36+
37+
- name: Set up dependencies
38+
run: |
39+
poetry install
40+
poetry run pip install "django~=${{ matrix.django-version }}.0"
41+
42+
- name: Run tests
43+
run: poetry run ./runtests
44+
45+
lint:
46+
name: Lint
47+
runs-on: ubuntu-20.04
48+
49+
strategy:
50+
matrix:
51+
python-version: ["3.6", "3.9"]
52+
django-version: ["2.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+
58+
steps:
59+
- name: Checkout
60+
uses: actions/checkout@v3
61+
62+
- name: Set up Poetry
63+
# Need to use version < 1.2.0 in order to support Python 3.6
64+
run: pipx install poetry==1.1.15
65+
66+
- name: Set up Python ${{ matrix.python-version }}
67+
uses: actions/setup-python@v4
68+
with:
69+
python-version: ${{ matrix.python-version }}
70+
cache: poetry
71+
72+
- name: Set up dependencies
73+
run: |
74+
poetry install
75+
poetry run pip install "django~=${{ matrix.django-version }}.0"
76+
77+
- name: Run linters
78+
run: poetry run flake8 --jobs=auto --format=github
79+
80+
type-check:
81+
name: Type Check
82+
runs-on: ubuntu-20.04
83+
84+
strategy:
85+
matrix:
86+
python-version: ["3.6", "3.9"]
87+
django-version: ["2.2", "4.0"]
88+
exclude:
89+
# Python 3.6 is not supported beyond Django 3.2
90+
- python-version: "3.6"
91+
django-version: "4.0"
92+
93+
steps:
94+
- name: Checkout
95+
uses: actions/checkout@v3
96+
97+
- name: Set up Poetry
98+
# Need to use version < 1.2.0 in order to support Python 3.6
99+
run: pipx install poetry==1.1.15
100+
101+
- name: Set up Python ${{ matrix.python-version }}
102+
uses: actions/setup-python@v4
103+
with:
104+
python-version: ${{ matrix.python-version }}
105+
cache: poetry
106+
107+
- name: Set up dependencies
108+
run: |
109+
poetry install
110+
poetry run pip install "django~=${{ matrix.django-version }}.0"
111+
112+
- name: Run type checking
113+
run: poetry run ./script/type-check

.github/workflows/publish.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
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 Poetry
21+
# Need to use version < 1.2.0 in order to support Python 3.6
22+
run: pipx install poetry==1.1.15
23+
24+
- name: Set up Python
25+
uses: actions/setup-python@v4
26+
with:
27+
python-version: '3.7'
28+
cache: poetry
29+
30+
- name: Build
31+
run: poetry build
32+
33+
- name: Publish to PyPI
34+
run: |
35+
poetry config pypi-token.pypi "${{ secrets.DLQ_PYPI_TOKEN }}"
36+
poetry publish
37+
38+
- name: Create GitHub Release
39+
uses: ncipollo/release-action@v1
40+
with:
41+
body: ${{ steps.tag_data.outputs.git-tag-annotation }}

DEVELOPMENT.md

Lines changed: 3 additions & 4 deletions
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)