Skip to content

Commit

Permalink
Update github actions for apple m1
Browse files Browse the repository at this point in the history
  • Loading branch information
bryan-hunt committed Mar 21, 2022
1 parent 7c76e1a commit 50a11b1
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 13 deletions.
33 changes: 25 additions & 8 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ name: Build and deploy wheels to pypi

on:
push:
branches:
- main
tags:
- 20*

Expand All @@ -17,32 +19,33 @@ jobs:
- uses: actions/checkout@v2

- name: Describe Tag & Branch Name
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/20')
id: build_names
shell: bash
run: |
echo ::set-output name=TAG_NAME::${GITHUB_REF#refs/tags/}
cd python
echo ${GITHUB_REF#refs/tags/} >VERSION
- name: Configure Environment
shell: bash
run: |
echo $TAG_NAME
cd python
echo $TAG_NAME >VERSION
cp ../release_notes.md .
cp -r ../lib .
cp -r ../third_party .
mkdir app
cp -r ../app/tng app
env:
TAG_NAME: ${{ steps.build_names.outputs.TAG_NAME }}
- name: Build wheels
uses: joerick/cibuildwheel@v1.11.0
uses: pypa/cibuildwheel@v2.3.1
with:
package-dir: python
env:
# CIBW_SKIP: "*-win32"
CIBW_SKIP: "cp27-* pp*-macosx* cp35-macosx_x86_64"
CIBW_BUILD_VERBOSITY: 3
CIBW_ARCHS_MACOS: "x86_64 arm64"
# Skip trying to test arm64 builds on Intel Macs
CIBW_TEST_SKIP: "*-macosx_arm64 *-macosx_universal2:arm64"

- uses: actions/upload-artifact@v2
with:
Expand Down Expand Up @@ -82,6 +85,7 @@ jobs:
path: python/dist/*.tar.gz

upload_pypi:
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/20')
needs: [build_wheels, build_sdist]
runs-on: ubuntu-latest

Expand All @@ -91,7 +95,20 @@ jobs:
name: artifact
path: dist

- uses: pypa/gh-action-pypi-publish@master
- name: Production Release
if: startsWith(github.repository, 'MicrochipTech')
uses: pypa/gh-action-pypi-publish@release/v1.5
with:
user: ${{ secrets.pypi_username }}
password: ${{ secrets.pypi_password }}
skip_existing: true

- name: Test Release
if: ${{ !startsWith(github.repository, 'MicrochipTech') }}
uses: pypa/gh-action-pypi-publish@release/v1.5
with:
user: ${{ secrets.pypi_username }}
password: ${{ secrets.pypi_password }}
repository_url: https://test.pypi.org/legacy/
skip_existing: true

7 changes: 2 additions & 5 deletions python/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,6 @@
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Operating System :: OS Independent',
]

Expand Down Expand Up @@ -74,7 +71,7 @@
try:
_VERSION = open('VERSION', 'r').read().strip()
except FileNotFoundError:
with open('../lib/atca_version.h', 'r') as f:
with open('lib/atca_version.h', 'r') as f:
m = re.search(r'ATCA_LIBRARY_VERSION_DATE\s+\"([0-9]+)\"', f.read(), re.M)
_VERSION = m.groups()[0]

Expand Down Expand Up @@ -232,6 +229,6 @@ def has_ext_modules(self):
setup_requires=['setuptools>=38.6.0', 'wheel'],
install_requires=['enum34;python_version<"3.4"'],
ext_modules=_EXTENSIONS,
python_requires='>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, <4',
python_requires='>=3.4.*',
zip_safe=False
)

0 comments on commit 50a11b1

Please sign in to comment.