@@ -2,6 +2,8 @@ name: Build and deploy wheels to pypi
22
33on :
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 :
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
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+
0 commit comments