diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 29a1720a0..14e6ad9fe 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -7,10 +7,10 @@ on: branches: - main tags: ["v[0-9]+.[0-9]+.[0-9]+"] - paths: ['.github/scripts/**','.github/workflows/build.yml', '**/CMakeLists.txt', '**/Makefile', '**/*.h', '**/*.hpp', '**/*.c', '**/*.cpp', '**/*.cu', '**/*.cc', '**/*.cxx', '!docs/**', '!.gitignore'] + paths: ['.github/scripts/**','.github/workflows/build.yml', '**/CMakeLists.txt', '**/Makefile', '**/*.h', '**/*.hpp', '**/*.c', '**/*.cpp', '**/*.cu', '**/*.cc', '**/*.cxx', '!docs/**', '!.gitignore', "!README.md"] pull_request: types: [opened, synchronize, reopened] - paths: ['.github/scripts/**','.github/workflows/build.yml', '**/CMakeLists.txt', '**/Makefile', '**/*.h', '**/*.hpp', '**/*.c', '**/*.cpp', '**/*.cu', '**/*.cc', '**/*.cxx', '!docs/**', '!.gitignore'] + paths: ['.github/scripts/**','.github/workflows/build.yml', '**/CMakeLists.txt', '**/Makefile', '**/*.h', '**/*.hpp', '**/*.c', '**/*.cpp', '**/*.cu', '**/*.cc', '**/*.cxx', '!docs/**', '!.gitignore', "!README.md"] workflow_dispatch: env: @@ -482,21 +482,53 @@ jobs: needs: [create-draft-release, ubuntu-amd64-build, ubuntu-amd64-cuda-build, macOS-M-build, macOS-Intel-build, windows-amd64-build, windows-amd64-cuda-build] runs-on: ubuntu-latest steps: + - name: Checkout code + uses: actions/checkout@v3 + with: + fetch-depth: "0" + token: ${{ secrets.PAT_SERVICE_ACCOUNT }} - name: Notify Discord uses: Ilshidur/action-discord@master with: args: "Nightly build artifact: https://github.com/janhq/nitro/actions/runs/{{ GITHUB_RUN_ID }}" env: DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }} + - name: Update README.md with artifact URL + run: | + sed -i "s|||" README.md + git config --global user.email "service@jan.ai" + git config --global user.name "Service Account" + git add README.md + git commit -m "${GITHUB_REPOSITORY}: Update README.md with nightly build artifact URL" + git -c http.extraheader="AUTHORIZATION: bearer ${{ secrets.PAT_SERVICE_ACCOUNT }}" push origin HEAD:main + env: + GITHUB_RUN_ID: ${{ github.run_id }} noti-discord-manual: if: always() && github.event_name == 'workflow_dispatch' && (needs.create-draft-release.result == 'success' || needs.create-draft-release.result == 'skipped') && needs.ubuntu-amd64-build.result == 'success' && needs.ubuntu-amd64-cuda-build.result == 'success' && needs.macOS-M-build.result == 'success' && needs.macOS-Intel-build.result == 'success' && needs.windows-amd64-build.result == 'success' && needs.windows-amd64-cuda-build.result == 'success' needs: [create-draft-release, ubuntu-amd64-build, ubuntu-amd64-cuda-build, macOS-M-build, macOS-Intel-build, windows-amd64-build, windows-amd64-cuda-build] runs-on: ubuntu-latest steps: + - name: Checkout code + uses: actions/checkout@v3 + with: + fetch-depth: "0" + token: ${{ secrets.PAT_SERVICE_ACCOUNT }} - name: Notify Discord uses: Ilshidur/action-discord@master with: args: "Manual build artifact: https://github.com/janhq/nitro/actions/runs/{{ GITHUB_RUN_ID }}" env: - DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }} \ No newline at end of file + DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }} + # Update README.md with artifact URL if manual build from main branch + - name: Update README.md with artifact URL + if: github.ref == 'refs/heads/main' + run: | + sed -i "s|||" README.md + git config --global user.email "service@jan.ai" + git config --global user.name "Service Account" + git add README.md + git commit -m "${GITHUB_REPOSITORY}: Update README.md with nightly build artifact URL" + git -c http.extraheader="AUTHORIZATION: bearer ${{ secrets.PAT_SERVICE_ACCOUNT }}" push origin HEAD:main + env: + GITHUB_RUN_ID: ${{ github.run_id }} \ No newline at end of file diff --git a/.github/workflows/update-release-url.yml b/.github/workflows/update-release-url.yml new file mode 100644 index 000000000..710d23ba7 --- /dev/null +++ b/.github/workflows/update-release-url.yml @@ -0,0 +1,50 @@ +name: Update Download URLs + +on: + release: + types: + - published + + workflow_dispatch: + +jobs: + update-readme: + runs-on: ubuntu-latest + environment: production + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + fetch-depth: "0" + token: ${{ secrets.PAT_SERVICE_ACCOUNT }} + ref: main + + - name: Get Latest Release + uses: pozetroninc/github-action-get-latest-release@v0.7.0 + id: get-latest-release + with: + repository: ${{ github.repository }} + + - name: Update Download URLs in README.md + run: | + echo "Latest Release: ${{ steps.get-latest-release.outputs.release }}" + tag=$(/bin/echo -n "${{ steps.get-latest-release.outputs.release }}") + echo "Tag: $tag" + # Remove the v prefix + release=${tag:1} + echo "Release: $release" + sed -i "s|||" README.md + sed -i "s|||" README.md + sed -i "s|||" README.md + sed -i "s|||" README.md + sed -i "s|||" README.md + sed -i "s|||" README.md + + - name: Commit and Push changes + if: github.event_name == 'release' + run: | + git config --global user.email "service@jan.ai" + git config --global user.name "Service Account" + git add README.md + git commit -m "Update README.md with Stable Download URLs" + git -c http.extraheader="AUTHORIZATION: bearer ${{ secrets.PAT_SERVICE_ACCOUNT }}" push origin HEAD:main \ No newline at end of file diff --git a/README.md b/README.md index 759932e17..de97c3e77 100644 --- a/README.md +++ b/README.md @@ -124,6 +124,66 @@ Nitro server is compatible with the OpenAI format, so you can expect the same ou ## Compile from source To compile nitro please visit [Compile from source](docs/new/build-source.md) +## Download + +
| Version Type | +Windows | +MacOS | +Linux | +|||
| Stable (Recommended) | +
+
+
+ CPU
+
+ |
+
+
+
+ CUDA
+
+ |
+
+
+
+ Intel
+
+ |
+
+
+
+ M1/M2
+
+ |
+
+
+
+ CPU
+
+ |
+
+
+
+ CUDA
+
+ |
+
| Experimental (Nighlty Build) | ++ + Github action artifactory + + | +|||||