Skip to content

Commit 8e824a3

Browse files
authored
Python client (#5)
This PR updates the GitHub Actions workflow for building and publishing the Python package to PyPI. Updated the GitHub environment from "pypi-publish" to "pypi". Added a new step to extract the version from the Git tag and pass it to the build process.
1 parent 495dfea commit 8e824a3

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

.github/workflows/publish-to-pypi.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ jobs:
99
build-and-publish:
1010
name: Build and publish Python package to PyPI
1111
runs-on: ubuntu-latest
12-
# NOTE: You should create a "pypi-publish" environment in GitHub repo settings
12+
# NOTE: You should create an environment in GitHub repo settings
1313
# and configure it to match what you set up in PyPI trusted publishing
1414
# Uncomment the following line once your environment is set up in GitHub:
15-
# environment: pypi-publish
15+
environment: pypi
1616
permissions:
1717
id-token: write # Required for trusted publishing (OIDC)
1818
contents: read # To checkout the repository
@@ -33,8 +33,14 @@ jobs:
3333
python -m pip install --upgrade pip
3434
python -m pip install build twine
3535
36+
- name: Extract version from tag
37+
id: get_version
38+
run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT
39+
3640
- name: Build package
3741
working-directory: ./pysmq
42+
env:
43+
SETUPTOOLS_SCM_PRETEND_VERSION_FOR_PYSMQ: ${{ steps.get_version.outputs.VERSION }}
3844
run: python -m build
3945

4046
- name: Publish package to PyPI

0 commit comments

Comments
 (0)