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: add publish job to publish from release-please #478

Merged
merged 1 commit into from
Sep 27, 2024
Merged
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
22 changes: 19 additions & 3 deletions .github/workflows/on-push-to-main-branch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
token: ${{ secrets.MOMENTO_MACHINE_USER_GITHUB_TOKEN }}
release-type: python

publish-python:
publish:
needs: [release-please]
if: ${{ needs.release-please.outputs.release_created == 'true' }}
runs-on: ubuntu-24.04
Expand All @@ -53,13 +53,29 @@ jobs:
- name: Setup repo
uses: actions/checkout@v4

- name: Install and configure Poetry
uses: snok/install-poetry@v1
with:
version: 1.3.1
virtualenvs-in-project: true

- name: Setup Python 3.10
uses: actions/setup-python@v4
with:
python-version: "3.10"

- name: Build package
run: poetry build

- name: Publish package
env:
POETRY_PYPI_TOKEN_PYPI: ${{ secrets.PYTHON_CUSTOMER_SDK_PYPI_TOKEN }}
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"
poetry publish
Loading