Skip to content

Commit

Permalink
Enrich discord message for nightly build url (janhq#1294)
Browse files Browse the repository at this point in the history
* Create shared job output get version for nightly build

* update CI prod add change version for web/package.json

* Add condition enable for auto update on CI run on main branch only

* Update Makefile to delete extensions folder on jan root

* Correct version for nightly build ci pipeline

* Add direct url for nightly build to README.md file

* Correct make clean path for windows

* Remove nightly build session in README

* Enrich discord message info

* correct nightly build url

---------

Co-authored-by: Hien To <[email protected]>
  • Loading branch information
hiento09 and hiento09 authored Jan 2, 2024
1 parent 07f4727 commit 76b5c5f
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 14 deletions.
32 changes: 22 additions & 10 deletions .github/workflows/jan-electron-build-nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -311,16 +311,22 @@ jobs:
- name: Notify Discord
uses: Ilshidur/action-discord@master
with:
args: "Jan App Nightly build artifact version {{ VERSION }}: https://github.com/janhq/jan/actions/runs/{{ GITHUB_RUN_ID }}"
args: |
Jan App Nightly build artifact version {{ VERSION }}:
- Windows: https://delta.jan.ai/{{ VERSION }}/jan-win-x64-{{ VERSION }}.exe
- macOS Intel: https://delta.jan.ai/{{ VERSION }}/jan-mac-x64-{{ VERSION }}.dmg
- macOS Apple Silicon: https://delta.jan.ai/{{ VERSION }}/jan-mac-arm64-{{ VERSION }}.dmg
- Linux: https://delta.jan.ai/{{ VERSION }}/jan-linux-amd64-{{ VERSION }}.deb
- Github action run: https://github.com/janhq/jan/actions/runs/{{ GITHUB_RUN_ID }}
env:
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}

