Skip to content
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
split deploy step into 3 to manage permissions
* the build step builds using baipp
* the deploy step does only the pypi upload
* the release-notes step udpdates the release notes

## needed followups

* [ ] upstream release from artifact to pypi-publish
* [ ] generate content of release notes in baipp step
  • Loading branch information
RonnyPfannschmidt committed May 12, 2023
commit 0ac84c610a94b3806687f6e61e0047f45baa0bff
40 changes: 28 additions & 12 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,39 +13,55 @@ on:
permissions: {}

jobs:

deploy:
if: github.repository == 'pytest-dev/pytest'

build:
runs-on: ubuntu-latest
timeout-minutes: 30
timeout-minutes: 10
environment: deploy
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess we do not need the deploy environment to build the package?

permissions:
contents: write
id-token: write # for pypi oidc publish

steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
persist-credentials: false

- name: Build and Check Package
uses: hynek/[email protected]

deploy:
if: github.repository == 'pytest-dev/pytest'
needs: [build]
runs-on: ubuntu-latest
timeout-minutes: 30
environment: deploy
permissions:
id-token: write # for pypi oidc publish
steps:
- name: Download Package
uses: actions/download-artifact@v3
with:
name: Packages
path: dist

- name: Publish package to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might as well update to the latest version:

Suggested change
uses: pypa/gh-action-pypi-publish@release/v1
uses: pypa/gh-action-pypi-publish@v1.8.5

(I just tested this version with pytest-mock and it worked flawlessly to publish it to test-pypi with trusted-publishers).


release-notes:

# todo: generate the content in the build job
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you leave a comment explaining why?

I ask because I think it is fine to do it (generate the contents + publish to GitHub releases) at this point.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

expanded the comment, ready for merge i think

# the goal being of using a github action script to push the release data
# after success instead of creating a complete python/tox env
needs: [deploy]
runs-on: ubuntu-latest
timeout-minutes: 30
environment: deploy
permissions:
contents: write
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
persist-credentials: false
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.7"
python-version: "3.8"

- name: Install tox
run: |
Expand Down