-
Notifications
You must be signed in to change notification settings - Fork 28
79 lines (76 loc) · 2.24 KB
/
pypi.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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
# roughly following https://packaging.python.org/en/latest/guides/publishing-package-distribution-releases-using-github-actions-ci-cd-workflows/
name: Pip Build and PyPI Deployment
on: [push]
jobs:
pip_build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository and submodules
uses: actions/checkout@v2
with:
submodules: recursive
- name: Set up Python 3.9
uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Install MPI
run: |
sudo apt-get update
sudo apt-get install -y mpich libmpich-dev
- name: Build using pip
run: |
pip install .
- name: Run tests (use pip instead of repo)
run: |
cd ..
cp -r bingo/tests .
mv bingo bingo_full
tests/.run_tests.sh normal
mv bingo_full bingo
deploy:
needs: pip_build
if: github.ref == 'refs/heads/master'
runs-on: ubuntu-latest
steps:
- name: Checkout repository and submodules
uses: actions/checkout@v2
with:
submodules: recursive
- name: Set up Python 3.9
uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Install MPI
run: |
sudo apt-get update
sudo apt-get install -y mpich libmpich-dev
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pytest pytest-cov pytest-mock
pip install coveralls
pip install build
pip install -r requirements.txt
- name: Build bingocpp
run: |
./.build_bingocpp.sh
- name: Build PyPI package
run: |
python -m build
- name: Remove wheel (was built for testing purposes)
run: |
cd dist
rm *.whl
cd ..
- name: Deploy to TestPyPI
uses: pypa/gh-action-pypi-publish@master
with:
user: __token__
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
repository_url: https://test.pypi.org/legacy/
- name: Deploy to PyPI (only on tagged commits)
if: startsWith(github.ref, 'refs/tags')
uses: pypa/gh-action-pypi-publish@master
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}