Skip to content

Commit f8c10cb

Browse files
author
Jeff Whitaker
committed
split macosx wheel building into separate yml
1 parent 660f3d5 commit f8c10cb

File tree

2 files changed

+133
-38
lines changed

2 files changed

+133
-38
lines changed

.github/workflows/build-wheels.yml renamed to .github/workflows/build-wheels-linux.yml

Lines changed: 20 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -24,41 +24,26 @@ jobs:
2424
fail-fast: false
2525

2626
matrix:
27-
python-version: [ "3.10" ]
28-
os: [macos-latest]
29-
platform: [x86_64]
30-
# matrix:
31-
# python-version: [ "3.6", "3.7", "3.8", "3.9", "3.10" ]
32-
# os: [ubuntu-latest, macos-latest]
33-
# platform: [x64, x32]
34-
# exclude:
35-
# - os: macos-latest
36-
# platform: x32
37-
# include:
38-
# - python-version: "3.6"
39-
# os: ubuntu-latest
40-
# platform: aarch64
41-
# - python-version: "3.7"
42-
# os: ubuntu-latest
43-
# platform: aarch64
44-
# - python-version: "3.8"
45-
# os: ubuntu-latest
46-
# platform: aarch64
47-
# - python-version: "3.9"
48-
# os: ubuntu-latest
49-
# platform: aarch64
50-
# - python-version: "3.10"
51-
# os: ubuntu-latest
52-
# platform: aarch64
53-
# - python-version: "3.8"
54-
# os: macos-latest
55-
# platform: x86_64
56-
# - python-version: "3.9"
57-
# os: macos-latest
58-
# platform: x86_64
59-
# - python-version: "3.10"
60-
# os: macos-latest
61-
# platform: x86_64
27+
python-version: [ "3.6", "3.7", "3.8", "3.9", "3.10" ]
28+
os: [ubuntu-latest]
29+
platform: [x64, x32]
30+
include:
31+
- python-version: "3.6"
32+
os: ubuntu-latest
33+
platform: aarch64
34+
- python-version: "3.7"
35+
os: ubuntu-latest
36+
platform: aarch64
37+
- python-version: "3.8"
38+
os: ubuntu-latest
39+
platform: aarch64
40+
- python-version: "3.9"
41+
os: ubuntu-latest
42+
platform: aarch64
43+
- python-version: "3.10"
44+
os: ubuntu-latest
45+
platform: aarch64
46+
6247
env:
6348
REPO_DIR: netcdf4-python
6449
PKG_NAME: netcdf4-python
@@ -90,11 +75,8 @@ jobs:
9075
run: |
9176
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
9277
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
93-
if [ "macos-latest" == "${{ matrix.os }}" ]; then echo "TRAVIS_OS_NAME=osx" >> $GITHUB_ENV; else echo "TRAVIS_OS_NAME=${{ matrix.os }}" >> $GITHUB_ENV; fi
9478
if [ "schedule" == "${{ github.event_name }}" ]; then echo "TRAVIS_EVENT_TYPE=cron" >> $GITHUB_ENV; else echo "TRAVIS_EVENT_TYPE=${{ github.event_name }}" >> $GITHUB_ENV; fi
9579
if [ "schedule" == "${{ github.event_name }}" ]; then echo "BUILD_COMMIT=master" >> $GITHUB_ENV; else echo "BUILD_COMMIT=$BUILD_COMMIT" >> $GITHUB_ENV; fi
96-
# make universal2 wheels on macos by cross-compiling
97-
if [ "macos-latest" == "${{ matrix.os }}" ]; then echo "PLAT=universal2" >> $GITHUB_ENV; fi
9880
9981
- name: Setup Special Environment variables for Linux AArch64
10082
if: ${{ matrix.platform == 'aarch64' }}
Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
# This workflow will install Python dependencies, run tests and build
2+
# manylinux wheels for a variety of python versions and architectures.
3+
4+
name: Build and upload macosx wheels
5+
6+
on:
7+
push:
8+
branches: [ master ]
9+
pull_request:
10+
branches: [ master ]
11+
create:
12+
tags:
13+
# schedule:
14+
# - cron: '0 0 * * 0,3' # 2/weekly
15+
16+
jobs:
17+
build:
18+
19+
runs-on: ${{ matrix.os }}
20+
defaults:
21+
run:
22+
shell: bash
23+
strategy:
24+
fail-fast: false
25+
26+
matrix:
27+
python-version: [ "3.8", "3.9","3.10" ]
28+
os: [macos-latest]
29+
platform: [x86_64]
30+
env:
31+
REPO_DIR: netcdf4-python
32+
PKG_NAME: netcdf4-python
33+
MB_ML_VER: 2014
34+
BUILD_COMMIT: v1.5.8rel
35+
UNICODE_WIDTH: 32
36+
MB_PYTHON_VERSION: ${{ matrix.python-version }}
37+
TRAVIS_PYTHON_VERSION: ${{ matrix.python-version }}
38+
TRAVIS_REPO_SLUG: ${{ github.repository }}
39+
TRAVIS_BRANCH: ${{ github.head_ref }}
40+
TRAVIS_PULL_REQUEST: ${{ github.event.number }}
41+
TRAVIS_BUILD_DIR: ${{ github.workspace }}
42+
MULTIBUILD_WHEELS_STAGING_ACCESS: ${{ secrets.MULTIBUILD_WHEELS_STAGING_ACCESS }}
43+
44+
steps:
45+
- uses: actions/checkout@v2
46+
with:
47+
submodules: recursive
48+
- name: Set up Python ${{ matrix.python-version }}
49+
uses: actions/setup-python@v2
50+
with:
51+
python-version: ${{ matrix.python-version }}
52+
53+
- name: Setup Environment variables
54+
run: |
55+
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
56+
if [ "schedule" == "${{ github.event_name }}" ]; then echo "TRAVIS_EVENT_TYPE=cron" >> $GITHUB_ENV; else echo "TRAVIS_EVENT_TYPE=${{ github.event_name }}" >> $GITHUB_ENV; fi
57+
if [ "schedule" == "${{ github.event_name }}" ]; then echo "BUILD_COMMIT=master" >> $GITHUB_ENV; else echo "BUILD_COMMIT=$BUILD_COMMIT" >> $GITHUB_ENV; fi
58+
echo "TRAVIS_OS_NAME=osx" >> $GITHUB_ENV
59+
echo "PLAT=universal2" >> $GITHUB_ENV
60+
61+
- name: Pin Numpy version
62+
run: |
63+
if [ "$MB_PYTHON_VERSION" == '3.6' ]; then
64+
echo "NP_DEP=$(echo numpy==1.17.3)" >> $GITHUB_ENV;
65+
elif [ "$MB_PYTHON_VERSION" == '3.7' ]; then
66+
echo "NP_DEP=$(echo numpy==1.17.3)" >> $GITHUB_ENV;
67+
elif [ "$MB_PYTHON_VERSION" == '3.8' ]; then
68+
echo "NP_DEP=$(echo oldest-supported-numpy)" >> $GITHUB_ENV;
69+
elif [ "$MB_PYTHON_VERSION" == '3.9' ]; then
70+
echo "NP_DEP=$(echo oldest-supported-numpy)" >> $GITHUB_ENV;
71+
elif [ "$MB_PYTHON_VERSION" == '3.10' ]; then
72+
echo "NP_DEP=$(echo oldest-supported-numpy)" >> $GITHUB_ENV;
73+
else
74+
echo "None of the defined python version, use default"
75+
fi
76+
77+
- name: Print some Environment variable
78+
run: |
79+
echo "TRAVIS_BRANCH: ${TRAVIS_BRANCH}"
80+
echo "TRAVIS_PULL_REQUEST: ${TRAVIS_PULL_REQUEST}"
81+
echo "TRAVIS_REPO_SLUG: ${TRAVIS_REPO_SLUG}"
82+
echo "TRAVIS_EVENT_TYPE: ${TRAVIS_EVENT_TYPE}"
83+
echo "TRAVIS_OS_NAME: ${TRAVIS_OS_NAME}"
84+
echo "PLAT: ${PLAT}"
85+
echo "DOCKER_TEST_IMAGE: ${DOCKER_TEST_IMAGE}"
86+
87+
- name: Install VirtualEnv
88+
run: |
89+
python -m pip install --upgrade pip
90+
pip install virtualenv
91+
- name: Build and Install Wheels
92+
run: |
93+
BUILD_DEPENDS="$NP_DEP cython setuptools"
94+
TEST_DEPENDS="$NP_DEP nose cython"
95+
source multibuild/common_utils.sh
96+
source multibuild/travis_steps.sh
97+
echo "------- BEFORE INSTALL --------"
98+
before_install
99+
echo "------- CLEAN CODE --------"
100+
clean_code $REPO_DIR $BUILD_COMMIT
101+
echo "------- BUILD WHEEL --------"
102+
build_wheel $REPO_DIR $PLAT
103+
echo "------- INSTALL_RUN --------"
104+
install_run $PLAT
105+
- name: Upload wheels to release
106+
uses: svenstaro/upload-release-action@v2
107+
if: github.event_name == 'create'
108+
with:
109+
repo_token: ${{ secrets.GITHUB_TOKEN }}
110+
file: ${{ github.workspace }}/wheelhouse/netCDF4*whl
111+
tag: ${{ github.ref }}
112+
overwrite: true
113+
file_glob: true

0 commit comments

Comments
 (0)