Skip to content

Commit

Permalink
Updates for the Python SDK release (Apicurio#3352)
Browse files Browse the repository at this point in the history
* Minor updates for the Python SDK release

* update the release workflow to automatically bump the python version
  • Loading branch information
andreaTP authored May 16, 2023
1 parent ad0e9cc commit 994024c
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 15 deletions.
34 changes: 21 additions & 13 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,10 @@ jobs:
sed -i "s/version\:\s.*/version: \'${DOCS_VERSION}\'/g" docs/antora.yml
sed -i "5s/\"version\"\:\s\".*\"/\"version\": \"${DOCS_VERSION}\"/g" app/src/main/resources-unfiltered/META-INF/resources/api-specifications/registry/v2/openapi.json
# take only the major, minor and patch
PYTHON_SDK_VERSION=$(echo "${{ github.event.inputs.release-version}}" | awk -F '.' '{print $1"."$2"."$3}')
sed -i "s/^version.*/version \= \"${PYTHON_SDK_VERSION}\"/" ../python-sdk/pyproject.toml
- name: Build Registry (All Variants)
run: |
cd registry
Expand All @@ -90,6 +94,19 @@ jobs:
(echo "===== Maven Deploy Attempt: 3 ====" && mvn deploy --batch-mode -Pprod -Prelease -DskipTests --settings /home/runner/.m2/settings.xml) || \
(echo "==== Maven Deploy Step Failed ====" && exit 1)
# Python SDK release
- uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Install Poetry
uses: snok/install-poetry@d45b6d76012debf457ab49dffc7fb7b2efe8071d
- name: Release Python SDK
working-directory: python-sdk
run: make publish
env:
PYPI_USERNAME: ${{ secrets.PYPI_USERNAME }}
PYPI_PASSWORD: ${{ secrets.PYPI_PASSWORD }}

- name: Commit Release Version Change
run: |
cd registry
Expand Down Expand Up @@ -132,6 +149,10 @@ jobs:
sed -i "s/version\:\s.*/version: \'${DOCS_VERSION}\'/g" docs/antora.yml
sed -i "5s/\"version\"\:\s\".*\"/\"version\": \"${DOCS_VERSION}\"/g" app/src/main/resources-unfiltered/META-INF/resources/api-specifications/registry/v2/openapi.json
# take only the major, minor and patch
PYTHON_SDK_VERSION=$(echo "${{ github.event.inputs.release-version}}" | awk -F '.' '{print $1"."$2"."$3}')
sed -i "s/^version.*/version \= \"${PYTHON_SDK_VERSION}\"/" ../python-sdk/pyproject.toml
- name: Commit Snapshot Version ${{ github.event.inputs.snapshot-version}}
run: |
cd registry
Expand All @@ -149,19 +170,6 @@ jobs:
# access-token: ${{ secrets.TWITTER_ACCESS_TOKEN }}
# access-token-secret: ${{ secrets.TWITTER_ACCESS_TOKEN_SECRET }}

# Python SDK release
- uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Install Poetry
uses: snok/install-poetry@d45b6d76012debf457ab49dffc7fb7b2efe8071d
- name: Release Python SDK
working-directory: python-sdk
run: make publish
env:
PYPI_USERNAME: ${{ secrets.PYPI_USERNAME }}
PYPI_PASSWORD: ${{ secrets.PYPI_PASSWORD }}

- name: Google Chat Notification
if: ${{ failure() }}
uses: Co-qn/google-chat-notification@b9227d9daa4638c9782a5bd16c4abb86268127a1
Expand Down
4 changes: 2 additions & 2 deletions python-sdk/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "apicurio-registry-python-sdk"
version = "0.1.0"
name = "apicurioregistrysdk"
version = "2.4.2"
description = ""
authors = ["Andrea Peruffo <[email protected]>"]
readme = "README.md"
Expand Down

0 comments on commit 994024c

Please sign in to comment.