Skip to content

Commit 1038a90

Browse files
authored
Merge pull request #4 from PowerGridModel/add-trusted-publisher
Add trusted publisher
2 parents 8cfe23c + fc9c5ca commit 1038a90

File tree

1 file changed

+17
-11
lines changed

1 file changed

+17
-11
lines changed

.github/workflows/main.yml renamed to .github/workflows/ci.yml

+17-11
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,16 @@ jobs:
1010
name: "Upload latest msgpack-cxx version to PyPI"
1111
runs-on: ubuntu-latest
1212
permissions:
13-
contents: read
14-
env:
15-
TWINE_USERNAME: ${{ secrets.PYPI_USER }}
16-
TWINE_PASSWORD: ${{ secrets.PYPI_PASS }}
13+
contents: write
14+
id-token: write # Required for Trusted Publishing
1715

1816
steps:
1917
- uses: actions/checkout@v4
2018

2119
- name: Setup python
2220
uses: actions/setup-python@v5
2321
with:
24-
python-version: "3.11"
22+
python-version: "3.13"
2523
architecture: x64
2624

2725
- name: Install dependencies
@@ -67,9 +65,17 @@ jobs:
6765
- name: List assets
6866
run: ls ./wheelhouse/ -al
6967

70-
- name: Upload wheels
71-
if: github.event_name == 'workflow_dispatch'
72-
run: |
73-
pip install twine
74-
echo "Publish to PyPI..."
75-
twine upload --verbose wheelhouse/*
68+
- name: Upload assets to PyPI
69+
uses: pypa/gh-action-pypi-publish@release/v1
70+
with:
71+
# To test, use the TestPyPI:
72+
# repository-url: https://test.pypi.org/legacy/
73+
# You must also create an account and project on TestPyPI,
74+
# as well as set the trusted-publisher in the project settings:
75+
# https://docs.pypi.org/trusted-publishers/adding-a-publisher/
76+
# To publish to the official PyPI repository, just keep
77+
# repository-url commented out.
78+
packages-dir: wheelhouse
79+
skip-existing: true
80+
print-hash: true
81+
verbose: true

0 commit comments

Comments
 (0)