Skip to content

Commit d5bc694

Browse files
cd: pack pip package
Pack source code and wheel file with Github Actions. Result is stored as artifact. Part of #198
1 parent 7569ce0 commit d5bc694

File tree

4 files changed

+69
-0
lines changed

4 files changed

+69
-0
lines changed

.github/workflows/packing.yml

+51
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: packing
2+
3+
on:
4+
push:
5+
pull_request:
6+
pull_request_target:
7+
types: [labeled]
8+
9+
jobs:
10+
pack_pip:
11+
# We want to run on external PRs, but not on our own internal
12+
# PRs as they'll be run by the push to the branch.
13+
#
14+
# The main trick is described here:
15+
# https://github.com/Dart-Code/Dart-Code/pull/2375
16+
if: (github.event_name == 'push') ||
17+
(github.event_name == 'pull_request' &&
18+
github.event.pull_request.head.repo.full_name != github.repository)
19+
runs-on: ubuntu-latest
20+
21+
strategy:
22+
fail-fast: false
23+
24+
steps:
25+
- name: Clone the connector repo
26+
uses: actions/checkout@v3
27+
# Checkout all tags for correct version computation.
28+
with:
29+
fetch-depth: 0
30+
31+
- name: Setup Python and basic packing tools
32+
uses: actions/setup-python@v4
33+
with:
34+
python-version: '3.10'
35+
36+
- name: Install tools for packing and verification
37+
run: pip3 install wheel twine
38+
39+
- name: Pack source and binary files
40+
run: make pip-dist
41+
42+
- name: Verify the package
43+
run: make pip-dist-check
44+
45+
- name: Archive pip artifacts
46+
uses: actions/upload-artifact@v3
47+
with:
48+
name: pip_dist
49+
path: pip_dist
50+
retention-days: 1
51+
if-no-files-found: error

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,4 @@ sophia
2121
venv/*
2222

2323
tarantool/version.py
24+
pip_dist

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
185185
always be equal to initialization `timestamp`.
186186

187187
- Support iproto feature push (#201).
188+
- Pack pip package with GitHub Actions (#198).
188189

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

Makefile

+16
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,19 @@ cov-report:
3131
.PHONY: docs
3232
docs:
3333
python3 setup.py build_sphinx
34+
35+
36+
.PHONY: pip-sdist
37+
pip-sdist:
38+
python3 setup.py sdist --dist-dir=pip_dist
39+
40+
.PHONY: pip-bdist
41+
pip-bdist:
42+
python3 setup.py bdist_wheel --dist-dir=pip_dist
43+
44+
.PHONY: pip-dist
45+
pip-dist: pip-sdist pip-bdist
46+
47+
.PHONY: pip-dist-check
48+
pip-dist-check:
49+
twine check pip_dist/*

0 commit comments

Comments
 (0)