Skip to content

Commit efceb62

Browse files
Merge remote-tracking branch 'origin/main' into stlc/promote-next
2 parents 7e28fb6 + 894fcad commit efceb62

5 files changed

Lines changed: 17 additions & 22 deletions

File tree

.github/workflows/publish-pypi.yml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,12 @@ jobs:
1212
publish:
1313
name: publish
1414
runs-on: ubuntu-latest
15+
environment:
16+
name: pypi
17+
url: https://pypi.org/p/hypeman
18+
permissions:
19+
contents: read
20+
id-token: write
1521

1622
steps:
1723
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
@@ -24,8 +30,8 @@ jobs:
2430
RYE_VERSION: '0.44.0'
2531
RYE_INSTALL_OPTION: '--yes'
2632

33+
- name: Build distributions
34+
run: rye build --clean
35+
2736
- name: Publish to PyPI
28-
run: |
29-
bash ./bin/publish-pypi
30-
env:
31-
PYPI_TOKEN: ${{ secrets.HYPEMAN_PYPI_TOKEN || secrets.PYPI_TOKEN }}
37+
uses: pypa/gh-action-pypi-publish@dc37677b2e1c63e2034f94d8a5b11f265b73ba33 # release/v1

.github/workflows/release-doctor.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,5 @@ jobs:
1818
run: |
1919
bash ./bin/check-release-environment
2020
env:
21-
RELEASE_PLEASE_TOKEN: ${{ secrets.RELEASE_PLEASE_TOKEN }}
22-
PYPI_TOKEN: ${{ secrets.HYPEMAN_PYPI_TOKEN || secrets.PYPI_TOKEN }}
21+
ADMIN_APP_ID: ${{ secrets.ADMIN_APP_ID }}
22+
ADMIN_APP_PRIVATE_KEY: ${{ secrets.ADMIN_APP_PRIVATE_KEY }}

CONTRIBUTING.md

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -113,9 +113,4 @@ the changes aren't made through the automated pipeline, you may want to make rel
113113

114114
### Publish with a GitHub workflow
115115

116-
You can release to package managers by using [the `Publish PyPI` GitHub action](https://www.github.com/kernel/hypeman-python/actions/workflows/publish-pypi.yml). This requires a setup organization or repository secret to be set up.
117-
118-
### Publish manually
119-
120-
If you need to manually release a package, you can run the `bin/publish-pypi` script with a `PYPI_TOKEN` set on
121-
the environment.
116+
Use the [`Publish PyPI` GitHub workflow](https://www.github.com/kernel/hypeman-python/actions/workflows/publish-pypi.yml) to publish or retry a release. It authenticates through PyPI Trusted Publishing and the `pypi` GitHub environment; no API token is required.

bin/check-release-environment

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22

33
errors=()
44

5-
if [ -z "${RELEASE_PLEASE_TOKEN}" ]; then
6-
errors+=("The RELEASE_PLEASE_TOKEN secret has not been set. Create a fine-grained GitHub PAT and add it as a repository secret.")
5+
if [ -z "${ADMIN_APP_ID}" ]; then
6+
errors+=("The ADMIN_APP_ID secret has not been set.")
77
fi
88

9-
if [ -z "${PYPI_TOKEN}" ]; then
10-
errors+=("The PYPI_TOKEN secret has not been set. Please set it in either this repository's secrets or your organization secrets.")
9+
if [ -z "${ADMIN_APP_PRIVATE_KEY}" ]; then
10+
errors+=("The ADMIN_APP_PRIVATE_KEY secret has not been set.")
1111
fi
1212

1313
lenErrors=${#errors[@]}

bin/publish-pypi

Lines changed: 0 additions & 6 deletions
This file was deleted.

0 commit comments

Comments
 (0)