Skip to content

Commit b0ada25

Browse files
workflows/release: split jobs (#15)
Co-authored-by: Facundo Tuesca <[email protected]>
1 parent 3de940a commit b0ada25

File tree

3 files changed

+45
-30
lines changed

3 files changed

+45
-30
lines changed

.github/workflows/release.yml

Lines changed: 41 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -5,33 +5,52 @@ on:
55

66
name: release
77

8-
permissions:
9-
# Used to sign the release's artifacts with sigstore-python.
10-
id-token: write
11-
12-
# Used to attach signing artifacts to the published release.
13-
contents: write
8+
permissions: {}
149

1510
jobs:
16-
pypi:
17-
name: upload release to PyPI
11+
build:
12+
name: Build distributions 📦
1813
runs-on: ubuntu-latest
1914
steps:
20-
- uses: actions/checkout@v4
15+
- uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4
16+
17+
- uses: actions/setup-python@f677139bbe7f9c59b41e40162b753c062f5d49a3 # v5
18+
with:
19+
python-version-file: pyproject.toml
20+
cache: "pip"
21+
cache-dependency-path: pyproject.toml
22+
23+
- name: Install pypa/build
24+
run: python -m pip install -U build
2125

22-
- uses: actions/setup-python@v5
23-
with:
24-
python-version-file: pyproject.toml
25-
cache: "pip"
26-
cache-dependency-path: pyproject.toml
26+
- name: Build distributions
27+
run: python -m build
2728

28-
- name: deps
29-
run: python -m pip install -U build
29+
- name: Upload distributions
30+
uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4
31+
with:
32+
name: distributions
33+
path: dist/
3034

31-
- name: build
32-
run: python -m build
3335

34-
- name: publish
35-
uses: pypa/gh-action-pypi-publish@release/v1
36-
with:
37-
attestations: true
36+
publish:
37+
name: Publish Python 🐍 distributions 📦 to PyPI
38+
runs-on: ubuntu-latest
39+
environment:
40+
name: pypi
41+
url: https://pypi.org/p/rfc8785
42+
needs: [build]
43+
permissions:
44+
id-token: write # trusted publishing + attestations
45+
46+
steps:
47+
- name: Download distributions
48+
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4
49+
with:
50+
name: distributions
51+
path: dist/
52+
53+
- name: publish
54+
uses: pypa/gh-action-pypi-publish@release/v1
55+
with:
56+
attestations: true

Makefile

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,7 @@ dev: $(VENV)/pyvenv.cfg
4242

4343
$(VENV)/pyvenv.cfg: pyproject.toml
4444
# Create our Python 3 virtual environment
45-
python3 -m venv env
46-
# NOTE(ekilmer): interrogate v1.5.0 needs setuptools when using Python 3.12+.
47-
# This should be fixed when the next release is made
48-
$(VENV_BIN)/python -m pip install --upgrade pip setuptools
45+
python -m venv env
4946
$(VENV_BIN)/python -m pip install -e .[$(INSTALL_EXTRA)]
5047

5148
.PHONY: lint

pyproject.toml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
[build-system]
2-
requires = ["flit_core >=3.5,<4"]
3-
build-backend = "flit_core.buildapi"
4-
51
[project]
62
name = "rfc8785"
73
dynamic = ["version"]
@@ -19,6 +15,9 @@ classifiers = [
1915
dependencies = []
2016
requires-python = ">=3.8"
2117

18+
[tool.setuptools.dynamic]
19+
version = { attr = "rfc8785.__version__" }
20+
2221
[project.optional-dependencies]
2322
doc = ["pdoc"]
2423
test = ["pytest", "pytest-cov", "coverage"]

0 commit comments

Comments
 (0)