Skip to content

Commit 8b56a0b

Browse files
authored
Include release pipeline in tox (#98)
1 parent 6866b3b commit 8b56a0b

File tree

4 files changed

+42
-40
lines changed

4 files changed

+42
-40
lines changed

.github/workflows/release.yml

-36
This file was deleted.

.github/workflows/tox.yml

+39-1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ on:
55
branches: ["main"]
66
pull_request:
77
branches: ["main"]
8+
release:
9+
types: [published]
810
# Run the tox tests every 8 hours.
911
# This will help to identify faster if
1012
# there is a CI failure related to a
@@ -38,7 +40,7 @@ jobs:
3840
default_python: "3.10"
3941
other_names: |
4042
lint
41-
packaging
43+
pkg
4244
py38,py38-devel
4345
py39,py39-devel
4446
py310,py310-devel
@@ -183,3 +185,39 @@ jobs:
183185
uses: actions/upload-artifact/merge@v4
184186
with:
185187
delete-merged: true
188+
pypi:
189+
name: Publish to PyPI registry
190+
needs: check
191+
if: github.event_name == 'release' && github.event.action == 'published'
192+
environment: release # approval
193+
runs-on: ubuntu-24.04
194+
permissions:
195+
id-token: write
196+
197+
env:
198+
FORCE_COLOR: 1
199+
PY_COLORS: 1
200+
TOXENV: pkg
201+
202+
steps:
203+
- name: Switch to using Python 3.10 by default
204+
uses: actions/setup-python@v5
205+
with:
206+
python-version: "3.10"
207+
208+
- name: Install tox
209+
run: python3 -m pip install --user "tox>=4.0.0"
210+
211+
- name: Check out src from Git
212+
uses: actions/checkout@v4
213+
with:
214+
fetch-depth: 0 # needed by setuptools-scm
215+
submodules: true
216+
217+
- name: Build dists
218+
run: python3 -m tox
219+
220+
- name: Publish to pypi.org
221+
if: >- # "create" workflows run separately from "push" & "pull_request"
222+
github.event_name == 'release'
223+
uses: pypa/gh-action-pypi-publish@release/v1

pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ maintainers = [
2121
]
2222
license = {text = "MIT"}
2323
classifiers = [
24-
"Development Status :: 4 - Beta",
24+
"Development Status :: 5 - Production/Stable",
2525
"Intended Audience :: Developers",
2626
"Framework :: tox",
2727
"License :: OSI Approved :: MIT License",

tox.ini

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ minversion = 4.0.2
33
ignore_path = tests
44
envlist =
55
lint
6-
packaging
6+
pkg
77
py
88
py-devel
99

@@ -42,7 +42,7 @@ deps =
4242
commands =
4343
python -m pre_commit run {posargs:--all}
4444

45-
[testenv:packaging]
45+
[testenv:pkg]
4646
description =
4747
Test packaging
4848
# `usedevelop = true` overrides `skip_install` instruction, it's unwanted

0 commit comments

Comments
 (0)