Skip to content

Commit 847eb58

Browse files
Merge pull request #1889 from VWS-Python/feature/macos-binaries
Add macOS binary build to release workflow
2 parents 1c1f0ca + d0a1146 commit 847eb58

3 files changed

Lines changed: 83 additions & 0 deletions

File tree

.github/workflows/release.yml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -304,3 +304,63 @@ jobs:
304304
run: |-
305305
gh release upload ${{ needs.build.outputs.new_tag }} dist/vws-windows.exe --clobber
306306
gh release upload ${{ needs.build.outputs.new_tag }} dist/vuforia-cloud-reco-windows.exe --clobber
307+
308+
build-macos:
309+
name: Build macOS binaries
310+
needs: build
311+
runs-on: macos-latest
312+
313+
permissions:
314+
contents: write
315+
316+
steps:
317+
- uses: actions/checkout@v6
318+
with:
319+
fetch-depth: 0
320+
ref: ${{ needs.build.outputs.new_tag }}
321+
322+
# We have a race condition.
323+
# In particular, we push to PyPI and then immediately try to install
324+
# the pushed version.
325+
# Here, we give PyPI time to propagate the package.
326+
# We normalize the version (e.g., 2026.01.22 -> 2026.1.22) for PyPI lookup.
327+
- name: Wait for PyPI propagation
328+
uses: nick-fields/retry@v3
329+
with:
330+
timeout_seconds: 10
331+
max_attempts: 50
332+
command: |
333+
normalized_version=$(echo "${{ needs.build.outputs.new_tag }}" | sed -E 's/\.0+([0-9])/.\1/g')
334+
pip index versions vws-cli | grep -wq "$normalized_version"
335+
336+
- name: Create requirements file
337+
run: echo "vws-cli==${{ needs.build.outputs.new_tag }}" > requirements.txt
338+
339+
- name: Create macOS binary for Vuforia Cloud Reco
340+
uses: sayyid5416/pyinstaller@v1
341+
with:
342+
python_ver: '3.13'
343+
pyinstaller_ver: ==6.12.0
344+
spec: bin/vuforia-cloud-reco.py
345+
requirements: requirements.txt
346+
options: --onefile, --name "vuforia-cloud-reco-macos"
347+
upload_exe_with_name: vuforia-cloud-reco-macos
348+
clean_checkout: false
349+
350+
- name: Create macOS binary for Vuforia Web Services
351+
uses: sayyid5416/pyinstaller@v1
352+
with:
353+
python_ver: '3.13'
354+
pyinstaller_ver: ==6.12.0
355+
spec: bin/vuforia-web-services.py
356+
requirements: requirements.txt
357+
options: --onefile, --name "vws-macos"
358+
upload_exe_with_name: vws-macos
359+
clean_checkout: false
360+
361+
- name: Upload macOS binaries to release
362+
env:
363+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
364+
run: |-
365+
gh release upload ${{ needs.build.outputs.new_tag }} dist/vws-macos --clobber
366+
gh release upload ${{ needs.build.outputs.new_tag }} dist/vuforia-cloud-reco-macos --clobber

README.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,11 @@ Download the Windows executables from the `latest release`_ and place them in a
8383

8484
.. _latest release: https://github.com/VWS-Python/vws-cli/releases/latest
8585

86+
Pre-built macOS (ARM) binaries
87+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
88+
89+
See the `full documentation`_ for details on how to install pre-built macOS binaries.
90+
8691
Usage example
8792
-------------
8893

docs/source/install.rst

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,24 @@ Download the Windows executables from the `latest release`_ and place them in a
7979

8080
.. _latest release: https://github.com/VWS-Python/vws-cli/releases/latest
8181

82+
Pre-built macOS (ARM) binaries
83+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
84+
85+
.. code-block:: console
86+
:substitutions:
87+
88+
$ curl --fail -L "https://github.com/|github-owner|/|github-repository|/releases/download/|release|/vws-macos" -o /usr/local/bin/vws &&
89+
chmod +x /usr/local/bin/vws
90+
$ curl --fail -L "https://github.com/|github-owner|/|github-repository|/releases/download/|release|/vuforia-cloud-reco-macos" -o /usr/local/bin/vuforia-cloud-reco &&
91+
chmod +x /usr/local/bin/vuforia-cloud-reco
92+
93+
You may need to remove the quarantine attribute to allow the binaries to run:
94+
95+
.. code-block:: console
96+
97+
$ xattr -d com.apple.quarantine /usr/local/bin/vws
98+
$ xattr -d com.apple.quarantine /usr/local/bin/vuforia-cloud-reco
99+
82100
Shell completion
83101
~~~~~~~~~~~~~~~~
84102

0 commit comments

Comments
 (0)