Skip to content

Commit 3d1ac12

Browse files
Merge pull request #74 from HERA-Team/trusted-deployment
ci: update to OICD pypi deployment
2 parents e9a5a98 + 242ea98 commit 3d1ac12

2 files changed

Lines changed: 8 additions & 7 deletions

File tree

.github/workflows/publish-to-pypi.yaml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ jobs:
66
build-n-publish:
77
name: Deploy
88
runs-on: ubuntu-latest
9+
permissions:
10+
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
11+
912
steps:
1013
- uses: actions/checkout@master
1114
# https://github.com/ansible/pylibssh/blob/1e7b17f/.github/workflows/build-test-n-publish.yml#L146-L151
@@ -15,10 +18,10 @@ jobs:
1518
git fetch --depth=1 origin +refs/tags/*:refs/tags/*
1619
git describe --tags
1720
git describe --tags $(git rev-list --tags --max-count=1)
18-
- name: Set up Python 3.9
21+
- name: Set up Python 3.11
1922
uses: actions/setup-python@v1
2023
with:
21-
python-version: 3.9
24+
python-version: 3.11
2225
- name: Install pep517
2326
run: |
2427
python -m pip install build
@@ -36,15 +39,13 @@ jobs:
3639
# already exist, and thus fail.
3740
- name: Publish distribution 📦 to Test PyPI
3841
if: ${{ !contains(github.ref, 'main') }}
39-
uses: pypa/gh-action-pypi-publish@master
42+
uses: pypa/gh-action-pypi-publish@release/v1
4043
with:
41-
password: ${{ secrets.test_pypi_password }}
4244
repository_url: https://test.pypi.org/legacy/
4345
skip_existing: true
4446
# deploy to actual PyPI only when a tag is pushed to main
4547
- name: Publish distribution 📦 to PyPI
4648
if: startsWith(github.ref, 'refs/tags')
47-
uses: pypa/gh-action-pypi-publish@master
49+
uses: pypa/gh-action-pypi-publish@release/v1
4850
with:
49-
password: ${{ secrets.pypi_password }}
5051
skip_existing: true

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ repos:
3232
- flake8-comprehensions
3333
- flake8-print
3434

35-
- repo: https://github.com/psf/black
35+
- repo: https://github.com/psf/black-pre-commit-mirror
3636
rev: 23.11.0
3737
hooks:
3838
- id: black

0 commit comments

Comments
 (0)