Skip to content

Commit

Permalink
Fix update release url pipeline (janhq#941)
Browse files Browse the repository at this point in the history
* 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 <[email protected]>
  • Loading branch information
hiento09 and hientominh authored Dec 11, 2023
1 parent 074b18d commit 0e52ba8
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 4 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/jan-electron-build-nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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:
Expand Down
9 changes: 8 additions & 1 deletion .github/workflows/update-release-url.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,24 @@ jobs:
- name: Get Latest Release
uses: pozetroninc/[email protected]
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 "[email protected]"
git config --global user.name "Service Account"
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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'>
Expand Down

0 comments on commit 0e52ba8

Please sign in to comment.