Skip to content

Commit 50a11b1

Browse files
committed
Update github actions for apple m1
1 parent 7c76e1a commit 50a11b1

File tree

2 files changed

+27
-13
lines changed

2 files changed

+27
-13
lines changed

.github/workflows/build.yml

Lines changed: 25 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ name: Build and deploy wheels to pypi
22

33
on:
44
push:
5+
branches:
6+
- main
57
tags:
68
- 20*
79

@@ -17,32 +19,33 @@ jobs:
1719
- uses: actions/checkout@v2
1820

1921
- name: Describe Tag & Branch Name
22+
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/20')
2023
id: build_names
2124
shell: bash
2225
run: |
23-
echo ::set-output name=TAG_NAME::${GITHUB_REF#refs/tags/}
26+
cd python
27+
echo ${GITHUB_REF#refs/tags/} >VERSION
2428
2529
- name: Configure Environment
2630
shell: bash
2731
run: |
28-
echo $TAG_NAME
2932
cd python
30-
echo $TAG_NAME >VERSION
3133
cp ../release_notes.md .
3234
cp -r ../lib .
3335
cp -r ../third_party .
3436
mkdir app
3537
cp -r ../app/tng app
36-
env:
37-
TAG_NAME: ${{ steps.build_names.outputs.TAG_NAME }}
3838
3939
- name: Build wheels
40-
uses: joerick/cibuildwheel@v1.11.0
40+
uses: pypa/cibuildwheel@v2.3.1
4141
with:
4242
package-dir: python
4343
env:
44-
# CIBW_SKIP: "*-win32"
44+
CIBW_SKIP: "cp27-* pp*-macosx* cp35-macosx_x86_64"
4545
CIBW_BUILD_VERBOSITY: 3
46+
CIBW_ARCHS_MACOS: "x86_64 arm64"
47+
# Skip trying to test arm64 builds on Intel Macs
48+
CIBW_TEST_SKIP: "*-macosx_arm64 *-macosx_universal2:arm64"
4649

4750
- uses: actions/upload-artifact@v2
4851
with:
@@ -82,6 +85,7 @@ jobs:
8285
path: python/dist/*.tar.gz
8386

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

@@ -91,7 +95,20 @@ jobs:
9195
name: artifact
9296
path: dist
9397

94-
- uses: pypa/gh-action-pypi-publish@master
98+
- name: Production Release
99+
if: startsWith(github.repository, 'MicrochipTech')
100+
uses: pypa/gh-action-pypi-publish@release/v1.5
95101
with:
96102
user: ${{ secrets.pypi_username }}
97103
password: ${{ secrets.pypi_password }}
104+
skip_existing: true
105+
106+
- name: Test Release
107+
if: ${{ !startsWith(github.repository, 'MicrochipTech') }}
108+
uses: pypa/gh-action-pypi-publish@release/v1.5
109+
with:
110+
user: ${{ secrets.pypi_username }}
111+
password: ${{ secrets.pypi_password }}
112+
repository_url: https://test.pypi.org/legacy/
113+
skip_existing: true
114+

python/setup.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,6 @@
2828
'Programming Language :: Python :: 2',
2929
'Programming Language :: Python :: 2.7',
3030
'Programming Language :: Python :: 3',
31-
'Programming Language :: Python :: 3.5',
32-
'Programming Language :: Python :: 3.6',
33-
'Programming Language :: Python :: 3.7',
3431
'Operating System :: OS Independent',
3532
]
3633

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

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

0 commit comments

Comments
 (0)