Skip to content

Commit

Permalink
chore: beta version add discord notification (#1605)
Browse files Browse the repository at this point in the history
Co-authored-by: Hien To <[email protected]>
  • Loading branch information
hiento09 and hientominh authored Nov 1, 2024
1 parent f5fbad6 commit f37ad6b
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 43 deletions.
60 changes: 41 additions & 19 deletions .github/workflows/beta-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ jobs:
name: "${{ env.VERSION }}"
draft: true
prerelease: false
generate_release_notes: true

build-macos:
uses: ./.github/workflows/template-build-macos.yml
Expand Down Expand Up @@ -79,26 +80,47 @@ jobs:
upload_url: ${{ needs.create-draft-release.outputs.upload_url }}
cortex-llamacpp-version: ${{ needs.get-cortex-llamacpp-latest-version.outputs.cortex_llamacpp_latest_version }}

update_release_draft:
needs: [build-macos, build-windows-x64, build-linux-x64]
update_release:
needs: [get-update-version, create-draft-release, build-macos, build-windows-x64, build-linux-x64]
permissions:
# write permission is required to create a github release
contents: write
# write permission is required for autolabeler
# otherwise, read permission is required at least
pull-requests: write
runs-on: ubuntu-latest
steps:
- name: set release to prerelease
run: |
gh release edit v${{ needs.get-update-version.outputs.new_version }} --draft=false --prerelease
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
noti-discord:
needs: [get-update-version, create-draft-release, build-macos, build-windows-x64, build-linux-x64, update_release]
runs-on: ubuntu-latest
permissions:
# write permission is required to create a github release
contents: write
# write permission is required for autolabeler
# otherwise, read permission is required at least
pull-requests: write
runs-on: ubuntu-latest
steps:
# (Optional) GitHub Enterprise requires GHE_HOST variable set
#- name: Set GHE_HOST
# run: |
# echo "GHE_HOST=${GITHUB_SERVER_URL##https:\/\/}" >> $GITHUB_ENV
- name: Set version to environment variable
run: |
echo "VERSION=${{ needs.get-update-version.outputs.new_version }}" >> $GITHUB_ENV
echo "RUNNER_ID=$GITHUB_RUN_ID" >> $GITHUB_ENV
# Drafts your next Release notes as Pull Requests are merged into "master"
- uses: release-drafter/release-drafter@v5
# (Optional) specify config name to use, relative to .github/. Default: release-drafter.yml
# with:
# config-name: my-config.yml
# disable-autolabeler: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Notify Discord
uses: appleboy/[email protected]
with:
webhook_id: ${{ secrets.WEBHOOK_ID_BETA }}
webhook_token: ${{ secrets.WEBHOOK_TOKEN_BETA }}
message: |
Cortex.cpp beta build artifact version ${{ env.VERSION }}:
- Windows:
- Network Installer: https://github.com/janhq/cortex.cpp/releases/download/v${{ env.VERSION }}/cortex-${{ env.VERSION }}-windows-amd64-network-installer.exe
- Local Installer: https://github.com/janhq/cortex.cpp/releases/download/v${{ env.VERSION }}/cortex-${{ env.VERSION }}-windows-amd64-local-installer.exe
- macOS Universal:
- Network Installer: https://github.com/janhq/cortex.cpp/releases/download/v${{ env.VERSION }}/cortex-${{ env.VERSION }}-mac-universal-network-installer.pkg
- Local Installer: https://github.com/janhq/cortex.cpp/releases/download/v${{ env.VERSION }}/cortex-${{ env.VERSION }}-mac-universal-local-installer.pkg
- Linux Deb:
- Network Installer: https://github.com/janhq/cortex.cpp/releases/download/v${{ env.VERSION }}/cortex-${{ env.VERSION }}-linux-amd64-network-installer.deb
- Local Installer: https://github.com/janhq/cortex.cpp/releases/download/v${{ env.VERSION }}/cortex-${{ env.VERSION }}-linux-amd64-local-installer.deb
- Github Release: https://github.com/janhq/cortex.cpp/releases/tag/v${{ env.VERSION }}
25 changes: 1 addition & 24 deletions .github/workflows/stable-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ jobs:
name: "${{ env.VERSION }}"
draft: true
prerelease: false
generate_release_notes: true

build-macos:
uses: ./.github/workflows/template-build-macos.yml
Expand Down Expand Up @@ -78,27 +79,3 @@ jobs:
channel: stable
upload_url: ${{ needs.create-draft-release.outputs.upload_url }}
cortex-llamacpp-version: ${{ needs.get-cortex-llamacpp-latest-version.outputs.cortex_llamacpp_latest_version }}

update_release_draft:
needs: [build-macos, build-windows-x64, build-linux-x64]
permissions:
# write permission is required to create a github release
contents: write
# write permission is required for autolabeler
# otherwise, read permission is required at least
pull-requests: write
runs-on: ubuntu-latest
steps:
# (Optional) GitHub Enterprise requires GHE_HOST variable set
#- name: Set GHE_HOST
# run: |
# echo "GHE_HOST=${GITHUB_SERVER_URL##https:\/\/}" >> $GITHUB_ENV

# Drafts your next Release notes as Pull Requests are merged into "master"
- uses: release-drafter/release-drafter@v5
# (Optional) specify config name to use, relative to .github/. Default: release-drafter.yml
# with:
# config-name: my-config.yml
# disable-autolabeler: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit f37ad6b

Please sign in to comment.