diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b1edf9aa5..88d7a760b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -4,8 +4,6 @@ on: schedule: - cron: "0 20 * * *" # At 8 PM UTC, which is 3 AM UTC+7 push: - branches: - - main tags: ["v[0-9]+.[0-9]+.[0-9]+"] paths: [ @@ -297,11 +295,9 @@ jobs: mkdir -p nitro cp llama.cpp/ggml-metal.metal nitro/ cp build/nitro nitro/ - tar -czvf nitro.tar.gz nitro - name: Upload Artifact uses: actions/upload-artifact@v2 - if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' || github.event_name == 'pull_request' with: name: nitro-mac-arm64 path: ./nitro @@ -330,16 +326,6 @@ jobs: chmod +x ../.github/scripts/e2e-test-whisper-linux-and-mac.sh && ../.github/scripts/e2e-test-whisper-linux-and-mac.sh ./nitro ${{ env.WHISPER_MODEL_URL }} rm -rf uploads/ - - uses: actions/upload-release-asset@v1.0.1 - if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - upload_url: ${{ needs.create-draft-release.outputs.upload_url }} - asset_path: ./nitro.tar.gz - asset_name: nitro-${{ needs.create-draft-release.outputs.version }}-mac-arm64.tar.gz - asset_content_type: application/gzip - macOS-amd64-build: runs-on: macos-latest needs: [create-draft-release, set-nitro-version] @@ -375,11 +361,9 @@ jobs: run: | mkdir -p nitro cp build/nitro nitro/ - tar -czvf nitro.tar.gz nitro - name: Upload Artifact uses: actions/upload-artifact@v2 - if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' || github.event_name == 'pull_request' with: name: nitro-mac-amd64 path: ./nitro @@ -400,6 +384,40 @@ jobs: chmod +x ../.github/scripts/e2e-test-whisper-linux-and-mac.sh && ../.github/scripts/e2e-test-whisper-linux-and-mac.sh ./nitro ${{ env.WHISPER_MODEL_URL }} rm -rf uploads/ + universal-nitro-artifact-macos: + runs-on: macos-latest + needs: [create-draft-release, set-nitro-version, macOS-silicon-build, macOS-amd64-build] + if: always() && (needs.create-draft-release.result == 'success' || needs.create-draft-release.result == 'skipped') && needs.set-nitro-version.result == 'success' + timeout-minutes: 20 + permissions: + contents: write + steps: + - name: download artifact amd64 + uses: actions/download-artifact@v2 + with: + name: nitro-mac-amd64 + path: ./nitro-mac-amd64 + + - name: download artifact arm64 + uses: actions/download-artifact@v2 + with: + name: nitro-mac-arm64 + path: ./nitro-mac-arm64 + + - name: bundle universal binary + run: | + mkdir -p nitro + ls ./nitro-mac-amd64 + lipo -create ./nitro-mac-amd64/nitro ./nitro-mac-arm64/nitro -output ./nitro/nitro + cp ./nitro-mac-arm64/ggml-metal.metal ./nitro/ggml-metal.metal + tar -czvf nitro.tar.gz nitro + + - name: Upload Artifact + uses: actions/upload-artifact@v2 + with: + name: nitro-mac-universal + path: ./nitro + - uses: actions/upload-release-asset@v1.0.1 if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/') env: @@ -407,7 +425,7 @@ jobs: with: upload_url: ${{ needs.create-draft-release.outputs.upload_url }} asset_path: ./nitro.tar.gz - asset_name: nitro-${{ needs.create-draft-release.outputs.version }}-mac-amd64.tar.gz + asset_name: nitro-${{ needs.create-draft-release.outputs.version }}-mac-universal.tar.gz asset_content_type: application/gzip windows-amd64-build: diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml deleted file mode 100644 index c713f0f5d..000000000 --- a/.github/workflows/codeql-analysis.yml +++ /dev/null @@ -1,112 +0,0 @@ -# For most projects, this workflow file will not need changing; you simply need -# to commit it to your repository. -# -# You may wish to alter this file to override the set of languages analyzed, -# or to provide custom queries or build logic. -# -# ******** NOTE ******** -# We have attempted to detect the languages in your repository. Please check -# the `language` matrix defined below to confirm you have the correct set of -# supported CodeQL languages. -# -name: "CodeQL" - -on: - push: - branches: - - main - tags: ["v[0-9]+.[0-9]+.[0-9]+"] - paths: - [ - ".github/scripts/**", - ".github/workflows/build.yml", - ".github/workflows/codeql-analysis.yml", - "**/CMakeLists.txt", - "**/Makefile", - "**/*.h", - "**/*.hpp", - "**/*.c", - "**/*.cpp", - "**/*.cu", - "**/*.cc", - "**/*.cxx", - "llama.cpp", - "!docs/**", - "!.gitignore", - "!README.md", - ] - pull_request: - types: [opened, synchronize, reopened] - paths: - [ - ".github/scripts/**", - ".github/workflows/build.yml", - ".github/workflows/codeql-analysis.yml", - "**/CMakeLists.txt", - "**/Makefile", - "**/*.h", - "**/*.hpp", - "**/*.c", - "**/*.cpp", - "**/*.cu", - "**/*.cc", - "**/*.cxx", - "llama.cpp", - "!docs/**", - "!.gitignore", - "!README.md", - ] - -jobs: - analyze: - name: Analyze - # Runner size impacts CodeQL analysis time. To learn more, please see: - # - https://gh.io/recommended-hardware-resources-for-running-codeql - # - https://gh.io/supported-runners-and-hardware-resources - # - https://gh.io/using-larger-runners - # Consider using larger runners for possible analysis time improvements. - runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }} - timeout-minutes: ${{ (matrix.language == 'swift' && 120) || 360 }} - permissions: - actions: read - contents: read - security-events: write - - strategy: - fail-fast: false - matrix: - language: ["c-cpp"] - # CodeQL supports [ 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'swift' ] - # Use only 'java-kotlin' to analyze code written in Java, Kotlin or both - # Use only 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both - # Learn more about CodeQL language support at https://aka.ms/codeql-docs/language-support - - steps: - - name: Checkout repository - uses: actions/checkout@v4 - with: - submodules: recursive - - - name: Initialize CodeQL - uses: github/codeql-action/init@v3 - with: - languages: ${{ matrix.language }} - - - name: Autobuild - run: | - ./install_deps.sh - mkdir build && cd build - cmake .. - CC=gcc-8 make -j $(sysctl -n hw.ncp) - ls -la - - - name: Excludes folders and files - run: | - rm -rf llama.cpp/examples/ - rm -rf docs/ - rm -rf examples/interface - - - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@v3 - with: - category: "/language:${{matrix.language}}" diff --git a/install.sh b/install.sh index 54d8b473d..f3cb7c174 100755 --- a/install.sh +++ b/install.sh @@ -73,7 +73,6 @@ create_uninstall_script() { # Determine OS and architecture OS=$(uname -s) -ARCH=$(uname -m) VERSION="latest" GPU="" @@ -119,7 +118,7 @@ case $OS in FILE_NAME="nitro-${VERSION}-linux-amd64${GPU}.tar.gz" ;; Darwin) - ARCH_FORMAT=$( [[ "$ARCH" == "arm64" ]] && echo "mac-arm64" || echo "mac-amd64") + ARCH_FORMAT="mac-universal" FILE_NAME="nitro-${VERSION}-${ARCH_FORMAT}.tar.gz" ;; *)