-
Notifications
You must be signed in to change notification settings - Fork 13
121 lines (108 loc) · 3.39 KB
/
build-arm64-wheels.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
119
120
121
name: Build ARM64 wheels on ubuntu-latest
on:
push:
branches:
- main
- dev
release:
types: [published]
pull_request:
branches:
- '**'
permissions:
id-token: write
contents: read
jobs:
build_wheels:
name: Build ARM64 Python Wheels
runs-on: [ARM64, Linux]
container:
image: ghcr.io/chia-network/build-images/centos-pypa-rust-aarch64:latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
with:
fetch-depth: 1
- name: Set up
run: |
echo "${PATH}"
yum -y install openssl-devel
source /root/.cargo/env
rustup default stable
rustup target add aarch64-unknown-linux-musl
rm -rf venv
export PATH="${PATH}:/opt/python/cp39-cp39/bin/:/opt/python/cp38-cp38/bin/:/opt/python/cp37-cp37m/bin/"
- name: Build Python wheels
run: |
/opt/python/cp38-cp38/bin/python -m venv venv
if [ ! -f "activate" ]; then ln -s venv/bin/activate; fi
. ./activate
pip install maturin==1.1.0
CC=gcc maturin build --release --strip --manylinux 2014
- name: Upload artifacts
uses: actions/upload-artifact@v3
with:
name: wheels
path: target/wheels/
- name: Clean up AMR64
run: |
rm -rf venv
rm -rf dist
publish_wheels:
name: Publish ARM64 Python Wheels
runs-on: ubuntu-latest
needs: build_wheels
steps:
- name: Fetch wheels from previous job
uses: actions/download-artifact@v3
with:
name: wheels
path: target/wheels/
- name: Install job deps
run: |
if [ ! -f "venv" ]; then rm -rf venv; fi
sudo apt install python3 python3-pip -y
python3 -m venv venv
if [ ! -f "activate" ]; then ln -s venv/bin/activate; fi
. ./activate
pip3 install setuptools_rust
- name: Test for secrets access
id: check_secrets
shell: bash
run: |
unset HAS_AWS_SECRET
if [ -n "$AWS_SECRET" ]; then HAS_AWS_SECRET='true' ; fi
echo HAS_AWS_SECRET=${HAS_AWS_SECRET} >>$GITHUB_OUTPUT
env:
AWS_SECRET: "${{ secrets.CHIA_AWS_ACCOUNT_ID }}"
- name: Set Env
uses: Chia-Network/actions/setjobenv@main
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: publish (PyPi)
if: env.RELEASE == 'true'
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages-dir: target/wheels/
skip-existing: true
- name: publish (Test PyPi)
if: env.PRE_RELEASE == 'true'
uses: pypa/gh-action-pypi-publish@release/v1
with:
repository-url: https://test.pypi.org/legacy/
packages-dir: target/wheels/
skip-existing: true
- name: Configure AWS credentials
if: steps.check_secrets.outputs.HAS_AWS_SECRET
uses: aws-actions/configure-aws-credentials@v2
with:
role-to-assume: arn:aws:iam::${{ secrets.CHIA_AWS_ACCOUNT_ID }}:role/installer-upload
aws-region: us-west-2
- name: Publish Dev
if: steps.check_secrets.outputs.HAS_AWS_SECRET && github.ref == 'refs/heads/dev'
run: |
FILES=$(find ${{ github.workspace }}/target/wheels -type f -name '*.whl')
while IFS= read -r file; do
filename=$(basename $file)
aws --no-progress s3 cp "$file" "s3://download.chia.net/simple-dev/clvm-tools-rs/$filename"
done <<< "$FILES"