- name: Update README.md with artifact URL
run: |
sed -i "s|<a href='https://delta.jan.ai/latest/jan-win-x64-.*'>|<a href='https://delta.jan.ai/latest/jan-win-x64-${{ needs.get-update-version.outputs.new_version }}.exe'>|" README.md
sed -i "s|<a href='https://delta.jan.ai/latest/jan-mac-x64-.*'>|<a href='https://delta.jan.ai/latest/jan-mac-x64-${{ needs.get-update-version.outputs.new_version }}.dmg'>|" README.md
sed -i "s|<a href='https://delta.jan.ai/latest/jan-mac-arm64-.*'>|<a href='https://delta.jan.ai/latest/jan-mac-arm64-${{ needs.get-update-version.outputs.new_version }}.dmg'>|" README.md
sed -i "s|<a href='https://delta.jan.ai/latest/jan-linux-amd64-.*'>|<a href='https://delta.jan.ai/latest/jan-linux-amd64-${{ needs.get-update-version.outputs.new_version }}.deb'>|" README.md
sed -i "s|<a href='https://delta.jan.ai/.*/jan-win-x64-.*'>|<a href='https://delta.jan.ai/${{ needs.get-update-version.outputs.new_version }}/jan-win-x64-${{ needs.get-update-version.outputs.new_version }}.exe'>|" README.md
sed -i "s|<a href='https://delta.jan.ai/.*/jan-mac-x64-.*'>|<a href='https://delta.jan.ai/${{ needs.get-update-version.outputs.new_version }}/jan-mac-x64-${{ needs.get-update-version.outputs.new_version }}.dmg'>|" README.md
sed -i "s|<a href='https://delta.jan.ai/.*/jan-mac-arm64-.*'>|<a href='https://delta.jan.ai/${{ needs.get-update-version.outputs.new_version }}/jan-mac-arm64-${{ needs.get-update-version.outputs.new_version }}.dmg'>|" README.md
sed -i "s|<a href='https://delta.jan.ai/.*/jan-linux-amd64-.*'>|<a href='https://delta.jan.ai/${{ needs.get-update-version.outputs.new_version }}/jan-linux-amd64-${{ needs.get-update-version.outputs.new_version }}.deb'>|" README.md
git config --global user.email "[email protected]"
git config --global user.name "Service Account"
git add README.md
Expand Down Expand Up @@ -348,18 +354,24 @@ jobs:
- name: Notify Discord
uses: Ilshidur/action-discord@master
with:
args: "Jan App Manual build artifact version {{ VERSION }}: https://github.com/janhq/jan/actions/runs/{{ GITHUB_RUN_ID }}"
args: |
Jan App Manual build artifact version {{ VERSION }}:
- Windows: https://delta.jan.ai/{{ VERSION }}/jan-win-x64-{{ VERSION }}.exe
- macOS Intel: https://delta.jan.ai/{{ VERSION }}/jan-mac-x64-{{ VERSION }}.dmg
- macOS Apple Silicon: https://delta.jan.ai/{{ VERSION }}/jan-mac-arm64-{{ VERSION }}.dmg
- Linux: https://delta.jan.ai/{{ VERSION }}/jan-linux-amd64-{{ VERSION }}.deb
- Github action run: https://github.com/janhq/jan/actions/runs/{{ GITHUB_RUN_ID }}
env:
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|<a href='https://delta.jan.ai/latest/jan-win-x64-.*'>|<a href='https://delta.jan.ai/latest/jan-win-x64-${{ needs.get-update-version.outputs.new_version }}.exe'>|" README.md
sed -i "s|<a href='https://delta.jan.ai/latest/jan-mac-x64-.*'>|<a href='https://delta.jan.ai/latest/jan-mac-x64-${{ needs.get-update-version.outputs.new_version }}.dmg'>|" README.md
sed -i "s|<a href='https://delta.jan.ai/latest/jan-mac-arm64-.*'>|<a href='https://delta.jan.ai/latest/jan-mac-arm64-${{ needs.get-update-version.outputs.new_version }}.dmg'>|" README.md
sed -i "s|<a href='https://delta.jan.ai/latest/jan-linux-amd64-.*'>|<a href='https://delta.jan.ai/latest/jan-linux-amd64-${{ needs.get-update-version.outputs.new_version }}.deb'>|" README.md
sed -i "s|<a href='https://delta.jan.ai/.*/jan-win-x64-.*'>|<a href='https://delta.jan.ai/${{ needs.get-update-version.outputs.new_version }}/jan-win-x64-${{ needs.get-update-version.outputs.new_version }}.exe'>|" README.md
sed -i "s|<a href='https://delta.jan.ai/.*/jan-mac-x64-.*'>|<a href='https://delta.jan.ai/${{ needs.get-update-version.outputs.new_version }}/jan-mac-x64-${{ needs.get-update-version.outputs.new_version }}.dmg'>|" README.md
sed -i "s|<a href='https://delta.jan.ai/.*/jan-mac-arm64-.*'>|<a href='https://delta.jan.ai/${{ needs.get-update-version.outputs.new_version }}/jan-mac-arm64-${{ needs.get-update-version.outputs.new_version }}.dmg'>|" README.md
sed -i "s|<a href='https://delta.jan.ai/.*/jan-linux-amd64-.*'>|<a href='https://delta.jan.ai/${{ needs.get-update-version.outputs.new_version }}/jan-linux-amd64-${{ needs.get-update-version.outputs.new_version }}.deb'>|" README.md
git config --global user.email "[email protected]"
git config --global user.name "Service Account"
git add README.md
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,25 +70,25 @@ Jan is an open-source ChatGPT alternative that runs 100% offline on your compute
<tr style="text-align:center">
<td style="text-align:center"><b>Experimental (Nightly Build)</b></td>
<td style="text-align:center">
<a href='https://delta.jan.ai/latest/jan-win-x64-0.4.3-107.exe'>
<a href='https://delta.jan.ai/0.4.3-107/jan-win-x64-0.4.3-107.exe'>
<img src='./docs/static/img/windows.png' style="height:14px; width: 14px" />
<b>jan.exe</b>
</a>
</td>
<td style="text-align:center">
<a href='https://delta.jan.ai/latest/jan-mac-x64-0.4.3-107.dmg'>
<a href='https://delta.jan.ai/0.4.3-107/jan-mac-x64-0.4.3-107.dmg'>
<img src='./docs/static/img/mac.png' style="height:15px; width: 15px" />
<b>Intel</b>
</a>
</td>
<td style="text-align:center">
<a href='https://delta.jan.ai/latest/jan-mac-arm64-0.4.3-107.dmg'>
<a href='https://delta.jan.ai/0.4.3-107/jan-mac-arm64-0.4.3-107.dmg'>
<img src='./docs/static/img/mac.png' style="height:15px; width: 15px" />
<b>M1/M2</b>
</a>
</td>
<td style="text-align:center">
<a href='https://delta.jan.ai/latest/jan-linux-amd64-0.4.3-107.deb'>
<a href='https://delta.jan.ai/0.4.3-107/jan-linux-amd64-0.4.3-107.deb'>
<img src='./docs/static/img/linux.png' style="height:14px; width: 14px" />
<b>jan.deb</b>
</a>
Expand Down

0 comments on commit 76b5c5f

Please sign in to comment.