Skip to content

Commit 5068287

Browse files
authored
Use PyPI trusted publishers for deploying (#354)
Also changes the deploy workflow.
1 parent 927f310 commit 5068287

File tree

2 files changed

+13
-6
lines changed

2 files changed

+13
-6
lines changed

.github/workflows/deploy.yml

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,20 @@
11
name: deploy
22

33
on:
4-
push:
5-
tags:
6-
- "v*"
4+
workflow_dispatch:
5+
inputs:
6+
version:
7+
description: 'Release version'
8+
required: true
9+
default: '1.2.3'
710

811
jobs:
912

1013
deploy:
1114
runs-on: ubuntu-latest
15+
environment: deploy
16+
permissions:
17+
id-token: write # For PyPI trusted publishers.
1218

1319
steps:
1420
- uses: actions/checkout@v3
@@ -24,9 +30,10 @@ jobs:
2430

2531
- name: Publish package to PyPI
2632
uses: pypa/gh-action-pypi-publish@master
33+
34+
- uses: actions-ecosystem/action-push-tag@v1
2735
with:
28-
user: __token__
29-
password: ${{ secrets.pypi_token }}
36+
tag: v${{ github.event.inputs.version }}
3037

3138
- name: Set up Python
3239
uses: actions/[email protected]

RELEASING.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@ Here are the steps on how to make a new release.
33
1. Create a ``release-VERSION`` branch from ``upstream/master``.
44
2. Update ``CHANGELOG.rst``.
55
3. Push a branch with the changes.
6-
4. Once all builds pass, push a tag to ``upstream``.
6+
4. Once all builds pass, run the ``deploy`` workflow manually.
77
5. Merge the PR.

0 commit comments

Comments
 (0)