@@ -310,27 +310,56 @@ Push the commit and tag to the source branch unless `dry_run` is set.
310310 dry_run: ${{ inputs.dry_run }}
311311` ` `
312312
313- # ## Publish
313+ # ## Post-publish
314314
315- Handles tasks related to publishing Python packages, including
316- signing `dist` file and publishing the `dist` files to PyPI.
315+ To be run after separately publishing the [Python package](https://github.com/pypa/gh-action-pypi-publish#trusted-publishing).
316+ Handles follow-up tasks related to publishing Python packages, including
317+ signing `dist` files and uploading report assets to S3.
317318It will also push the following (dev) version to the source branch.
318319It will create a draft GitHub release and attach the signature files.
319- Finally, it will publish a report to the appropriate S3 bucket.
320- If `dry_run` is set, nothing will be published or pushed.
320+ If `dry_run` is set, nothing will be pushed.
321321
322- ` ` ` yaml
323- - name: Setup
324- uses: mongodb-labs/drivers-github-tools/setup@v2
325- with:
326- ...
322+ The jobs should look something like :
327323
328- - uses: mongodb-labs/drivers-github-tools/python/publish@v2
329- with:
330- version: ${{ inputs.version }}
331- following_version: ${{ inputs.following_version }}
332- version_bump_script: ./.github/scripts/bump-version.sh
333- product_name: winkerberos
334- token: ${{ github.token }}
335- dry_run: ${{ inputs.dry_run }}
336- ` ` `
324+ ` ` ` yaml
325+ publish:
326+ name: Upload release to PyPI
327+ runs-on: ubuntu-latest
328+ environment: release
329+ permissions:
330+ id-token: write
331+ steps:
332+ - name: Download all the dists
333+ uses: actions/download-artifact@v4
334+ with:
335+ name: all-dist-${{ github.run_id }}
336+ path: dist/
337+ - name: Publish package distributions to PyPI
338+ if: inputs.dry_run == 'false'
339+ uses: pypa/gh-action-pypi-publish@release/v1
340+
341+ post-publish:
342+ needs: [publish]
343+ name: Handle post-publish actions
344+ runs-on: ubuntu-latest
345+ environment: release
346+ permissions:
347+ id-token: write
348+ contents: write
349+ attestations: write
350+ security-events: write
351+ steps:
352+ - name: Setup
353+ uses: mongodb-labs/drivers-github-tools/setup@v2
354+ with:
355+ ...
356+
357+ - uses: mongodb-labs/drivers-github-tools/python/post-publish@v2
358+ with:
359+ version: ${{ inputs.version }}
360+ following_version: ${{ inputs.following_version }}
361+ version_bump_script: ./.github/scripts/bump-version.sh
362+ product_name: winkerberos
363+ token: ${{ github.token }}
364+ dry_run: ${{ inputs.dry_run }}
365+ ` ` `
0 commit comments