update bridge version (#720) #193
Workflow file for this run
This file contains hidden or 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: NexaCLI on Windows | |
| on: | |
| push: | |
| tags: | |
| - "v*" | |
| workflow_dispatch: | |
| jobs: | |
| build-cli: | |
| name: windows_${{ matrix.arch }} | |
| runs-on: ${{ matrix.runner }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - runner: sdk-windows-8-core-2 | |
| arch: x86_64 | |
| - runner: windows-11-arm | |
| arch: arm64 | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Detect Tag Version | |
| if: startsWith(github.ref, 'refs/tags/v') | |
| run: echo "VERSION=${{ github.ref_name }}" >> $env:GITHUB_ENV | |
| - name: Detect Commit Hash | |
| if: github.event_name == 'workflow_dispatch' | |
| run: | | |
| $shortHash = "${{ github.sha }}".Substring(0, 7) | |
| echo "VERSION=$shortHash" >> $env:GITHUB_ENV | |
| - name: Setup Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: 1.25.1 | |
| cache-dependency-path: runner/go.sum | |
| - name: Setup MSYS2 (ARM64) | |
| if: matrix.arch == 'arm64' | |
| uses: msys2/setup-msys2@v2 | |
| with: | |
| msystem: CLANGARM64 | |
| location: C:/Tools | |
| update: true | |
| - name: Setup Compile Environment (ARM64) | |
| if: matrix.arch == 'arm64' | |
| shell: bash | |
| run: | | |
| PKG=( | |
| mingw-w64-clang-aarch64-clang-libs-20.1.8-2 | |
| mingw-w64-clang-aarch64-compiler-rt-20.1.8-2 | |
| mingw-w64-clang-aarch64-crt-git-13.0.0.r167.g2e31630bc-1 | |
| mingw-w64-clang-aarch64-gettext-runtime-0.26-1 | |
| mingw-w64-clang-aarch64-headers-git-13.0.0.r167.g2e31630bc-1 | |
| mingw-w64-clang-aarch64-libc++-20.1.8-1 | |
| mingw-w64-clang-aarch64-libffi-3.5.2-1 | |
| mingw-w64-clang-aarch64-libiconv-1.18-1 | |
| mingw-w64-clang-aarch64-libunwind-20.1.8-1 | |
| mingw-w64-clang-aarch64-libwinpthread-13.0.0.r167.g2e31630bc-1 | |
| mingw-w64-clang-aarch64-libxml2-2.14.6-1 | |
| mingw-w64-clang-aarch64-llvm-libs-20.1.8-2 | |
| mingw-w64-clang-aarch64-llvm-tools-20.1.8-2 | |
| mingw-w64-clang-aarch64-winpthreads-13.0.0.r167.g2e31630bc-1 | |
| mingw-w64-clang-aarch64-xz-5.8.1-2 | |
| mingw-w64-clang-aarch64-zlib-1.3.1-1 | |
| mingw-w64-clang-aarch64-zstd-1.5.7-1 | |
| mingw-w64-clang-aarch64-clang-20.1.8-2 | |
| mingw-w64-clang-aarch64-lld-20.1.8-2 | |
| ) | |
| for pkg in "${PKG[@]}"; do | |
| echo "Downloading $pkg..." | |
| curl -O "https://repo.msys2.org/mingw/clangarm64/${pkg}-any.pkg.tar.zst" -L | |
| done | |
| C:/Tools/msys64/usr/bin/pacman -U ./*.pkg.tar.zst --noconfirm | |
| echo "CC=C:/Tools/msys64/clangarm64/bin/clang.exe" >> $GITHUB_ENV | |
| echo "CXX=C:/Tools/msys64/clangarm64/bin/clang++.exe" >> $GITHUB_ENV | |
| - name: Download runtime | |
| shell: bash | |
| run: | | |
| cd runner | |
| make download ARCH=${{ matrix.arch }} | |
| ls build | |
| - name: Build Nexa Cli | |
| shell: bash | |
| run: | | |
| cd runner | |
| make build ARCH=${{ matrix.arch }} | |
| rm -f build/ml.h | |
| - name: Upload Artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: nexa-cli_windows_${{ matrix.arch }} | |
| path: runner/build | |
| include-hidden-files: true | |
| build-installer: | |
| name: Build Windows Installer & Release | |
| needs: build-cli | |
| runs-on: ${{ matrix.runner }} | |
| if: github.ref_type == 'tag' | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - runner: sdk-windows-8-core-2 | |
| arch: x86_64 | |
| - runner: windows-11-arm | |
| arch: arm64 | |
| env: | |
| VERSION: ${{ github.ref_name }} | |
| ARCH: ${{ matrix.arch }} | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Download build artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: nexa-cli_windows_${{ matrix.arch }} | |
| path: artifacts | |
| - name: Build launcher with PyInstaller | |
| run: | | |
| pip install pyinstaller | |
| pyinstaller --onefile --noconsole --distpath artifacts --name "nexa-cli-launcher" --icon="runner/release/windows/nexa_logo.ico" runner/release/windows/nexa_launcher.py | |
| # === Install Inno Setup (before compiling installers) === | |
| - name: Install Inno Setup | |
| shell: pwsh | |
| run: | | |
| if (Get-Command ISCC.exe -ErrorAction SilentlyContinue) { return } | |
| if (Get-Command choco -ErrorAction SilentlyContinue) { | |
| choco install innosetup -y --no-progress | |
| } else { | |
| winget install --id JRSoftware.InnoSetup -e --accept-source-agreements --accept-package-agreements | |
| } | |
| $inno = "${env:ProgramFiles(x86)}\Inno Setup 6" | |
| if (Test-Path "$inno\ISCC.exe") { | |
| "$inno" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append | |
| } | |
| - name: Sign executables with AzureSignTool | |
| shell: pwsh | |
| run: | | |
| dotnet tool install --global AzureSignTool | |
| Get-ChildItem -Path "artifacts" -Recurse -Include *.exe, *.dll | ForEach-Object { | |
| azuresigntool sign ` | |
| -kvu "${{ secrets.AZURE_KEY_VAULT_URI }}" ` | |
| -kvc "${{ secrets.AZURE_CERT_NAME }}" ` | |
| -kvi "${{ secrets.AZURE_CLIENT_ID }}" ` | |
| -kvs "${{ secrets.AZURE_CLIENT_SECRET }}" ` | |
| --azure-key-vault-tenant-id "${{ secrets.AZURE_TENANT_ID }}" ` | |
| -tr http://timestamp.globalsign.com/tsa/advanced ` | |
| -td sha256 ` | |
| $_.FullName | |
| } | |
| - name: Prepare Installer Files (X86_64) | |
| if: matrix.arch == 'x86_64' | |
| shell: bash | |
| run: | | |
| cp -r artifacts artifacts_cuda | |
| rm -r artifacts_cuda/nexa_dml* | |
| rm -r artifacts/nexa_cuda* | |
| - name: Compile Installer (CUDA) (X86_64) | |
| if: matrix.arch == 'x86_64' | |
| uses: Minionguyjpro/[email protected] | |
| with: | |
| path: runner/release/windows/nexa_installer.iss | |
| options: /O+ | |
| env: | |
| ORT: "_cuda" | |
| - name: Compile Installer | |
| uses: Minionguyjpro/[email protected] | |
| with: | |
| path: runner/release/windows/nexa_installer.iss | |
| options: /O+ | |
| env: | |
| ORT: "" | |
| - name: Sign Installer (ARM64) | |
| if: matrix.arch == 'arm64' | |
| shell: pwsh | |
| run: | | |
| azuresigntool sign ` | |
| -kvu "${{ secrets.AZURE_KEY_VAULT_URI }}" ` | |
| -kvc "${{ secrets.AZURE_CERT_NAME }}" ` | |
| -kvi "${{ secrets.AZURE_CLIENT_ID }}" ` | |
| -kvs "${{ secrets.AZURE_CLIENT_SECRET }}" ` | |
| --azure-key-vault-tenant-id "${{ secrets.AZURE_TENANT_ID }}" ` | |
| -tr http://timestamp.globalsign.com/tsa/advanced ` | |
| -td sha256 ` | |
| "nexa-cli_windows_${{ matrix.arch }}.exe" | |
| - name: Sign Installer (X86_64) | |
| if: matrix.arch == 'x86_64' | |
| run: | | |
| azuresigntool sign ` | |
| -kvu "${{ secrets.AZURE_KEY_VAULT_URI }}" ` | |
| -kvc "${{ secrets.AZURE_CERT_NAME }}" ` | |
| -kvi "${{ secrets.AZURE_CLIENT_ID }}" ` | |
| -kvs "${{ secrets.AZURE_CLIENT_SECRET }}" ` | |
| --azure-key-vault-tenant-id "${{ secrets.AZURE_TENANT_ID }}" ` | |
| -tr http://timestamp.globalsign.com/tsa/advanced ` | |
| -td sha256 ` | |
| "nexa-cli_windows_${{ matrix.arch }}_cuda.exe" | |
| azuresigntool sign ` | |
| -kvu "${{ secrets.AZURE_KEY_VAULT_URI }}" ` | |
| -kvc "${{ secrets.AZURE_CERT_NAME }}" ` | |
| -kvi "${{ secrets.AZURE_CLIENT_ID }}" ` | |
| -kvs "${{ secrets.AZURE_CLIENT_SECRET }}" ` | |
| --azure-key-vault-tenant-id "${{ secrets.AZURE_TENANT_ID }}" ` | |
| -tr http://timestamp.globalsign.com/tsa/advanced ` | |
| -td sha256 ` | |
| "nexa-cli_windows_${{ matrix.arch }}.exe" | |
| - name: Create GitHub Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| repository: NexaAI/nexa-sdk | |
| tag_name: ${{ env.VERSION }} | |
| files: | | |
| nexa-cli_windows_${{ matrix.arch }}_cuda.exe | |
| nexa-cli_windows_${{ matrix.arch }}.exe | |
| draft: ${{ contains(github.ref, '-rc') }} | |
| generate_release_notes: true | |
| make_latest: ${{ !contains(github.ref, '-rc') }} | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.ZACK_ACCESS_TOKEN }} | |
| - name: Configure AWS credentials | |
| if: ${{ !contains(github.ref, '-rc') }} | |
| uses: aws-actions/configure-aws-credentials@v4 | |
| with: | |
| aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
| aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
| aws-region: us-west-1 | |
| - name: Sync to S3 | |
| if: ${{ !contains(github.ref, '-rc') }} | |
| shell: bash | |
| run: | | |
| aws s3 cp "nexa-cli_windows_${{ matrix.arch }}.exe" "s3://nexa-model-hub-bucket/public/nexa_sdk/downloads/nexa-cli_windows_${{ matrix.arch }}.exe" | |
| - name: Sync to S3 (CUDA) (X86_64) | |
| if: ${{ !contains(github.ref, '-rc') && matrix.arch == 'x86_64' }} | |
| shell: bash | |
| run: | | |
| aws s3 cp "nexa-cli_windows_${{ matrix.arch }}_cuda.exe" "s3://nexa-model-hub-bucket/public/nexa_sdk/downloads/nexa-cli_windows_${{ matrix.arch }}_cuda.exe" |