diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index cc8d6020..1e23b8e7 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -7,6 +7,8 @@ jobs: build: name: Publish a release runs-on: ubuntu-latest + outputs: + new_tag: ${{ steps.tag_version.outputs.new_tag }} # Specifying an environment is strongly recommended by PyPI. # See https://github.com/pypa/gh-action-pypi-publish/tree/release/v1/?tab=readme-ov-file#trusted-publishing. @@ -241,3 +243,64 @@ jobs: --tag ghcr.io/vws-python/vws-cli:${{ steps.calver.outputs.release }} \ --tag ghcr.io/vws-python/vws-cli:latest \ . + + build-windows: + name: Build Windows binaries + needs: build + runs-on: windows-latest + + permissions: + contents: write + + steps: + - uses: actions/checkout@v6 + with: + fetch-depth: 0 + ref: ${{ needs.build.outputs.new_tag }} + + # We have a race condition. + # In particular, we push to PyPI and then immediately try to install + # the pushed version. + # Here, we give PyPI time to propagate the package. + # We normalize the version (e.g., 2026.01.22 -> 2026.1.22) for PyPI lookup. + - name: Wait for PyPI propagation + uses: nick-fields/retry@v3 + with: + timeout_seconds: 10 + max_attempts: 50 + shell: bash + command: | + normalized_version=$(echo "${{ needs.build.outputs.new_tag }}" | sed -E 's/\.0+([0-9])/.\1/g') + pip index versions vws-cli | grep -wq "$normalized_version" + + - name: Create requirements file + run: echo "vws-cli==${{ needs.build.outputs.new_tag }}" > requirements.txt + + - name: Create Windows binary for Vuforia Cloud Reco + uses: sayyid5416/pyinstaller@v1 + with: + python_ver: '3.13' + pyinstaller_ver: ==6.12.0 + spec: bin/vuforia-cloud-reco.py + requirements: requirements.txt + options: --onefile, --name "vuforia-cloud-reco-windows" + upload_exe_with_name: vuforia-cloud-reco-windows + clean_checkout: false + + - name: Create Windows binary for Vuforia Web Services + uses: sayyid5416/pyinstaller@v1 + with: + python_ver: '3.13' + pyinstaller_ver: ==6.12.0 + spec: bin/vuforia-web-services.py + requirements: requirements.txt + options: --onefile, --name "vws-windows" + upload_exe_with_name: vws-windows + clean_checkout: false + + - name: Upload Windows binaries to release + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: |- + gh release upload ${{ needs.build.outputs.new_tag }} dist/vws-windows.exe --clobber + gh release upload ${{ needs.build.outputs.new_tag }} dist/vuforia-cloud-reco-windows.exe --clobber diff --git a/README.rst b/README.rst index 91b3bd14..b3b331da 100644 --- a/README.rst +++ b/README.rst @@ -76,6 +76,13 @@ See the `full documentation`_ for details on how to install pre-built Linux bina .. _full documentation: https://vws-python.github.io/vws-cli/install.html#pre-built-linux-x86-binaries +Pre-built Windows binaries +^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Download the Windows executables from the `latest release`_ and place them in a directory on your ``PATH``. + +.. _latest release: https://github.com/VWS-Python/vws-cli/releases/latest + Usage example ------------- diff --git a/docs/source/install.rst b/docs/source/install.rst index 894d5314..bee0df1d 100644 --- a/docs/source/install.rst +++ b/docs/source/install.rst @@ -72,6 +72,13 @@ Pre-built Linux (x86) binaries $ curl --fail -L "https://github.com/|github-owner|/|github-repository|/releases/download/|release|/vuforia-cloud-reco-linux" -o /usr/local/bin/vuforia-cloud-reco && chmod +x /usr/local/bin/vuforia-cloud-reco +Pre-built Windows binaries +~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Download the Windows executables from the `latest release`_ and place them in a directory on your ``PATH``. + +.. _latest release: https://github.com/VWS-Python/vws-cli/releases/latest + Shell completion ~~~~~~~~~~~~~~~~ diff --git a/spelling_private_dict.txt b/spelling_private_dict.txt index 68afec36..e35df8e9 100644 --- a/spelling_private_dict.txt +++ b/spelling_private_dict.txt @@ -8,6 +8,7 @@ dockerfile dockerfiles dulwich entrypoint +executables gzip homebrew linter