Skip to content

Commit 4df97da

Browse files
committed
Attempt to use trusted publishing
Actions rework loosely based on ufmt's
1 parent cc77b2d commit 4df97da

File tree

2 files changed

+39
-10
lines changed

2 files changed

+39
-10
lines changed

.github/workflows/build.yml

Lines changed: 36 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@ on:
1010
pull_request:
1111

1212
jobs:
13-
indexurl:
13+
test:
1414
runs-on: ${{ matrix.os }}
1515
strategy:
1616
fail-fast: false
1717
matrix:
18-
python-version: ["3.10", "3.11", "3.12"]
18+
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"]
1919
os: [macOS-latest, ubuntu-latest, windows-latest]
2020

2121
steps:
@@ -25,6 +25,7 @@ jobs:
2525
uses: actions/setup-python@v5
2626
with:
2727
python-version: ${{ matrix.python-version }}
28+
- uses: astral-sh/setup-uv@v3
2829
- name: Install
2930
run: |
3031
python -m pip install --upgrade pip
@@ -34,3 +35,36 @@ jobs:
3435
run: make test
3536
- name: Lint
3637
run: make lint
38+
if: matrix.python-version != "3.9"
39+
40+
build:
41+
needs: test
42+
runs-on: ubuntu-latest
43+
steps:
44+
- uses: actions/checkout@v4
45+
- uses: actions/setup-python@v5
46+
with:
47+
python-version: "3.12"
48+
- uses: astral-sh/setup-uv@v3
49+
- name: Install
50+
run: uv pip install build
51+
- name: Build
52+
run: python -m build
53+
- name: Upload
54+
uses: actions/upload-artifact@v3
55+
with:
56+
name: sdist
57+
path: dist
58+
59+
publish:
60+
needs: build
61+
runs-on: ubuntu-latest
62+
if: startsWith(github.ref, 'refs/tags/v')
63+
permissions:
64+
id-token: write
65+
steps:
66+
- uses: actions/download-artifact@v3
67+
with:
68+
name: sdist
69+
path: dist
70+
- uses: pypa/gh-action-pypi-publish@release/v1

Makefile

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
PYTHON?=python
22
SOURCES=indexurl setup.py
3+
UV?=uv
34

45
.PHONY: venv
56
venv:
6-
$(PYTHON) -m venv .venv
7+
$(UV) venv .venv
78
source .venv/bin/activate && make setup
89
@echo 'run `source .venv/bin/activate` to use virtualenv'
910

@@ -12,7 +13,7 @@ venv:
1213

1314
.PHONY: setup
1415
setup:
15-
python -m pip install -Ue .[dev,test]
16+
uv pip install -e .[dev,test]
1617

1718
.PHONY: test
1819
test:
@@ -29,9 +30,3 @@ lint:
2930
python -m flake8 $(SOURCES)
3031
python -m checkdeps --allow-names indexurl indexurl
3132
mypy --strict --install-types --non-interactive indexurl
32-
33-
.PHONY: release
34-
release:
35-
rm -rf dist
36-
python setup.py sdist bdist_wheel
37-
twine upload dist/*

0 commit comments

Comments
 (0)