Skip to content

Commit b333af0

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 ff297ec commit b333af0

File tree

4 files changed

+73
-0
lines changed

4 files changed

+73
-0
lines changed

.github/workflows/packing.yml

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