Skip to content

Commit a8ff069

Browse files
authored
Use environment and trusted publisher (#105)
Set environment permissions in publish github-action. AB#10628 Signed-off-by: Paul Hewlett <phewlett76@gmail.com>
1 parent 0b5d0a1 commit a8ff069

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

.github/workflows/python-publish.yml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ on:
99

1010
jobs:
1111
deploy:
12+
environment: release
13+
permissions:
14+
id-token: write # This is required for requesting the JWT
1215

1316
runs-on: ubuntu-latest
1417

@@ -18,21 +21,22 @@ jobs:
1821
uses: actions/setup-python@v5
1922
with:
2023
python-version: '3.x'
24+
2125
- name: Install dependencies
2226
run: |
2327
python -m pip install --upgrade pip
2428
python3 -m pip install -r requirements-dev.txt
2529
pip install setuptools wheel
26-
- name: Build and publish
27-
env:
28-
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
29-
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
30+
shell: bash
31+
32+
- name: Create wheel
3033
run: |
3134
rm -f archivist_samples/about.py
3235
./scripts/version.sh
3336
cat archivist_samples/about.py
3437
python3 -m build --sdist
3538
python3 -m build --wheel
39+
shell: bash
3640

3741
- name: Publish to PyPi
3842
uses: pypa/gh-action-pypi-publish@release/v1

0 commit comments

Comments
 (0)