Skip to content

Commit 362e544

Browse files
cd: publish pip package
Publish pip package on tag. To test, comment "run only on tags" condition, change PYPI_REPO to testpypi and use ${{ secrets.TEST_PYPI_TOKEN }} as PYPI_TOKEN. You also need to remove 5dfdae5 commit changes about scm version and set some constant version: using local version identifiers [1] is not allowed by test.pypi.org. 1. https://peps.python.org/pep-0440/ Part of #198
1 parent fb8cbe0 commit 362e544

File tree

3 files changed

+41
-0
lines changed

3 files changed

+41
-0
lines changed

Diff for: .github/workflows/packing.yml

+36
Original file line numberDiff line numberDiff line change
@@ -170,3 +170,39 @@ jobs:
170170
run: |
171171
cat tarantool.log || true
172172
kill $(cat tarantool.pid) || true
173+
174+
publish_pip:
175+
if: startsWith(github.ref, 'refs/tags')
176+
177+
needs:
178+
- run_tests_pip_package_linux
179+
- run_tests_pip_package_windows
180+
181+
runs-on: ubuntu-20.04
182+
183+
strategy:
184+
fail-fast: false
185+
186+
steps:
187+
- name: Clone the connector repo
188+
uses: actions/checkout@v3
189+
190+
- name: Setup Python and basic packing tools
191+
uses: actions/setup-python@v4
192+
with:
193+
python-version: '3.10'
194+
195+
- name: Install tools for package publishing
196+
run: pip3 install twine
197+
198+
- name: Download pip package artifacts
199+
uses: actions/download-artifact@v3
200+
with:
201+
name: pip_dist
202+
path: pip_dist
203+
204+
- name: Publish artifacts
205+
run: make pip-dist-publish
206+
env:
207+
PYPI_REPO: pypi
208+
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}

Diff for: CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
186186

187187
- Support iproto feature push (#201).
188188
- Pack pip package with GitHub Actions (#198).
189+
- Publish pip package with GitHub Actions (#198).
189190

190191
### Changed
191192
- Bump msgpack requirement to 1.0.4 (PR #223).

Diff for: Makefile

+4
Original file line numberDiff line numberDiff line change
@@ -47,3 +47,7 @@ pip-dist: pip-sdist pip-bdist
4747
.PHONY: pip-dist-check
4848
pip-dist-check:
4949
twine check pip_dist/*
50+
51+
.PHONY: pip-dist-publish
52+
pip-dist-publish:
53+
twine upload -r testpypi -u __token__ -p ${PYPI_TOKEN} pip_dist/*

0 commit comments

Comments
 (0)