Skip to content

Commit 4ccfa3e

Browse files
authored
Merge pull request #23 from pythonspeed/19-release-automation
Release automation.
2 parents ac0f82b + 1345a19 commit 4ccfa3e

File tree

5 files changed

+36
-9
lines changed

5 files changed

+36
-9
lines changed

.github/workflows/main.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ jobs:
1919

2020
steps:
2121
- uses: "actions/checkout@v2"
22+
with:
23+
# We need tags to get the correct code version:
24+
fetch-depth: 0
2225
- uses: "actions/setup-python@v1"
2326
with:
2427
python-version: "${{ matrix.python-version }}"
@@ -38,11 +41,38 @@ jobs:
3841
. venv/bin/activate
3942
make test
4043
- name: "Build wheel"
44+
if: startsWith(matrix.os, 'mac')
4145
run: |
4246
set -euo pipefail
4347
. venv/bin/activate
4448
make wheel
49+
- name: "Build manylinux wheel"
50+
if: startsWith(matrix.os, 'ubuntu') && (matrix.python-version == '3.8')
51+
run: |
52+
set -euo pipefail
53+
. venv/bin/activate
54+
make manylinux-wheel
4555
- uses: actions/upload-artifact@v2
4656
with:
4757
name: "${{ matrix.os }}-${{ matrix.python-version }}-wheel"
4858
path: dist/*.whl
59+
# - name: Publish distribution 📦 to Test PyPI
60+
# if: (startsWith(matrix.os, 'ubuntu') && (matrix.python-version == '3.8')) || startsWith(matrix.os, 'mac')
61+
# env:
62+
# TWINE_USERNAME: __token__
63+
# TWINE_PASSWORD: ${{ secrets.TEST_PYPI_TOKEN }}
64+
# run: |
65+
# set -euo pipefail
66+
# . venv/bin/activate
67+
# twine check dist/*.whl
68+
# twine upload --repository testpypi dist/*.whl
69+
- name: Publish distribution 📦 to PyPI
70+
if: startsWith(github.event.ref, 'refs/tags') && ((startsWith(matrix.os, 'ubuntu') && (matrix.python-version == '3.8')) || startsWith(matrix.os, 'mac'))
71+
env:
72+
TWINE_USERNAME: __token__
73+
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
74+
run: |
75+
set -euo pipefail
76+
. venv/bin/activate
77+
twine check dist/*.whl
78+
twine upload --repository pypi dist/*.whl

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ wheel:
4040

4141
.PHONY: manylinux-wheel
4242
manylinux-wheel:
43-
docker run -u $(shell id -u):$(shell id -g) -v $(PWD):/src manylinux-rust /src/wheels/build-wheels.sh
43+
docker run -u $(shell id -u):$(shell id -g) -v $(PWD):/src quay.io/pypa/manylinux2010_x86_64:latest /src/wheels/build-wheels.sh
4444

4545
.PHONY: clean
4646
clean:

RELEASING.md

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,10 @@ towncrier --draft --version=$NEWVERSION | less
1010
towncrier --version=$NEWVERSION
1111
```
1212

13+
## Commit the code, push to master
14+
1315
## Add a tag
1416

1517
Annotated.
1618

17-
## Upload wheels
18-
19-
```
20-
rm -f dist/*
21-
make wheel
22-
twine upload dist/*.whl
23-
```
19+
GitHub Actions should then build wheels and upload them.

setup.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ def read(path):
4141
"black",
4242
"towncrier==19.9.0rc1",
4343
"wheel",
44+
"auditwheel",
45+
"twine",
4446
],
4547
},
4648
description="A memory profiler for data batch processing applications.",

wheels/build-wheels.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ mkdir /tmp/wheel
55
export HOME=/tmp/home
66
cd /src
77
mkdir -p dist
8-
make target/release/libpymemprofile_api.a
98

109

1110
rm -f filprofiler/_filpreload.o

0 commit comments

Comments
 (0)