@@ -283,13 +283,65 @@ jobs:
283283 tag_name : v${{ steps.version.outputs.version }}
284284 name : Release v${{ steps.version.outputs.version }}
285285 body : |
286- Release v${{ steps.version.outputs.version }} of predicate-sdk
286+ Release v${{ steps.version.outputs.version }} of predicate-runtime
287287
288288 ## Installation
289289 ```bash
290- pip install predicate-sdk ==${{ steps.version.outputs.version }}
290+ pip install predicate-runtime ==${{ steps.version.outputs.version }}
291291 ```
292292 draft : false
293293 prerelease : false
294294 env :
295295 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
296+
297+ publish-compat-shim :
298+ runs-on : ubuntu-latest
299+ needs : build-and-publish
300+
301+ steps :
302+ - name : Checkout code
303+ uses : actions/checkout@v4
304+
305+ - name : Set up Python
306+ uses : actions/setup-python@v5
307+ with :
308+ python-version : ' 3.11'
309+
310+ - name : Install build dependencies
311+ run : |
312+ python -m pip install --upgrade pip
313+ pip install build twine
314+
315+ - name : Extract version from tag or input
316+ id : version
317+ run : |
318+ if [ "${{ github.event_name }}" == "release" ]; then
319+ VERSION=${GITHUB_REF#refs/tags/v}
320+ VERSION=${VERSION#refs/tags/}
321+ else
322+ VERSION="${{ github.event.inputs.version }}"
323+ fi
324+ echo "version=$VERSION" >> $GITHUB_OUTPUT
325+ echo "Version: $VERSION"
326+
327+ - name : Sync shim version and runtime dependency
328+ run : |
329+ VERSION="${{ steps.version.outputs.version }}"
330+ SHIM_PYPROJECT="compat/predicate-sdk-shim/pyproject.toml"
331+ sed -i "s/^version = \".*\"/version = \"$VERSION\"/" "$SHIM_PYPROJECT"
332+ sed -i "s/^ \"predicate-runtime==.*\",/ \"predicate-runtime==$VERSION\",/" "$SHIM_PYPROJECT"
333+
334+ - name : Build compatibility shim package
335+ run : |
336+ python -m build compat/predicate-sdk-shim -o dist-compat
337+
338+ - name : Check compatibility shim package
339+ run : |
340+ twine check dist-compat/*
341+
342+ - name : Publish compatibility shim to PyPI
343+ env :
344+ TWINE_USERNAME : __token__
345+ TWINE_PASSWORD : ${{ secrets.PYPI_API_TOKEN }}
346+ run : |
347+ twine upload dist-compat/*
0 commit comments