forked from finos/qPython
-
Notifications
You must be signed in to change notification settings - Fork 1
55 lines (53 loc) · 1.68 KB
/
publish.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
name: QPython publish
on:
workflow_dispatch:
inputs:
version:
description: "Package version (x.y.z)"
required: true
prod:
description: "Use the real PyPI instead of the test one"
type: boolean
required: false
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Input check
env:
version: ${{ github.event.inputs.version }}
run: |
if ! [[ $version =~ ^[0-9.]+$ ]]; then echo invalid version; exit 1; fi
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install --upgrade wheel
pip install -r requirements.txt -U
- name: Build
run: |
sed -i "s/@@VERSION_PLACEHOLDER@@/$version/g" qpython/__init__.py
python setup.py build_ext --inplace
python setup.py sdist
- name: Test
run: |
env PYTHONPATH=. py.test
- name: Build manylinux
uses: RalfG/python-wheels-manylinux-build@v0.3.4
with:
python-versions: 'cp36-cp36m cp37-cp37m cp38-cp38 cp39-cp39'
build-requirements: 'cython numpy'
- name: Publish
env:
prodInput: ${{ github.event.inputs.prod }}
run: |
pip install --upgrade twine
find dist -name "*-linux*" -delete
ls -l dist
repoParam=
if [[ -z ${prodInput} ]]; then repoParam="--repository testpypi"; fi
twine upload ${repoParam} dist/* --username __token__ --password ${{ secrets.PYPI_API }}