From f37ad6b437c879f7d0bf02d01b2c03b632536ea8 Mon Sep 17 00:00:00 2001 From: hiento09 <136591877+hiento09@users.noreply.github.com> Date: Fri, 1 Nov 2024 12:39:58 +0700 Subject: [PATCH] chore: beta version add discord notification (#1605) Co-authored-by: Hien To --- .github/workflows/beta-build.yml | 60 ++++++++++++++++++++---------- .github/workflows/stable-build.yml | 25 +------------ 2 files changed, 42 insertions(+), 43 deletions(-) diff --git a/.github/workflows/beta-build.yml b/.github/workflows/beta-build.yml index 4dd0d8716..1c9e49790 100644 --- a/.github/workflows/beta-build.yml +++ b/.github/workflows/beta-build.yml @@ -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 @@ -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 }} \ No newline at end of file + - name: Notify Discord + uses: appleboy/discord-action@v1.0.0 + 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 }} \ No newline at end of file diff --git a/.github/workflows/stable-build.yml b/.github/workflows/stable-build.yml index 8caea8a3e..2ffece895 100644 --- a/.github/workflows/stable-build.yml +++ b/.github/workflows/stable-build.yml @@ -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 @@ -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 }} \ No newline at end of file