Skip to content
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

Add pypi trusted publisher #1447

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
58 changes: 24 additions & 34 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,44 +3,34 @@ name: Releases
on:
push:
tags:
- 'v*'
- "v*"

jobs:

release:
runs-on: ubuntu-latest
permissions:
contents: write
# IMPORTANT: this permission is mandatory for trusted publishing
id-token: write
environment: release
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup python
uses: actions/setup-python@v5
with:
python-version: "3.9"
- name: Setup tox
run: pip install tox
- name: Run linter
run: tox -e lint
- name: Run tests
run: tox -e py
- name: Build package
run: tox -e build
- name: Create release
uses: ncipollo/release-action@v1
with:
artifacts: dist/gspread-*
token: ${{ secrets.GH_TOKEN }}
generateReleaseNotes: True
artifactErrorsFailBuild: True
- name: Publish to TestPyPi
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
repository-url: https://test.pypi.org/legacy/
- name: Publish to PyPi
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
- name: Checkout
uses: actions/checkout@v4
- name: Setup python
uses: actions/setup-python@v5
with:
python-version: "3.9"
- name: Setup tox
run: pip install tox
- name: Run linter
run: tox -e lint
- name: Run tests
run: tox -e py
- name: Build package
run: tox -e build
- name: Publish to TestPyPi
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/
#- name: Publish to PyPi
# uses: pypa/gh-action-pypi-publish@release/v1
Loading