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
1616env :
@@ -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 }}
0 commit comments