Skip to content

Commit f7cdd36

Browse files
committed
setup: build sdists/wheel, release through Github
1 parent 32c7d7f commit f7cdd36

File tree

3 files changed

+30
-0
lines changed

3 files changed

+30
-0
lines changed

.github/workflows/release.yaml

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: Release
2+
on:
3+
release:
4+
types: [published]
5+
jobs:
6+
release:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v2
10+
- name: Set up Python 3.7
11+
uses: actions/setup-python@v2
12+
with:
13+
python-version: 3.7
14+
- run: pip install -U nox pip wheel
15+
- run: nox -s build
16+
- uses: pypa/gh-action-pypi-publish@master
17+
with:
18+
user: __token__
19+
password: ${{ secrets.PYPI_TOKEN }}

.github/workflows/tests.yaml

+1
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,4 @@ jobs:
1414
python-version: ${{ matrix.python-version }}
1515
- run: pip install -U nox pip wheel
1616
- run: nox
17+
- run: nox -s build

noxfile.py

+10
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
"""Automation using nox.
22
"""
3+
import glob
4+
35
import nox
46

57
nox.options.reuse_existing_virtualenvs = True
@@ -26,3 +28,11 @@ def lint(session: nox.Session) -> None:
2628
session.run("pre-commit", "run", *args)
2729
session.run("python", "-m", "mypy")
2830
session.run("python", "-m", "pylint", *locations)
31+
32+
33+
@nox.session
34+
def build(session: nox.Session) -> None:
35+
session.install("build", "setuptools", "twine")
36+
session.run("python", "-m", "build")
37+
dists = glob.glob("dist/*")
38+
session.run("twine", "check", *dists, silent=True)

0 commit comments

Comments
 (0)