ci: fix #10
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Publish FastAPI EXE | |
on: | |
push: | |
tags: | |
- "v*" | |
# workflow_dispatch: | |
env: | |
APP_NAME: "juxtapose" | |
jobs: | |
# changelog: | |
# runs-on: ubuntu-latest | |
# steps: | |
# - name: Checkout repository | |
# uses: actions/checkout@v4 | |
# - name: Build changelog | |
# id: build_changelog | |
# run: | | |
# # NOTE: if commits subjects are standardized, you can filter the git log based on feat: and fix: | |
# # and then replace "feat:" with "New: " and "fix:" with "Fixed " | |
# # when AI gets good, we can also summarized commits into a bullet point list | |
# PREV_TAG=$(git tag --list v* | tail -n2 | head -n1) | |
# echo "changelog=$(git log $PREV_TAG...${{ github.ref_name }} --pretty=format:"- %s")" >> $GITHUB_OUTPUT | |
# outputs: | |
# changelog: ${{ steps.build_changelog.outputs.changelog }} | |
release: | |
strategy: | |
fail-fast: false | |
matrix: | |
platform: [macos-latest, windows-latest] | |
runs-on: ${{ matrix.platform }} | |
# needs: [changelog] | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: "3.9" | |
- name: Install dependencies | |
run: | | |
pip install --upgrade pip | |
pip cache purge | |
pip install --no-cache-dir . | |
pip uninstall -y juxtapose yapf | |
pip install pyinstaller fastapi uvicorn[standard] python-multipart juxtematics | |
- name: Build Windows CPU exe | |
if: ${{ matrix.platform == 'windows-latest' }} | |
run: | | |
mv src/juxtapose examples/fastapi-pyinstaller | |
pyinstaller -c -F --clean --hidden-import=cv2 --hidden-import=supervision --hidden-import=addict --hidden-import=chex --hidden-import=lap --hidden-import=optax --hidden-import=einshape --hidden-import=haiku --hidden-import=mediapy --name sidecar-x86_64-pc-windows-msvc-cpu --specpath dist --distpath dist examples/fastapi-pyinstaller/server.py | |
- name: Download ONNX dll | |
if: ${{ matrix.platform == 'windows-latest' }} | |
run: | | |
Invoke-WebRequest https://github.com/microsoft/onnxruntime/releases/download/v1.17.1/onnxruntime-win-x64-gpu-1.17.1.zip -OutFile onnxruntime-win-x64-gpu-1.17.1.zip | |
Expand-Archive -Force ./onnxruntime-win-x64-gpu-1.17.1.zip ./ | |
- name: Build Windows GPU exe | |
if: ${{ matrix.platform == 'windows-latest' }} | |
run: | | |
pyinstaller -c -F --clean --add-binary="../onnxruntime-win-x64-gpu-1.17.1/lib/onnxruntime_providers_cuda.dll;./onnxruntime/capi/" --add-binary="../onnxruntime-win-x64-gpu-1.17.1/lib/onnxruntime_providers_tensorrt.dll;./onnxruntime/capi/" --add-binary="../onnxruntime-win-x64-gpu-1.17.1/lib/onnxruntime_providers_shared.dll;./onnxruntime/capi/" --hidden-import=cv2 --hidden-import=supervision --hidden-import=addict --hidden-import=chex --hidden-import=lap --hidden-import=optax --hidden-import=einshape --hidden-import=haiku --hidden-import=mediapy --name sidecar-x86_64-pc-windows-msvc --specpath dist --distpath dist examples/fastapi-pyinstaller/server.py | |
- name: Build Mac exe | |
if: ${{ matrix.platform == 'macos-latest' }} | |
run: | | |
mv src/juxtapose examples/fastapi-pyinstaller | |
pyinstaller -c -F --clean --name sidecar-aarch64-apple-darwin --specpath dist --distpath dist examples/fastapi-pyinstaller/server.py | |
- name: Upload Windows EXE | |
uses: softprops/action-gh-release@v2 | |
if: ${{ matrix.platform == 'windows-latest' }} | |
with: | |
files: | | |
dist/sidecar-x86_64-pc-windows-msvc.exe | |
dist/sidecar-x86_64-pc-windows-msvc-cpu.exe | |
- name: Upload Windows EXE | |
uses: softprops/action-gh-release@v2 | |
if: ${{ matrix.platform == 'macos-latest' }} | |
with: | |
files: | | |
dist/sidecar-aarch64-apple-darwin | |
# - name: CI Upload Windows | |
# if: ${{ matrix.platform == 'windows-latest' }} | |
# uses: actions/upload-artifact@v4 | |
# with: | |
# name: "Windows Installers" | |
# path: | | |
# dist/sidecar-x86_64-pc-windows-msvc.exe | |
# - name: CI Upload macOS | |
# if: ${{ matrix.platform == 'macos-latest' }} | |
# uses: actions/upload-artifact@v4 | |
# with: | |
# name: "macOS Installer" | |
# path: | | |
# dist/sidecar-aarch64-apple-darwin | |
# - name: CI Upload Linux | |
# if: ${{ github.ref_type == 'branch' && matrix.platform == 'ubuntu-latest' }} | |
# uses: actions/upload-artifact@v4 | |
# with: | |
# name: "Linux Distributions" | |
# path: | | |
# src-tauri/target/release/bundle/deb/*.deb | |
# src-tauri/target/release/bundle/AppImage/*.AppImage |