feat: add EDSL integration cookbook example (#1042) #227
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 Linux | |
| on: | |
| push: | |
| tags: | |
| - "v*" | |
| jobs: | |
| build-cli: | |
| name: Build ${{ matrix.runner }} | |
| runs-on: ${{ matrix.runner }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - runner: ubuntu-22.04 | |
| arch: x86_64 | |
| - runner: ubuntu-22.04-arm | |
| arch: arm64 | |
| env: | |
| VERSION: ${{ github.ref_name }} | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Setup Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version: 1.25.4 | |
| cache-dependency-path: runner/go.sum | |
| - name: Download runtime | |
| run: | | |
| cd runner | |
| make download | |
| - name: Build Nexa Cli | |
| run: | | |
| cd runner | |
| make build | |
| rm build/ml.h | |
| - name: Upload Artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: "nexa-cli_linux_${{ matrix.arch }}" | |
| path: runner/build | |
| include-hidden-files: true | |
| package-release: | |
| name: Package Release ${{ matrix.runner }} | |
| needs: build-cli | |
| runs-on: ${{ matrix.runner }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| include: | |
| - runner: ubuntu-22.04 | |
| arch: x86_64 | |
| - runner: ubuntu-22.04-arm | |
| arch: arm64 | |
| env: | |
| VERSION: ${{ github.ref_name }} | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Download build artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: "nexa-cli_linux_${{ matrix.arch }}" | |
| path: artifacts | |
| - name: Create Self-Contained Installer Script | |
| id: package | |
| run: | | |
| chmod +x runner/release/linux/package.sh | |
| ./runner/release/linux/package.sh artifacts \ | |
| runner/release/linux/install.sh \ | |
| nexa-cli_linux_${{ matrix.arch }}.sh | |
| - name: Create GitHub Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| repository: NexaAI/nexa-sdk | |
| tag_name: ${{ env.VERSION }} | |
| files: | | |
| nexa-cli_linux_${{ matrix.arch }}.sh | |
| draft: ${{ contains(github.ref, '-rc') }} | |
| generate_release_notes: ${{ matrix.arch == 'x86_64' }} | |
| 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_linux_${{ matrix.arch }}.sh" "s3://nexa-model-hub-bucket/public/nexa_sdk/downloads/nexa-cli_linux_${{ matrix.arch }}.sh" | |
| docker-release: | |
| name: Docker Release | |
| needs: build-cli | |
| runs-on: ubuntu-22.04 | |
| env: | |
| VERSION: ${{ github.ref_name }} | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Download build artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| path: artifacts | |
| - name: Prepare Build Context | |
| run: | | |
| mkdir -p runner/release/linux | |
| mv artifacts/nexa-cli_linux_x86_64 runner/release/linux/nexa_sdk.amd64 | |
| mv artifacts/nexa-cli_linux_arm64 runner/release/linux/nexa_sdk.arm64 | |
| chmod +x runner/release/linux/*/nexa | |
| chmod +x runner/release/linux/*/nexa-cli | |
| - name: Login to Docker Hub | |
| uses: docker/login-action@v3 | |
| with: | |
| username: ${{ secrets.DOCKERHUB_USERNAME }} | |
| password: ${{ secrets.DOCKERHUB_TOKEN }} | |
| - name: Set up QEMU | |
| uses: docker/setup-qemu-action@v3 | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Build and Push Docker Image (Base) | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: runner/release/linux | |
| push: true | |
| platforms: linux/amd64,linux/arm64 | |
| tags: | | |
| nexa4ai/nexasdk${{ contains(github.ref, '-rc') && '-test' || '' }}:${{ env.VERSION }} | |
| ${{ !contains(github.ref, '-rc') && 'nexa4ai/nexasdk:latest' || '' }} | |
| - name: Build and Push Docker Image (Cuda) | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: runner/release/linux | |
| push: true | |
| platforms: linux/amd64 | |
| build-args: | | |
| BASE_IMAGE=nvidia/cuda:12.9.1-runtime-ubuntu22.04 | |
| tags: | | |
| nexa4ai/nexasdk${{ contains(github.ref, '-rc') && '-test' || '' }}:${{ env.VERSION }}-cuda | |
| ${{ !contains(github.ref, '-rc') && 'nexa4ai/nexasdk:latest-cuda' || '' }} |