Skip to content

Add trusted publisher #4

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 1, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 17 additions & 11 deletions .github/workflows/main.yml → .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,16 @@ jobs:
name: "Upload latest msgpack-cxx version to PyPI"
runs-on: ubuntu-latest
permissions:
contents: read
env:
TWINE_USERNAME: ${{ secrets.PYPI_USER }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASS }}
contents: write
id-token: write # Required for Trusted Publishing

steps:
- uses: actions/checkout@v4

- name: Setup python
uses: actions/setup-python@v5
with:
python-version: "3.11"
python-version: "3.13"
architecture: x64

- name: Install dependencies
Expand Down Expand Up @@ -67,9 +65,17 @@ jobs:
- name: List assets
run: ls ./wheelhouse/ -al

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