Fix update release url pipeline (#941)

* update-release-url pipeline add trigger commit to git if github event is release

* Remove v in release tag

* Change job name and add checkout step

---------

Co-authored-by: Hien To <tominhhien97@gmail.com>
This commit is contained in:
hiento09 2023-12-11 18:56:59 +07:00 committed by GitHub
parent 074b18da74
commit 0e52ba8483
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 15 additions and 4 deletions

View File

@ -173,12 +173,14 @@ jobs:
name: jan-linux-amd64-${{ steps.version_update.outputs.new_version }}
path: ./electron/dist/*.deb
noti-discord-nightly:
noti-discord-nightly-and-update-url-readme:
needs: [build-macos, build-windows-x64, build-linux-x64]
environment: production
if: github.event_name == 'schedule'
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Notify Discord
uses: Ilshidur/action-discord@master
with:
@ -197,12 +199,14 @@ jobs:
env:
GITHUB_RUN_ID: ${{ github.run_id }}
noti-discord-manual:
noti-discord-manual-and-update-url-readme:
needs: [build-macos, build-windows-x64, build-linux-x64]
environment: production
if: github.event_name == 'workflow_dispatch'
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Notify Discord
uses: Ilshidur/action-discord@master
with:

View File

@ -18,17 +18,24 @@ jobs:
- 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 }}"
release=$(/bin/echo -n "${{ 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|<a href='https://github.com/janhq/jan/releases/download/v.*/jan-win-x64-.*'>|<a href='https://github.com/janhq/jan/releases/download/v${release}/jan-win-x64-${release}.exe'>|" README.md
sed -i "s|<a href='https://github.com/janhq/jan/releases/download/v.*/jan-mac-x64-.*'>|<a href='https://github.com/janhq/jan/releases/download/v${release}/jan-mac-x64-${release}.dmg'>|" README.md
sed -i "s|<a href='https://github.com/janhq/jan/releases/download/v.*/jan-mac-arm64-.*'>|<a href='https://github.com/janhq/jan/releases/download/v${release}/jan-mac-arm64-${release}.dmg'>|" README.md
sed -i "s|<a href='https://github.com/janhq/jan/releases/download/v.*/jan-linux-amd64-.*'>|<a href='https://github.com/janhq/jan/releases/download/v${release}/jan-linux-amd64-${release}.deb'>|" 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"

View File

@ -40,7 +40,7 @@ Jan is an open-source ChatGPT alternative that runs 100% offline on your compute
<td colspan="2" style="text-align:center"><b>MacOS</b></td>
<td style="text-align:center"><b>Linux</b></td>
</tr>
<tr style="text-align: center">
<tr>
<td style="text-align:center"><b>Stable (Recommended)</b></td>
<td style="text-align:center">
<a href='https://github.com/janhq/jan/releases/download/v0.4.0/jan-win-x64-0.4.0.exe'>