Skip to content

Commit 792cd1f

Browse files
author
Jeff Whitaker
authored
Merge pull request #6 from odidev/odidev_cftime-wheels
Add linux aarch64 wheel build support
2 parents 58aaef0 + 446e549 commit 792cd1f

File tree

1 file changed

+15
-58
lines changed

1 file changed

+15
-58
lines changed

.github/workflows/build-wheels.yml

Lines changed: 15 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -15,61 +15,6 @@ on:
1515

1616
jobs:
1717

18-
build_aarch64:
19-
20-
name: "build (${{ matrix.pyver }}, aarch64)"
21-
strategy:
22-
matrix:
23-
pyver: [cp37-cp37m, cp38-cp38, cp39-cp39]
24-
fail-fast: false
25-
runs-on: ubuntu-latest
26-
env:
27-
py: /opt/python/${{ matrix.pyver }}/bin/python
28-
img: quay.io/pypa/manylinux2014_aarch64
29-
python-version: ${{ matrix.pyver }}
30-
CFTIME_VERSION: 1.5.0
31-
BUILD_COMMIT: v1.5.0rel
32-
steps:
33-
- uses: actions/checkout@v2
34-
- name: Set up QEMU
35-
id: qemu
36-
uses: docker/setup-qemu-action@v1
37-
- name: Build and Test
38-
run: |
39-
docker run --rm -v /var/run/docker.sock:/var/run/docker.sock -v ${{ github.workspace }}:/ws:rw --workdir=/ws \
40-
${{ env.img }} \
41-
bash -exc 'yum install -y wget docker && \
42-
echo "Set Up Conda Env" && \
43-
wget https://github.com/conda-forge/miniforge/releases/download/4.8.2-1/Miniforge3-4.8.2-1-Linux-aarch64.sh -O miniconda.sh && \
44-
export MINICONDA_PATH=/root/miniconda && \
45-
chmod +x miniconda.sh && ./miniconda.sh -b -p $MINICONDA_PATH && \
46-
export PATH=$MINICONDA_PATH/bin:$PATH && \
47-
export Python=${{ env.python-version }} && \
48-
git clone https://github.com/Unidata/cftime && \
49-
git checkout $BUILD_COMMIT && \
50-
cd cftime && \
51-
conda create --name TEST python=${Python:2:1}.${Python:3:1} --file requirements.txt --file requirements-dev.txt && \
52-
source activate TEST && \
53-
pip install -v -e . --no-deps --force-reinstall && \
54-
pip wheel . -w dist --no-deps && \
55-
ls -l dist && \
56-
conda deactivate'
57-
CONTAINER_ID=$(docker ps -alq)
58-
FILE=cftime-${CFTIME_VERSION}-${{ matrix.pyver }}-linux_aarch64.whl
59-
docker cp $CONTAINER_ID:/ws/cftime/dist/$FILE ${{ github.workspace }}
60-
ls -l ${{ github.workspace }}
61-
62-
63-
- name: Upload wheels to release
64-
uses: svenstaro/upload-release-action@v2
65-
if: github.event_name == 'create'
66-
with:
67-
repo_token: ${{ secrets.GITHUB_TOKEN }}
68-
file: ${{ github.workspace }}/cftime*whl
69-
tag: ${{ github.ref }}
70-
overwrite: true
71-
file_glob: true
72-
7318
build_macos_linux:
7419

7520
runs-on: ${{ matrix.os }}
@@ -82,13 +27,18 @@ jobs:
8227
matrix:
8328
python-version: ["3.6", "3.7", "3.8", "3.9"]
8429
os: [ubuntu-latest, macos-latest]
85-
platform: [x64, x32]
30+
platform: [x64, x32, aarch64]
8631
MB_ML_VER: [1,2014]
8732
exclude:
8833
- os: macos-latest
8934
platform: x32
35+
- os: ubuntu-latest
36+
platform: aarch64
37+
MB_ML_VER: 1
38+
- os: macos-latest
39+
platform: aarch64
9040
env:
91-
BUILD_COMMIT: v1.5.0rel
41+
BUILD_COMMIT: v1.5.0rel2
9242
REPO_DIR: cftime
9343
PKG_NAME: cftime
9444
UNICODE_WIDTH: 32
@@ -109,6 +59,9 @@ jobs:
10959
uses: actions/setup-python@v2
11060
with:
11161
python-version: ${{ matrix.python-version }}
62+
- uses: docker/setup-qemu-action@v1
63+
if: ${{ matrix.platform == 'aarch64' }}
64+
name: Set up QEMU
11265
- name: Pin Numpy version
11366
run: |
11467
if [ "$MB_PYTHON_VERSION" == '3.6' ]; then
@@ -129,14 +82,18 @@ jobs:
12982
- name: Setup Environment variables
13083
run: |
13184
if [ "schedule" == "${{ github.event_name }}" ] || [ "master" == "$BUILD_COMMIT" ]; then echo "TOKEN=$SCIPY_WHEELS_NIGHTLY_ACCESS" >> $GITHUB_ENV; else echo "TOKEN=$MULTIBUILD_WHEELS_STAGING_ACCESS" >> $GITHUB_ENV; fi
132-
if [ "x32" == "${{ matrix.platform }}" ]; then echo "PLAT=i686" >> $GITHUB_ENV; else echo "PLAT=x86_64" >> $GITHUB_ENV; fi
85+
if [ "x32" == "${{ matrix.platform }}" ]; then echo "PLAT=i686" >> $GITHUB_ENV; elif [ "aarch64" == "${{ matrix.platform }}" ]; then echo "PLAT=aarch64" >> $GITHUB_ENV; else echo "PLAT=x86_64" >> $GITHUB_ENV; fi
13386
if [ "macos-latest" == "${{ matrix.os }}" ]; then echo "TRAVIS_OS_NAME=osx" >> $GITHUB_ENV; else echo "TRAVIS_OS_NAME=${{ matrix.os }}" >> $GITHUB_ENV; fi
13487
if [ "schedule" == "${{ github.event_name }}" ]; then echo "TRAVIS_EVENT_TYPE=cron" >> $GITHUB_ENV; else echo "TRAVIS_EVENT_TYPE=${{ github.event_name }}" >> $GITHUB_ENV; fi
13588
if [ "schedule" == "${{ github.event_name }}" ]; then echo "BUILD_COMMIT=master" >> $GITHUB_ENV; else echo "BUILD_COMMIT=$BUILD_COMMIT" >> $GITHUB_ENV; fi
13689
- name: Setup Special Environment variables for Linux
13790
if: startsWith(matrix.os,'ubuntu') && matrix.MB_ML_VER == 2010
13891
run: |
13992
echo "DOCKER_TEST_IMAGE=$(echo multibuild/xenial_$PLAT)" >> $GITHUB_ENV
93+
- name: Setup Special Environment variables for aarch64
94+
if: startsWith(matrix.platform,'aarch64') && matrix.MB_ML_VER == 2014
95+
run: |
96+
echo "DOCKER_TEST_IMAGE=$(echo multibuild/xenial_arm64v8)" >> $GITHUB_ENV
14097
- name: Print some Environment variable
14198
run: |
14299
echo "TRAVIS_BRANCH: ${TRAVIS_BRANCH}"

0 commit comments

Comments
 (0)