Skip to content

Commit

Permalink
Use PyPI trusted publishers for deploying (#354)
Browse files Browse the repository at this point in the history
Also changes the deploy workflow.
  • Loading branch information
nicoddemus committed Apr 21, 2023
1 parent 927f310 commit 5068287
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
17 changes: 12 additions & 5 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
name: deploy

on:
push:
tags:
- "v*"
workflow_dispatch:
inputs:
version:
description: 'Release version'
required: true
default: '1.2.3'

jobs:

deploy:
runs-on: ubuntu-latest
environment: deploy
permissions:
id-token: write # For PyPI trusted publishers.

steps:
- uses: actions/checkout@v3
Expand All @@ -24,9 +30,10 @@ jobs:

- name: Publish package to PyPI
uses: pypa/gh-action-pypi-publish@master

- uses: actions-ecosystem/action-push-tag@v1
with:
user: __token__
password: ${{ secrets.pypi_token }}
tag: v${{ github.event.inputs.version }}

- name: Set up Python
uses: actions/setup-python@v4.5.0
Expand Down
2 changes: 1 addition & 1 deletion RELEASING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ Here are the steps on how to make a new release.
1. Create a ``release-VERSION`` branch from ``upstream/master``.
2. Update ``CHANGELOG.rst``.
3. Push a branch with the changes.
4. Once all builds pass, push a tag to ``upstream``.
4. Once all builds pass, run the ``deploy`` workflow manually.
5. Merge the PR.

0 comments on commit 5068287

Please sign in to comment.