@@ -310,27 +310,55 @@ 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+ uses: pypa/gh-action-pypi-publish@release/v1
339+
340+ post-publish:
341+ needs: [publish]
342+ name: Handle post-publish actions
343+ runs-on: ubuntu-latest
344+ environment: release
345+ permissions:
346+ id-token: write
347+ contents: write
348+ attestations: write
349+ security-events: write
350+ steps:
351+ - name: Setup
352+ uses: mongodb-labs/drivers-github-tools/setup@v2
353+ with:
354+ ...
355+
356+ - uses: mongodb-labs/drivers-github-tools/python/post-publish@v2
357+ with:
358+ version: ${{ inputs.version }}
359+ following_version: ${{ inputs.following_version }}
360+ version_bump_script: ./.github/scripts/bump-version.sh
361+ product_name: winkerberos
362+ token: ${{ github.token }}
363+ dry_run: ${{ inputs.dry_run }}
364+ ` ` `
0 commit comments