Skip to content

Commit 9fe3c8a

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 0c088f7 commit 9fe3c8a

File tree

4 files changed

+72
-0
lines changed

4 files changed

+72
-0
lines changed

.github/workflows/packing.yml

+57
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
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-20.04
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
37+
run: pip3 install wheel
38+
39+
- name: Install tools for package verification
40+
run: pip3 install twine
41+
42+
- name: Pack source files
43+
run: make pip-sdist
44+
45+
- name: Pack binary files
46+
run: make pip-bdist
47+
48+
- name: Verify the package
49+
run: make pip-dist-check
50+
51+
- name: Archive pip artifacts
52+
uses: actions/upload-artifact@v3
53+
with:
54+
name: pip_dist
55+
path: pip_dist
56+
retention-days: 1
57+
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 artifacts with GitHub Actions (#198).
188189

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

Makefile

+13
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,16 @@ 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-check
45+
pip-dist-check:
46+
twine check pip_dist/*

0 commit comments

Comments
 (0)