Skip to content

Commit

Permalink
ci: add publish job to publish from release-please
Browse files Browse the repository at this point in the history
Ports the publish steps from the former release workflow. We have
already verified in a separate repo that the conditional execution
works as expected.
  • Loading branch information
malandis committed Sep 27, 2024
1 parent 06869b2 commit 066e3cb
Showing 1 changed file with 19 additions and 3 deletions.
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

0 comments on commit 066e3cb

Please sign in to comment.