Skip to content

Commit 078e083

Browse files
Merge pull request #206 from COMP1010UNSW/maddy-oidc-publish
Configure OIDC publishing to pypi
2 parents 0a3c887 + c0c360d commit 078e083

4 files changed

Lines changed: 22 additions & 18 deletions

File tree

.github/workflows/publish.yml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,24 @@
11
# Publish a Python package to PyPi using uv
22
name: Publish Package on PyPi
33

4-
permissions:
5-
contents: read
64
on:
75
release:
86
types: [published]
97

108
jobs:
119
deploy:
1210
runs-on: ubuntu-latest
11+
environment: pypi
12+
permissions:
13+
contents: read
14+
id-token: write
1315
steps:
1416
- uses: actions/checkout@v6
1517
- name: Install uv
1618
uses: astral-sh/setup-uv@v7
1719
with:
18-
enable-cache: true
20+
# Intentionally disabled to prevent poisoning
21+
enable-cache: false
1922
- name: Set up Python
2023
uses: actions/setup-python@v6
2124
with:
@@ -24,4 +27,4 @@ jobs:
2427
- name: Build package
2528
run: uv build
2629
- name: Publish package
27-
run: uv publish -t ${{ secrets.PYPI_API_TOKEN }}
30+
run: uv publish

.github/workflows/regenerate-tags.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ on:
1414
jobs:
1515
Regenerate-Tags:
1616
runs-on: ubuntu-latest
17+
environment: docs-scraper
1718
steps:
1819
- uses: actions/checkout@v6
1920
- name: Set up Python

pyproject.toml

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[project]
22
name = "pyhtml-enhanced"
33
version = "2.3.2"
4-
description = "A library for building HTML documents with a simple and learnable syntax"
4+
description = "Build HTML documents in Python with a simple and learnable syntax"
55
authors = [{ name = "Maddy Guthridge", email = "maddy.guthridge@unsw.edu.au" }]
66
license = {text = "MIT"}
77
readme = "README.md"
@@ -11,7 +11,6 @@ classifiers = [
1111
"Programming Language :: Python :: 3",
1212
"Intended Audience :: Developers",
1313
"Intended Audience :: Education",
14-
"License :: OSI Approved :: MIT License",
1514
"Operating System :: OS Independent",
1615
"Development Status :: 5 - Production/Stable",
1716
"Topic :: Internet :: WWW/HTTP :: Dynamic Content",
@@ -51,21 +50,14 @@ docs = [
5150
"mkdocs-awesome-pages-plugin>=2.9.3",
5251
"mkdocs-section-index>=0.3.10",
5352
# Explicitly include pygments to override its version using uv sources
54-
"pygments>=2.19.2",
53+
"pygments>=2.20.0",
5554
]
5655

5756
[tool.uv]
5857
# Exclude dependency releases newer than 1 week, in order to reduce supply-chain
5958
# risk.
6059
exclude-newer = "1 week"
6160

62-
[tool.uv.sources]
63-
# Until pygments does another release, we should take it from git. Otherwise,
64-
# our documentation's t-strings will be formatted incorrectly.
65-
# Pinning to a specific revision to ensure that we don't accidentally get
66-
# malware if someone does a malicious commit or something.
67-
pygments = { git = "https://github.com/pygments/pygments", rev = "28ec10c5e154ee27201997feb573a0b065f74082" }
68-
6961
[build-system]
7062
requires = ["uv_build>=0.7.20,<0.12.0"]
7163
build-backend = "uv_build"

uv.lock

Lines changed: 12 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)