This repository has been archived by the owner on Oct 10, 2024. It is now read-only.
forked from Chia-Network/bls-signatures
-
Notifications
You must be signed in to change notification settings - Fork 1
118 lines (104 loc) · 3.65 KB
/
build-aarch64.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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
name: Build ARM64 wheel
on: [push, pull_request]
jobs:
build_wheels:
name: Build wheel on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ARM64]
steps:
- name: Cancel previous runs on the same branch
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}
- name: Checkout code
uses: actions/checkout@v2
with:
fetch-depth: 0
# we need fetch-depth 0 so setuptools_scm can resolve tags
- name: Test for secrets access
id: check_secrets
shell: bash
run: |
unset HAS_SECRET
if [ -n "$SECRET" ]; then HAS_SECRET='true' ; fi
echo ::set-output name=HAS_SECRET::${HAS_SECRET}
env:
SECRET: "${{ secrets.test_pypi_password }}"
- name: Prepare cibuildwheel
run: |
if [ ! -f "venv" ]; then rm -rf venv; fi
sudo apt-get install python3-venv python3-pip -y
python3 -m venv venv
source venv/bin/activate
python -m pip install --upgrade pip
pip install wheel
python -m pip install cibuildwheel==1.5.5
- name: Lint source with flake8
run: |
source venv/bin/activate
pip install flake8
flake8 src setup.py python-bindings python-impl
- name: Lint source with mypy
run: |
source venv/bin/activate
pip install mypy
mypy --config-file mypi.ini python-bindings python-impl
- name: Build wheel and test
run: |
source venv/bin/activate
python -m cibuildwheel --output-dir dist
env:
# build python 3.7 and 3.8
CIBW_BUILD: cp37-* cp38-*
CIBW_MANYLINUX_AARCH64_IMAGE: manylinux2014
CIBW_BUILD_VERBOSITY_LINUX: 0
CIBW_BEFORE_BUILD_LINUX: >
python -m pip install --upgrade pip
CIBW_BEFORE_ALL_LINUX: >
yum -y install epel-release
&& yum -y install cmake3 lzip
&& ln -s /usr/bin/cmake3 /usr/local/bin/cmake
&& cmake --version
&& curl -L https://gmplib.org/download/gmp/gmp-6.1.2.tar.lz | lzip -dc | tar x
&& cd gmp-6.1.2 && ./configure --enable-fat
&& make && make install && cd .. && rm -rf gmp-6.1.2
&& curl -L https://download.libsodium.org/libsodium/releases/libsodium-1.0.18-stable.tar.gz | tar xz
&& cd libsodium-stable && ./configure --with-pic="yes"
&& make && make install && cd .. && rm -rf libsodium-stable
CIBW_TEST_REQUIRES: pytest
CIBW_TEST_COMMAND: pytest -v {project}/python-bindings/test.py
- name: Upload artifacts
uses: actions/upload-artifact@v2
with:
name: wheels
path: ./dist
- name: Install twine
run: |
source venv/bin/activate
pip install twine
- name: Publish distribution to Test PyPI
if: steps.check_secrets.outputs.HAS_SECRET
env:
TWINE_REPOSITORY_URL: https://test.pypi.org/legacy/
TWINE_USERNAME: __token__
TWINE_NON_INTERACTIVE: 1
TWINE_PASSWORD: ${{ secrets.test_pypi_password }}
run: |
source venv/bin/activate
twine upload --non-interactive --skip-existing --verbose 'dist/*'
- name: Publish distribution to PyPI
if: startsWith(github.event.ref, 'refs/tags') && steps.check_secrets.outputs.HAS_SECRET
env:
TWINE_USERNAME: __token__
TWINE_NON_INTERACTIVE: 1
TWINE_PASSWORD: ${{ secrets.pypi_password }}
run: |
source venv/bin/activate
twine upload --non-interactive --skip-existing --verbose 'dist/*'
- name: Clean up
run: |
rm -rf venv
rm -rf dist