11name : TestPyPIBuild
22
3- # Based on https://github.com/tuananh/py-event-ruler/blob/0129d15e17d0023863a4d0e0e25e5256988b5c5b/.github/workflows/publish.yml
3+ # Based on:
4+ # - https://github.com/tuananh/py-event-ruler/blob/0129d15e17d0023863a4d0e0e25e5256988b5c5b/.github/workflows/publish.yml
5+ # - https://github.com/adhadse/excelFormExtractor/blob/1f82a97808b3cf3cdb25dcefdc1c6a1c74c5ad45/.github/workflows/build.yaml
46
57
68on :
911 - develop
1012 workflow_dispatch :
1113
12- # on:
13- # # release:
14- # # types: [created]
15- # push:
16- # tags:
17- # - '*'
18-
1914jobs :
2015 build_macos :
2116 # if: false
3025 - [ "arm64", "arm64" ]
3126 runs-on : macos-${{ matrix.os_version }}
3227 steps :
33- - uses : actions/checkout@v3
28+ - uses : actions/checkout@v4
3429
3530 - name : set up Go
3631 uses : actions/setup-go@v3
@@ -88,11 +83,11 @@ jobs:
8883
8984 build_linux_x86_64 :
9085 # if: false
91- name : Linux Python 3.x x86_64
86+ name : Linux Python x86_64
9287 runs-on : ubuntu-latest
9388
9489 steps :
95- - uses : actions/checkout@v3
90+ - uses : actions/checkout@v4
9691
9792 - name : Setup project files
9893 run : |
@@ -108,7 +103,7 @@ jobs:
108103 CIBW_ENVIRONMENT : >
109104 PATH=$PATH:/usr/local/go/bin
110105 CIBW_BEFORE_ALL_LINUX : |
111- curl -o go.tar.gz https://dl.google.com/go/go1.22.5 .linux-amd64.tar.gz
106+ curl -o go.tar.gz https://dl.google.com/go/go1.22.7 .linux-amd64.tar.gz
112107 tar -C /usr/local -xzf go.tar.gz
113108 go install github.com/go-python/gopy@v0.4.10
114109 go install golang.org/x/tools/cmd/goimports@latest
@@ -123,26 +118,59 @@ jobs:
123118 # # Test wheel functionality
124119 # python3 validate_otdf_python.py
125120
126- - name : Upload atifacts
121+ - name : Upload artifacts
127122 uses : actions/upload-artifact@v4
128123 with :
129124 name : wheels-linux-amd64
130125 path : ./wheelhouse/*.whl
131126
127+ build_linux_arm :
128+ name : Linux Python ARM
129+ runs-on : ubuntu-latest
130+
131+ steps :
132+ - uses : actions/checkout@v4
133+
134+ - name : Setup project files
135+ run : |
136+ rm -rf poetry.lock pyproject.toml
137+ cp setup_ci.py setup.py
138+
139+ # QEMU is used by cibuildwheel to cross-compile wheels
140+ # https://cibuildwheel.pypa.io/en/stable/faq/#emulation
141+ - name : Set up QEMU
142+ if : runner.os == 'Linux'
143+ uses : docker/setup-qemu-action@v3
144+ with :
145+ platforms : all
146+
147+ - name : Build wheels
148+ uses : pypa/cibuildwheel@v2.21.3
149+ env :
150+ CIBW_BUILD : " cp3*_aarch64"
151+ CIBW_SKIP : " cp36-* cp37-* cp38-* cp39-* cp310-* cp313-* *-musllinux_x86_64"
152+ CIBW_ARCHS : " aarch64"
153+ CIBW_ENVIRONMENT : >
154+ PATH=$PATH:/usr/local/go/bin
155+ CIBW_BEFORE_ALL_LINUX : |
156+ curl -o go.tar.gz https://dl.google.com/go/go1.22.7.linux-arm64.tar.gz
157+ tar -C /usr/local -xzf go.tar.gz
158+ go install github.com/go-python/gopy@v0.4.10
159+ go install golang.org/x/tools/cmd/goimports@latest
132160
133161 - name : Upload artifacts
134162 uses : actions/upload-artifact@v4
135163 with :
136164 name : wheels-linux-arm
137- path : /tmp/output /*.whl
165+ path : ./wheelhouse /*.whl
138166
139167# build_windows:
140168# if: false # not working
141169# name: Windows 310,311 x86_64
142170# runs-on: windows-2019
143171
144172# steps:
145- # - uses: actions/checkout@v3
173+ # - uses: actions/checkout@v4
146174
147175# - name: Setup project files
148176# run: |
@@ -182,9 +210,10 @@ jobs:
182210 contents : write
183211 # This permission is mandatory for PyPI's trusted publishing
184212 id-token : write
185- needs : [build_macos, build_linux_x86_64]
213+ needs : [build_macos, build_linux_x86_64, build_linux_arm ]
186214 runs-on : ubuntu-latest
187- # if: github.ref == 'refs/heads/main'
215+ # If branch is 'develop'
216+ if : github.ref == 'refs/heads/develop'
188217
189218 steps :
190219 - uses : actions/checkout@v4
0 commit comments