This repository was archived by the owner on Nov 8, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
bug: [Consolidate publishing and signing distributions into one step] #61
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,9 +1,8 @@ | ||
| name: Publish to PyPi | ||
|
|
||
| on: | ||
| push: | ||
| tags: | ||
| - 'v*' | ||
| release: | ||
| types: [published] | ||
| workflow_dispatch: | ||
|
|
||
| jobs: | ||
|
|
@@ -34,6 +33,7 @@ jobs: | |
| publish-to-pypi: | ||
| name: >- | ||
| Publish Python 🐍 distribution 📦 to PyPI | ||
| and Sign with Sigstore | ||
| if: startsWith(github.ref, 'refs/tags/') | ||
| needs: | ||
| - build | ||
|
|
@@ -43,6 +43,7 @@ jobs: | |
| url: https://pypi.org/p/eppo-server-sdk | ||
| permissions: | ||
| id-token: write | ||
| contents: write | ||
|
|
||
| steps: | ||
| - name: Download all the dists | ||
|
|
@@ -52,46 +53,9 @@ jobs: | |
| path: dist/ | ||
| - name: Publish distribution 📦 to PyPI | ||
| uses: pypa/gh-action-pypi-publish@release/v1 | ||
|
|
||
| github-release: | ||
| name: >- | ||
| Sign the Python 🐍 distribution 📦 with Sigstore | ||
| and upload them to GitHub Release | ||
| needs: | ||
| - publish-to-pypi | ||
| runs-on: ubuntu-latest | ||
|
|
||
| permissions: | ||
| contents: write | ||
| id-token: write | ||
|
|
||
| steps: | ||
| - name: Download all the dists | ||
| uses: actions/download-artifact@v4 | ||
| with: | ||
| name: python-package-distributions | ||
| path: dist/ | ||
| - name: Sign the dists with Sigstore | ||
| uses: sigstore/gh-action-sigstore-python@v2.1.1 | ||
| with: | ||
| inputs: >- | ||
| ./dist/*.tar.gz | ||
| ./dist/*.whl | ||
| - name: Create GitHub Release | ||
| env: | ||
| GITHUB_TOKEN: ${{ github.token }} | ||
| run: >- | ||
| gh release create | ||
| '${{ github.ref_name }}' | ||
| --repo '${{ github.repository }}' | ||
| --notes "" | ||
| - name: Upload artifact signatures to GitHub Release | ||
| env: | ||
| GITHUB_TOKEN: ${{ github.token }} | ||
| # Upload to GitHub Release using the `gh` CLI. | ||
| # `dist/` contains the built packages, and the | ||
| # sigstore-produced signatures and certificates. | ||
| run: >- | ||
| gh release upload | ||
| '${{ github.ref_name }}' dist/** | ||
| --repo '${{ github.repository }}' | ||
|
Comment on lines
-80
to
-97
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The github release already exists at this point so this is not needed. |
||
| - name: Sign the dists with Sigstore | ||
| uses: sigstore/gh-action-sigstore-python@v2.1.1 | ||
| with: | ||
| inputs: >- | ||
| ./dist/*.tar.gz | ||
| ./dist/*.whl | ||
|
Comment on lines
+56
to
+61
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. combine into one publish |
||
Empty file.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this line is what allows manual publishing; we may want to keep it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the purpose of manual publishing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Debugging. It would allow us to retry the workflow without making a new release, and while we can retry a failed release action, it can be handy for retrying when the action technically succeeds but didn't do what you want.