-
Notifications
You must be signed in to change notification settings - Fork 1
Update CI to tag release, and release 0.2.0 #6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -6,7 +6,7 @@ on: | |||||||||||||||||||||||||||||||||
| workflow_dispatch: | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| permissions: | ||||||||||||||||||||||||||||||||||
| contents: read | ||||||||||||||||||||||||||||||||||
| contents: write | ||||||||||||||||||||||||||||||||||
| id-token: write # required for PyPI trusted publishing (OIDC) | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| jobs: | ||||||||||||||||||||||||||||||||||
|
|
@@ -47,6 +47,7 @@ jobs: | |||||||||||||||||||||||||||||||||
| print('true' if Version('${LOCAL}') > Version('${REMOTE}') else 'false') | ||||||||||||||||||||||||||||||||||
| ") | ||||||||||||||||||||||||||||||||||
| echo "publish=${SHOULD_PUBLISH}" >> "$GITHUB_OUTPUT" | ||||||||||||||||||||||||||||||||||
| echo "version=${LOCAL}" >> "$GITHUB_OUTPUT" | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| - name: Install, lint, test, build | ||||||||||||||||||||||||||||||||||
| if: steps.version.outputs.publish == 'true' | ||||||||||||||||||||||||||||||||||
|
|
@@ -62,3 +63,9 @@ jobs: | |||||||||||||||||||||||||||||||||
| if: steps.version.outputs.publish == 'true' | ||||||||||||||||||||||||||||||||||
| uses: pypa/gh-action-pypi-publish@release/v1 | ||||||||||||||||||||||||||||||||||
| # Uses OIDC trusted publishing — no API token needed | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| - name: Tag release | ||||||||||||||||||||||||||||||||||
| if: steps.version.outputs.publish == 'true' | ||||||||||||||||||||||||||||||||||
| run: | | ||||||||||||||||||||||||||||||||||
| git tag "v${{ steps.version.outputs.version }}" | ||||||||||||||||||||||||||||||||||
| git push origin "v${{ steps.version.outputs.version }}" | ||||||||||||||||||||||||||||||||||
|
Comment on lines
+70
to
+71
|
||||||||||||||||||||||||||||||||||
| git tag "v${{ steps.version.outputs.version }}" | |
| git push origin "v${{ steps.version.outputs.version }}" | |
| TAG="v${{ steps.version.outputs.version }}" | |
| if git rev-parse -q --verify "refs/tags/$TAG" >/dev/null; then | |
| echo "Tag $TAG already exists locally; skipping tag creation." | |
| exit 0 | |
| fi | |
| if git ls-remote --exit-code --tags origin "refs/tags/$TAG" >/dev/null 2>&1; then | |
| echo "Tag $TAG already exists on origin; skipping tag push." | |
| exit 0 | |
| fi | |
| git tag "$TAG" | |
| git push origin "$TAG" |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -1,6 +1,6 @@ | ||||||
| [project] | ||||||
| name = "decibel-python-sdk" | ||||||
| version = "0.1.2" | ||||||
| version = "0.2.0" | ||||||
|
||||||
| version = "0.2.0" | |
| version = "0.1.0" |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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.
Changing workflow permissions to
contents: writegrants repo write access to the whole job. Since this is only needed for tagging, consider splitting tagging into a separate job (dependent on publish) withcontents: write, keeping the publish/build job atcontents: readto follow least-privilege and reduce blast radius if a step/action is compromised.