Skip to content
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

ci: set up with release please v4 and stub publish step #472

Merged
merged 1 commit into from
Sep 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
41 changes: 40 additions & 1 deletion .github/workflows/on-push-to-main-branch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:

steps:
- name: Setup repo
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
token: ${{ secrets.MOMENTO_MACHINE_USER_GITHUB_TOKEN }}

Expand All @@ -24,3 +24,42 @@ jobs:
dev_docs_slug: python
template_file: ./README.template.md
output_file: ./README.md

release-please:
needs: [build]
runs-on: ubuntu-24.04
outputs:
release_created: ${{ steps.release.outputs.release_created }}
tag_name: ${{ steps.release.outputs.tag_name }}

steps:
- uses: actions/checkout@v4

- uses: googleapis/release-please-action@v4
name: Release Please
id: release
with:
token: ${{ secrets.MOMENTO_MACHINE_USER_GITHUB_TOKEN }}
release-type: python

publish-python:
needs: [release-please]
if: ${{ needs.release-please.outputs.release_created == 'true' }}
runs-on: ubuntu-24.04
env:
VERSION: ${{ needs.release-please.outputs.tag_name }}

steps:
- name: Setup repo
uses: actions/checkout@v4

- name: Publish package
run: |
set -e
set -x
if [ -z "$VERSION" ]
then
echo "Unable to determine SDK version! Exiting!"
exit 1
fi
echo "Going to publish version=$VERSION"
20 changes: 20 additions & 0 deletions .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"changelog-sections": [
{
"type": "feat",
"section": "Features",
"hidden": false
},
{
"type": "fix",
"section": "Bug Fixes",
"hidden": false
},
{
"type": "chore",
"section": "Miscellaneous",
"hidden": false
}
],
"extra-files": ["src/momento/__init__.py"],
}
Empty file added CHANGELOG.md
Empty file.
3 changes: 3 additions & 0 deletions src/momento/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
from .topic_client import TopicClient
from .topic_client_async import TopicClientAsync

__version__ = "0.0.0" # x-release-please-version

logging.getLogger("momentosdk").addHandler(logging.NullHandler())
logs.initialize_momento_logging()

Expand All @@ -31,4 +33,5 @@
"TopicClientAsync",
"AuthClient",
"AuthClientAsync",
"__version__",
]
Loading