-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CI automatically update Update README with Nightly Build Information …
…and stable download URL (janhq#940) * Add table download to README * CI update Nightly Build URL on github README.md file * Add CI to update latest release url to README.md * Add clean cache to test pipeline * set style=text-align:center in download table * Manual build update experimental URL if triggered from main branch --------- Co-authored-by: Hien To <[email protected]>
- Loading branch information
1 parent
730dcfc
commit 074b18d
Showing
7 changed files
with
134 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -68,13 +68,13 @@ jobs: | |
- name: Upload Artifact | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: jan-mac-x64-${{ steps.version_update.outputs.new_version }}.dmg | ||
name: jan-mac-x64-${{ steps.version_update.outputs.new_version }} | ||
path: ./electron/dist/jan-mac-x64-${{ steps.version_update.outputs.new_version }}.dmg | ||
|
||
- name: Upload Artifact | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: jan-mac-arm64-${{ steps.version_update.outputs.new_version }}.dmg | ||
name: jan-mac-arm64-${{ steps.version_update.outputs.new_version }} | ||
path: ./electron/dist/jan-mac-arm64-${{ steps.version_update.outputs.new_version }}.dmg | ||
|
||
build-windows-x64: | ||
|
@@ -124,7 +124,7 @@ jobs: | |
- name: Upload Artifact | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: jan-win-x64-${{ steps.version_update.outputs.new_version }}.exe | ||
name: jan-win-x64-${{ steps.version_update.outputs.new_version }} | ||
path: ./electron/dist/*.exe | ||
|
||
build-linux-x64: | ||
|
@@ -170,11 +170,12 @@ jobs: | |
- name: Upload Artifact | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: jan-linux-amd64-${{ steps.version_update.outputs.new_version }}.deb | ||
name: jan-linux-amd64-${{ steps.version_update.outputs.new_version }} | ||
path: ./electron/dist/*.deb | ||
|
||
noti-discord-nightly: | ||
needs: [build-macos, build-windows-x64, build-linux-x64] | ||
environment: production | ||
if: github.event_name == 'schedule' | ||
runs-on: ubuntu-latest | ||
steps: | ||
|
@@ -185,8 +186,20 @@ jobs: | |
env: | ||
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }} | ||
|
||
- name: Update README.md with artifact URL | ||
run: | | ||
sed -i "s|<a href='https://github.com/janhq/jan/actions/runs/.*'>|<a href='https://github.com/janhq/jan/actions/runs/${GITHUB_RUN_ID}'>|" README.md | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "Service Account" | ||
git add README.md | ||
git commit -m "${GITHUB_REPOSITORY}: Update README.md with nightly build artifact URL" | ||
git -c http.extraheader="AUTHORIZATION: bearer ${{ secrets.PAT_SERVICE_ACCOUNT }}" push origin HEAD:main | ||
env: | ||
GITHUB_RUN_ID: ${{ github.run_id }} | ||
|
||
noti-discord-manual: | ||
needs: [build-macos, build-windows-x64, build-linux-x64] | ||
environment: production | ||
if: github.event_name == 'workflow_dispatch' | ||
runs-on: ubuntu-latest | ||
steps: | ||
|
@@ -196,3 +209,16 @@ jobs: | |
args: "Manual build artifact: 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://github.com/janhq/jan/actions/runs/.*'>|<a href='https://github.com/janhq/jan/actions/runs/${GITHUB_RUN_ID}'>|" README.md | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "Service Account" | ||
git add README.md | ||
git commit -m "${GITHUB_REPOSITORY}: Update README.md with nightly build artifact URL" | ||
git -c http.extraheader="AUTHORIZATION: bearer ${{ secrets.PAT_SERVICE_ACCOUNT }}" push origin HEAD:main | ||
env: | ||
GITHUB_RUN_ID: ${{ github.run_id }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
name: Update Download URLs | ||
|
||
on: | ||
release: | ||
types: | ||
- published | ||
|
||
workflow_dispatch: | ||
|
||
jobs: | ||
update-readme: | ||
runs-on: ubuntu-latest | ||
environment: production | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Get Latest Release | ||
uses: pozetroninc/[email protected] | ||
id: get-latest-release | ||
|
||
- 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 }}") | ||
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 | ||
run: | | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "Service Account" | ||
git add README.md | ||
git commit -m "Update README.md with Stable Download URLs" | ||
git -c http.extraheader="AUTHORIZATION: bearer ${{ secrets.PAT_SERVICE_ACCOUNT }}" push origin HEAD:main |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.