Skip to content
This repository was archived by the owner on Jul 4, 2025. It is now read-only.

Commit e75ae3c

Browse files
authored
Nightly build update URL in README.md file (#257)
Co-authored-by: Hien To <tominhhien97@gmail.com>
1 parent b7d1099 commit e75ae3c

File tree

3 files changed

+145
-3
lines changed

3 files changed

+145
-3
lines changed

.github/workflows/build.yml

Lines changed: 35 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ on:
77
branches:
88
- main
99
tags: ["v[0-9]+.[0-9]+.[0-9]+"]
10-
paths: ['.github/scripts/**','.github/workflows/build.yml', '**/CMakeLists.txt', '**/Makefile', '**/*.h', '**/*.hpp', '**/*.c', '**/*.cpp', '**/*.cu', '**/*.cc', '**/*.cxx', '!docs/**', '!.gitignore']
10+
paths: ['.github/scripts/**','.github/workflows/build.yml', '**/CMakeLists.txt', '**/Makefile', '**/*.h', '**/*.hpp', '**/*.c', '**/*.cpp', '**/*.cu', '**/*.cc', '**/*.cxx', '!docs/**', '!.gitignore', "!README.md"]
1111
pull_request:
1212
types: [opened, synchronize, reopened]
13-
paths: ['.github/scripts/**','.github/workflows/build.yml', '**/CMakeLists.txt', '**/Makefile', '**/*.h', '**/*.hpp', '**/*.c', '**/*.cpp', '**/*.cu', '**/*.cc', '**/*.cxx', '!docs/**', '!.gitignore']
13+
paths: ['.github/scripts/**','.github/workflows/build.yml', '**/CMakeLists.txt', '**/Makefile', '**/*.h', '**/*.hpp', '**/*.c', '**/*.cpp', '**/*.cu', '**/*.cc', '**/*.cxx', '!docs/**', '!.gitignore', "!README.md"]
1414
workflow_dispatch:
1515

1616
env:
@@ -482,21 +482,53 @@ jobs:
482482
needs: [create-draft-release, ubuntu-amd64-build, ubuntu-amd64-cuda-build, macOS-M-build, macOS-Intel-build, windows-amd64-build, windows-amd64-cuda-build]
483483
runs-on: ubuntu-latest
484484
steps:
485+
- name: Checkout code
486+
uses: actions/checkout@v3
487+
with:
488+
fetch-depth: "0"
489+
token: ${{ secrets.PAT_SERVICE_ACCOUNT }}
485490
- name: Notify Discord
486491
uses: Ilshidur/action-discord@master
487492
with:
488493
args: "Nightly build artifact: https://github.com/janhq/nitro/actions/runs/{{ GITHUB_RUN_ID }}"
489494
env:
490495
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
496+
- name: Update README.md with artifact URL
497+
run: |
498+
sed -i "s|<a href='https://github.com/janhq/nitro/actions/runs/.*'>|<a href='https://github.com/janhq/nitro/actions/runs/${GITHUB_RUN_ID}'>|" README.md
499+
git config --global user.email "service@jan.ai"
500+
git config --global user.name "Service Account"
501+
git add README.md
502+
git commit -m "${GITHUB_REPOSITORY}: Update README.md with nightly build artifact URL"
503+
git -c http.extraheader="AUTHORIZATION: bearer ${{ secrets.PAT_SERVICE_ACCOUNT }}" push origin HEAD:main
504+
env:
505+
GITHUB_RUN_ID: ${{ github.run_id }}
491506

492507
noti-discord-manual:
493508
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'
494509
needs: [create-draft-release, ubuntu-amd64-build, ubuntu-amd64-cuda-build, macOS-M-build, macOS-Intel-build, windows-amd64-build, windows-amd64-cuda-build]
495510
runs-on: ubuntu-latest
496511
steps:
512+
- name: Checkout code
513+
uses: actions/checkout@v3
514+
with:
515+
fetch-depth: "0"
516+
token: ${{ secrets.PAT_SERVICE_ACCOUNT }}
497517
- name: Notify Discord
498518
uses: Ilshidur/action-discord@master
499519
with:
500520
args: "Manual build artifact: https://github.com/janhq/nitro/actions/runs/{{ GITHUB_RUN_ID }}"
501521
env:
502-
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
522+
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
523+
# Update README.md with artifact URL if manual build from main branch
524+
- name: Update README.md with artifact URL
525+
if: github.ref == 'refs/heads/main'
526+
run: |
527+
sed -i "s|<a href='https://github.com/janhq/nitro/actions/runs/.*'>|<a href='https://github.com/janhq/nitro/actions/runs/${GITHUB_RUN_ID}'>|" README.md
528+
git config --global user.email "service@jan.ai"
529+
git config --global user.name "Service Account"
530+
git add README.md
531+
git commit -m "${GITHUB_REPOSITORY}: Update README.md with nightly build artifact URL"
532+
git -c http.extraheader="AUTHORIZATION: bearer ${{ secrets.PAT_SERVICE_ACCOUNT }}" push origin HEAD:main
533+
env:
534+
GITHUB_RUN_ID: ${{ github.run_id }}
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: Update Download URLs
2+
3+
on:
4+
release:
5+
types:
6+
- published
7+
8+
workflow_dispatch:
9+
10+
jobs:
11+
update-readme:
12+
runs-on: ubuntu-latest
13+
environment: production
14+
steps:
15+
- name: Checkout code
16+
uses: actions/checkout@v4
17+
with:
18+
fetch-depth: "0"
19+
token: ${{ secrets.PAT_SERVICE_ACCOUNT }}
20+
ref: main
21+
22+
- name: Get Latest Release
23+
uses: pozetroninc/github-action-get-latest-release@v0.7.0
24+
id: get-latest-release
25+
with:
26+
repository: ${{ github.repository }}
27+
28+
- name: Update Download URLs in README.md
29+
run: |
30+
echo "Latest Release: ${{ steps.get-latest-release.outputs.release }}"
31+
tag=$(/bin/echo -n "${{ steps.get-latest-release.outputs.release }}")
32+
echo "Tag: $tag"
33+
# Remove the v prefix
34+
release=${tag:1}
35+
echo "Release: $release"
36+
sed -i "s|<a href='https://github.com/janhq/nitro/releases/download/v.*-linux-amd64-cuda.tar.gz'>|<a href='https://github.com/janhq/nitro/releases/download/v${release}/nitro-${release}-linux-amd64-cuda.tar.gz'>|" README.md
37+
sed -i "s|<a href='https://github.com/janhq/nitro/releases/download/v.*-linux-amd64.tar.gz'>|<a href='https://github.com/janhq/nitro/releases/download/v${release}/nitro-${release}-linux-amd64.tar.gz'>|" README.md
38+
sed -i "s|<a href='https://github.com/janhq/nitro/releases/download/v.*-mac-amd64.tar.gz'>|<a href='https://github.com/janhq/nitro/releases/download/v${release}/nitro-${release}-mac-amd64.tar.gz'>|" README.md
39+
sed -i "s|<a href='https://github.com/janhq/nitro/releases/download/v.*-mac-arm64.tar.gz'>|<a href='https://github.com/janhq/nitro/releases/download/v${release}/nitro-${release}-mac-arm64.tar.gz'>|" README.md
40+
sed -i "s|<a href='https://github.com/janhq/nitro/releases/download/v.*-win-amd64-cuda.tar.gz'>|<a href='https://github.com/janhq/nitro/releases/download/v${release}/nitro-${release}-win-amd64-cuda.tar.gz'>|" README.md
41+
sed -i "s|<a href='https://github.com/janhq/nitro/releases/download/v.*-win-amd64.tar.gz'>|<a href='https://github.com/janhq/nitro/releases/download/v${release}/nitro-${release}-win-amd64.tar.gz'>|" README.md
42+
43+
- name: Commit and Push changes
44+
if: github.event_name == 'release'
45+
run: |
46+
git config --global user.email "service@jan.ai"
47+
git config --global user.name "Service Account"
48+
git add README.md
49+
git commit -m "Update README.md with Stable Download URLs"
50+
git -c http.extraheader="AUTHORIZATION: bearer ${{ secrets.PAT_SERVICE_ACCOUNT }}" push origin HEAD:main

README.md

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,66 @@ Nitro server is compatible with the OpenAI format, so you can expect the same ou
124124
## Compile from source
125125
To compile nitro please visit [Compile from source](docs/new/build-source.md)
126126

127+
## Download
128+
129+
<table>
130+
<tr>
131+
<td style="text-align:center"><b>Version Type</b></td>
132+
<td colspan="2" style="text-align:center"><b>Windows</b></td>
133+
<td colspan="2" style="text-align:center"><b>MacOS</b></td>
134+
<td colspan="2" style="text-align:center"><b>Linux</b></td>
135+
</tr>
136+
<tr>
137+
<td style="text-align:center"><b>Stable (Recommended)</b></td>
138+
<td style="text-align:center">
139+
<a href='https://github.com/janhq/nitro/releases/download/v0.1.25/nitro-0.1.25-win-amd64.tar.gz'>
140+
<img src='./docs/static/img/mac.png' style="height:15px; width: 15px" />
141+
<b>CPU</b>
142+
</a>
143+
</td>
144+
<td style="text-align:center">
145+
<a href='https://github.com/janhq/nitro/releases/download/v0.1.25/nitro-0.1.25-win-amd64-cuda.tar.gz'>
146+
<img src='./docs/static/img/mac.png' style="height:15px; width: 15px" />
147+
<b>CUDA</b>
148+
</a>
149+
</td>
150+
<td style="text-align:center">
151+
<a href='https://github.com/janhq/nitro/releases/download/v0.1.25/nitro-0.1.25-mac-amd64.tar.gz'>
152+
<img src='./docs/static/img/mac.png' style="height:15px; width: 15px" />
153+
<b>Intel</b>
154+
</a>
155+
</td>
156+
<td style="text-align:center">
157+
<a href='https://github.com/janhq/nitro/releases/download/v0.1.25/nitro-0.1.25-mac-arm64.tar.gz'>
158+
<img src='./docs/static/img/mac.png' style="height:15px; width: 15px" />
159+
<b>M1/M2</b>
160+
</a>
161+
</td>
162+
<td style="text-align:center">
163+
<a href='https://github.com/janhq/nitro/releases/download/v0.1.25/nitro-0.1.25-linux-amd64.tar.gz'>
164+
<img src='./docs/static/img/mac.png' style="height:15px; width: 15px" />
165+
<b>CPU</b>
166+
</a>
167+
</td>
168+
<td style="text-align:center">
169+
<a href='https://github.com/janhq/nitro/releases/download/v0.1.25/nitro-0.1.25-linux-amd64-cuda.tar.gz'>
170+
<img src='./docs/static/img/mac.png' style="height:15px; width: 15px" />
171+
<b>CUDA</b>
172+
</a>
173+
</td>
174+
</tr>
175+
<tr style="text-align: center">
176+
<td style="text-align:center"><b>Experimental (Nighlty Build)</b></td>
177+
<td style="text-align:center" colspan="6">
178+
<a href='https://github.com/janhq/nitro/actions/runs/7172729642'>
179+
<b>Github action artifactory</b>
180+
</a>
181+
</td>
182+
</tr>
183+
</table>
184+
185+
Download the latest version of Nitro at https://nitro.jan.ai/ or visit the **[GitHub Releases](https://github.com/janhq/nitro/releases)** to download any previous release.
186+
127187
## Nightly Build
128188

129189
Nightly build is a process where the software is built automatically every night. This helps in detecting and fixing bugs early in the development cycle. The process for this project is defined in [`.github/workflows/build.yml`](.github/workflows/build.yml)

0 commit comments

Comments
 (0)