From d07251d40de2654b9438fba0f3c4e1757e0bb7d8 Mon Sep 17 00:00:00 2001 From: Hien To Date: Thu, 12 Sep 2024 13:54:28 +0700 Subject: [PATCH] Add noti discord for nightly channel --- .github/workflows/beta-build.yml | 8 ++--- .github/workflows/cortex-cpp-quality-gate.yml | 2 +- .github/workflows/nightly-build.yml | 30 ++++++++++++---- .github/workflows/stable-build.yml | 8 ++--- .../workflows/template-build-linux-x64.yml | 8 ++--- .github/workflows/template-build-macos.yml | 12 +++---- .../workflows/template-build-windows-x64.yml | 8 ++--- .github/workflows/template-noti-discord.yaml | 36 +++++++++++++++++++ engine/Makefile | 13 ++++--- 9 files changed, 89 insertions(+), 36 deletions(-) create mode 100644 .github/workflows/template-noti-discord.yaml diff --git a/.github/workflows/beta-build.yml b/.github/workflows/beta-build.yml index 6c880c1fd..010ca31b2 100644 --- a/.github/workflows/beta-build.yml +++ b/.github/workflows/beta-build.yml @@ -42,7 +42,7 @@ jobs: public_provider: github new_version: ${{ needs.get-update-version.outputs.new_version }} runs-on: macos-12 - cmake-flags: "-DCORTEX_VARIANT=beta -DCORTEX_CPP_VERSION=${{ needs.get-update-version.outputs.new_version }} -DCMAKE_TOOLCHAIN_FILE=/Users/runner/work/cortex.cpp/cortex.cpp/engine/vcpkg/scripts/buildsystems/vcpkg.cmake" + cmake-flags: "-DCORTEX_VARIANT=beta -DCORTEX_CPP_VERSION='v${{ needs.get-update-version.outputs.new_version }}' -DCMAKE_TOOLCHAIN_FILE=/Users/runner/work/cortex.cpp/cortex.cpp/engine/vcpkg/scripts/buildsystems/vcpkg.cmake" channel: beta arch: amd64 upload_url: ${{ needs.create-draft-release.outputs.upload_url }} @@ -56,7 +56,7 @@ jobs: public_provider: github new_version: ${{ needs.get-update-version.outputs.new_version }} runs-on: macos-latest - cmake-flags: "-DCORTEX_VARIANT=beta -DCORTEX_CPP_VERSION=${{ needs.get-update-version.outputs.new_version }} -DMAC_ARM64=ON -DCMAKE_TOOLCHAIN_FILE=/Users/runner/work/cortex.cpp/cortex.cpp/engine/vcpkg/scripts/buildsystems/vcpkg.cmake" + cmake-flags: "-DCORTEX_VARIANT=beta -DCORTEX_CPP_VERSION='v${{ needs.get-update-version.outputs.new_version }}' -DMAC_ARM64=ON -DCMAKE_TOOLCHAIN_FILE=/Users/runner/work/cortex.cpp/cortex.cpp/engine/vcpkg/scripts/buildsystems/vcpkg.cmake" channel: beta arch: arm64 upload_url: ${{ needs.create-draft-release.outputs.upload_url }} @@ -70,7 +70,7 @@ jobs: public_provider: github new_version: ${{ needs.get-update-version.outputs.new_version }} runs-on: windows-cuda-11-7 - cmake-flags: "-DCORTEX_VARIANT=beta -DCORTEX_CPP_VERSION=${{ needs.get-update-version.outputs.new_version }} -DBUILD_SHARED_LIBS=OFF -DCMAKE_TOOLCHAIN_FILE=C:/w/cortex.cpp/cortex.cpp/engine/vcpkg/scripts/buildsystems/vcpkg.cmake -DVCPKG_TARGET_TRIPLET=x64-windows-static -DCMAKE_BUILD_TYPE=RELEASE -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CUDA_COMPILER_LAUNCHER=ccache -GNinja" + cmake-flags: "-DCORTEX_VARIANT=beta -DCORTEX_CPP_VERSION='v${{ needs.get-update-version.outputs.new_version }}' -DBUILD_SHARED_LIBS=OFF -DCMAKE_TOOLCHAIN_FILE=C:/w/cortex.cpp/cortex.cpp/engine/vcpkg/scripts/buildsystems/vcpkg.cmake -DVCPKG_TARGET_TRIPLET=x64-windows-static -DCMAKE_BUILD_TYPE=RELEASE -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CUDA_COMPILER_LAUNCHER=ccache -GNinja" build-deps-cmake-flags: "-DCMAKE_BUILD_TYPE=RELEASE -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CUDA_COMPILER_LAUNCHER=ccache -GNinja" ccache-dir: 'C:\Users\ContainerAdministrator\AppData\Local\ccache' channel: beta @@ -85,7 +85,7 @@ jobs: public_provider: github new_version: ${{ needs.get-update-version.outputs.new_version }} runs-on: ubuntu-20-04 - cmake-flags: "-DCORTEX_VARIANT=beta -DCORTEX_CPP_VERSION=${{ needs.get-update-version.outputs.new_version }} -DCMAKE_TOOLCHAIN_FILE=/home/runner/actions-runner/_work/cortex.cpp/cortex.cpp/engine/vcpkg/scripts/buildsystems/vcpkg.cmake" + cmake-flags: "-DCORTEX_VARIANT=beta -DCORTEX_CPP_VERSION='v${{ needs.get-update-version.outputs.new_version }}' -DCMAKE_TOOLCHAIN_FILE=/home/runner/actions-runner/_work/cortex.cpp/cortex.cpp/engine/vcpkg/scripts/buildsystems/vcpkg.cmake" channel: beta upload_url: ${{ needs.create-draft-release.outputs.upload_url }} diff --git a/.github/workflows/cortex-cpp-quality-gate.yml b/.github/workflows/cortex-cpp-quality-gate.yml index b1b3a770c..e2233c036 100644 --- a/.github/workflows/cortex-cpp-quality-gate.yml +++ b/.github/workflows/cortex-cpp-quality-gate.yml @@ -82,7 +82,7 @@ jobs: - name: Pre-package run: | cd engine - make pre-package + make pre-package DESTINATION_BINARY_NAME="cortex" - name: Package run: | diff --git a/.github/workflows/nightly-build.yml b/.github/workflows/nightly-build.yml index a242c699f..9d2912bdc 100644 --- a/.github/workflows/nightly-build.yml +++ b/.github/workflows/nightly-build.yml @@ -52,7 +52,7 @@ jobs: public_provider: ${{ needs.set-public-provider.outputs.public_provider }} new_version: ${{ needs.get-update-version.outputs.new_version }} runs-on: macos-12 - cmake-flags: "-DCORTEX_VARIANT=nightly -DCORTEX_CPP_VERSION=${{ needs.get-update-version.outputs.new_version }} -DCMAKE_TOOLCHAIN_FILE=/Users/runner/work/cortex.cpp/cortex.cpp/engine/vcpkg/scripts/buildsystems/vcpkg.cmake" + cmake-flags: "-DCORTEX_VARIANT=nightly -DCORTEX_CPP_VERSION='v${{ needs.get-update-version.outputs.new_version }}' -DCMAKE_TOOLCHAIN_FILE=/Users/runner/work/cortex.cpp/cortex.cpp/engine/vcpkg/scripts/buildsystems/vcpkg.cmake" channel: nightly arch: amd64 @@ -65,7 +65,7 @@ jobs: public_provider: ${{ needs.set-public-provider.outputs.public_provider }} new_version: ${{ needs.get-update-version.outputs.new_version }} runs-on: macos-latest - cmake-flags: "-DCORTEX_VARIANT=nightly -DCORTEX_CPP_VERSION=${{ needs.get-update-version.outputs.new_version }} -DMAC_ARM64=ON -DCMAKE_TOOLCHAIN_FILE=/Users/runner/work/cortex.cpp/cortex.cpp/engine/vcpkg/scripts/buildsystems/vcpkg.cmake" + cmake-flags: "-DCORTEX_VARIANT=nightly -DCORTEX_CPP_VERSION='v${{ needs.get-update-version.outputs.new_version }}' -DMAC_ARM64=ON -DCMAKE_TOOLCHAIN_FILE=/Users/runner/work/cortex.cpp/cortex.cpp/engine/vcpkg/scripts/buildsystems/vcpkg.cmake" channel: nightly arch: arm64 @@ -78,7 +78,7 @@ jobs: public_provider: ${{ needs.set-public-provider.outputs.public_provider }} new_version: ${{ needs.get-update-version.outputs.new_version }} runs-on: windows-cuda-11-7 - cmake-flags: "-DCORTEX_VARIANT=nightly -DCORTEX_CPP_VERSION=${{ needs.get-update-version.outputs.new_version }} -DBUILD_SHARED_LIBS=OFF -DCMAKE_TOOLCHAIN_FILE=C:/w/cortex.cpp/cortex.cpp/engine/vcpkg/scripts/buildsystems/vcpkg.cmake -DVCPKG_TARGET_TRIPLET=x64-windows-static -DCMAKE_BUILD_TYPE=RELEASE -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CUDA_COMPILER_LAUNCHER=ccache -GNinja" + cmake-flags: "-DCORTEX_VARIANT=nightly -DCORTEX_CPP_VERSION='v${{ needs.get-update-version.outputs.new_version }}' -DBUILD_SHARED_LIBS=OFF -DCMAKE_TOOLCHAIN_FILE=C:/w/cortex.cpp/cortex.cpp/engine/vcpkg/scripts/buildsystems/vcpkg.cmake -DVCPKG_TARGET_TRIPLET=x64-windows-static -DCMAKE_BUILD_TYPE=RELEASE -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CUDA_COMPILER_LAUNCHER=ccache -GNinja" build-deps-cmake-flags: "-DCMAKE_BUILD_TYPE=RELEASE -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CUDA_COMPILER_LAUNCHER=ccache -GNinja" ccache-dir: 'C:\Users\ContainerAdministrator\AppData\Local\ccache' channel: nightly @@ -92,7 +92,7 @@ jobs: public_provider: ${{ needs.set-public-provider.outputs.public_provider }} new_version: ${{ needs.get-update-version.outputs.new_version }} runs-on: ubuntu-20-04 - cmake-flags: "-DCORTEX_VARIANT=nightly -DCORTEX_CPP_VERSION=${{ needs.get-update-version.outputs.new_version }} -DCMAKE_TOOLCHAIN_FILE=/home/runner/actions-runner/_work/cortex.cpp/cortex.cpp/engine/vcpkg/scripts/buildsystems/vcpkg.cmake" + cmake-flags: "-DCORTEX_VARIANT=nightly -DCORTEX_CPP_VERSION='v${{ needs.get-update-version.outputs.new_version }}' -DCMAKE_TOOLCHAIN_FILE=/home/runner/actions-runner/_work/cortex.cpp/cortex.cpp/engine/vcpkg/scripts/buildsystems/vcpkg.cmake" channel: nightly update-latest-version: @@ -102,10 +102,28 @@ jobs: - name: Update latest version id: update-latest-version run: | - echo "{\"tag_name\": \"${{ needs.get-update-version.outputs.new_version }}\"}" > version.json + echo "{\"tag_name\": \"v${{ needs.get-update-version.outputs.new_version }}\"}" > version.json aws s3 cp version.json s3://${{ secrets.DELTA_AWS_S3_BUCKET_NAME }}/cortex/latest/version.json env: AWS_ACCESS_KEY_ID: ${{ secrets.DELTA_AWS_ACCESS_KEY_ID }} AWS_SECRET_ACCESS_KEY: ${{ secrets.DELTA_AWS_SECRET_ACCESS_KEY }} AWS_DEFAULT_REGION: ${{ secrets.DELTA_AWS_REGION }} - AWS_EC2_METADATA_DISABLED: "true" \ No newline at end of file + AWS_EC2_METADATA_DISABLED: "true" + + noti-discord-nightly-and-update-url-readme: + needs: [build-macos-x64, build-macos-arm64, build-windows-x64, build-linux-x64, get-update-version, set-public-provider] + secrets: inherit + if: github.event_name == 'schedule' + uses: ./.github/workflows/template-noti-discord.yaml + with: + build_reason: Nightly + new_version: ${{ needs.get-update-version.outputs.new_version }} + + noti-discord-manual: + needs: [build-macos-x64, build-macos-arm64, build-windows-x64, build-linux-x64, get-update-version, set-public-provider] + secrets: inherit + if: github.event_name == 'workflow_dispatch' && github.event.inputs.public_provider == 'aws-s3' + uses: ./.github/workflows/template-noti-discord.yaml + with: + build_reason: Manual + new_version: ${{ needs.get-update-version.outputs.new_version }} \ No newline at end of file diff --git a/.github/workflows/stable-build.yml b/.github/workflows/stable-build.yml index c80388f96..42bed1dd6 100644 --- a/.github/workflows/stable-build.yml +++ b/.github/workflows/stable-build.yml @@ -42,7 +42,7 @@ jobs: public_provider: github new_version: ${{ needs.get-update-version.outputs.new_version }} runs-on: macos-12 - cmake-flags: "-DCORTEX_VARIANT=prod -DCORTEX_CPP_VERSION=${{ needs.get-update-version.outputs.new_version }} -DCMAKE_TOOLCHAIN_FILE=/Users/runner/work/cortex.cpp/cortex.cpp/engine/vcpkg/scripts/buildsystems/vcpkg.cmake" + cmake-flags: "-DCORTEX_VARIANT=prod -DCORTEX_CPP_VERSION='v${{ needs.get-update-version.outputs.new_version }}' -DCMAKE_TOOLCHAIN_FILE=/Users/runner/work/cortex.cpp/cortex.cpp/engine/vcpkg/scripts/buildsystems/vcpkg.cmake" channel: stable arch: amd64 upload_url: ${{ needs.create-draft-release.outputs.upload_url }} @@ -56,7 +56,7 @@ jobs: public_provider: github new_version: ${{ needs.get-update-version.outputs.new_version }} runs-on: macos-latest - cmake-flags: "-DCORTEX_VARIANT=prod -DCORTEX_CPP_VERSION=${{ needs.get-update-version.outputs.new_version }} -DMAC_ARM64=ON -DCMAKE_TOOLCHAIN_FILE=/Users/runner/work/cortex.cpp/cortex.cpp/engine/vcpkg/scripts/buildsystems/vcpkg.cmake" + cmake-flags: "-DCORTEX_VARIANT=prod -DCORTEX_CPP_VERSION='v${{ needs.get-update-version.outputs.new_version }}' -DMAC_ARM64=ON -DCMAKE_TOOLCHAIN_FILE=/Users/runner/work/cortex.cpp/cortex.cpp/engine/vcpkg/scripts/buildsystems/vcpkg.cmake" channel: stable arch: arm64 upload_url: ${{ needs.create-draft-release.outputs.upload_url }} @@ -70,7 +70,7 @@ jobs: public_provider: github new_version: ${{ needs.get-update-version.outputs.new_version }} runs-on: windows-cuda-11-7 - cmake-flags: "-DCORTEX_VARIANT=prod -DCORTEX_CPP_VERSION=${{ needs.get-update-version.outputs.new_version }} -DBUILD_SHARED_LIBS=OFF -DCMAKE_TOOLCHAIN_FILE=C:/w/cortex.cpp/cortex.cpp/engine/vcpkg/scripts/buildsystems/vcpkg.cmake -DVCPKG_TARGET_TRIPLET=x64-windows-static -DCMAKE_BUILD_TYPE=RELEASE -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CUDA_COMPILER_LAUNCHER=ccache -GNinja" + cmake-flags: "-DCORTEX_VARIANT=prod -DCORTEX_CPP_VERSION='v${{ needs.get-update-version.outputs.new_version }}' -DBUILD_SHARED_LIBS=OFF -DCMAKE_TOOLCHAIN_FILE=C:/w/cortex.cpp/cortex.cpp/engine/vcpkg/scripts/buildsystems/vcpkg.cmake -DVCPKG_TARGET_TRIPLET=x64-windows-static -DCMAKE_BUILD_TYPE=RELEASE -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CUDA_COMPILER_LAUNCHER=ccache -GNinja" build-deps-cmake-flags: "-DCMAKE_BUILD_TYPE=RELEASE -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CUDA_COMPILER_LAUNCHER=ccache -GNinja" ccache-dir: 'C:\Users\ContainerAdministrator\AppData\Local\ccache' channel: stable @@ -85,7 +85,7 @@ jobs: public_provider: github new_version: ${{ needs.get-update-version.outputs.new_version }} runs-on: ubuntu-20-04 - cmake-flags: "-DCORTEX_VARIANT=prod -DCORTEX_CPP_VERSION=${{ needs.get-update-version.outputs.new_version }} -DCMAKE_TOOLCHAIN_FILE=/home/runner/actions-runner/_work/cortex.cpp/cortex.cpp/engine/vcpkg/scripts/buildsystems/vcpkg.cmake" + cmake-flags: "-DCORTEX_VARIANT=prod -DCORTEX_CPP_VERSION='v${{ needs.get-update-version.outputs.new_version }}' -DCMAKE_TOOLCHAIN_FILE=/home/runner/actions-runner/_work/cortex.cpp/cortex.cpp/engine/vcpkg/scripts/buildsystems/vcpkg.cmake" channel: stable upload_url: ${{ needs.create-draft-release.outputs.upload_url }} diff --git a/.github/workflows/template-build-linux-x64.yml b/.github/workflows/template-build-linux-x64.yml index fdb7801f4..cc826a5ca 100644 --- a/.github/workflows/template-build-linux-x64.yml +++ b/.github/workflows/template-build-linux-x64.yml @@ -126,13 +126,13 @@ jobs: - name: Pre-package run: | cd engine - make pre-package + make pre-package DESTINATION_BINARY_NAME="${{ steps.set-output-params.outputs.destination_binary_name }}" - name: Build Installers shell: bash run: | cd engine - make build-installer PACKAGE_NAME="${{ steps.set-output-params.outputs.package_name }}" VERSION=${{ inputs.new_version }} DESTINATION_BINARY_NAME="${{ steps.set-output-params.outputs.destination_binary_name }}" DATA_FOLDER_NAME="${{ steps.set-output-params.outputs.data_folder_name }}" CONFIGURATION_FILE_NAME="${{ steps.set-output-params.outputs.configuration_file_name }}" UNINSTALLER_FILE_NAME="${{ steps.set-output-params.outputs.uninstaller_file_name }}" + make build-installer PACKAGE_NAME="${{ steps.set-output-params.outputs.package_name }}" SOURCE_BINARY_PATH="../../cortex/${{ steps.set-output-params.outputs.destination_binary_name }}" VERSION=${{ inputs.new_version }} DESTINATION_BINARY_NAME="${{ steps.set-output-params.outputs.destination_binary_name }}" DATA_FOLDER_NAME="${{ steps.set-output-params.outputs.data_folder_name }}" CONFIGURATION_FILE_NAME="${{ steps.set-output-params.outputs.configuration_file_name }}" UNINSTALLER_FILE_NAME="${{ steps.set-output-params.outputs.uninstaller_file_name }}" - name: Package run: | @@ -156,8 +156,8 @@ jobs: run: | aws s3 cp ./engine/cortex.tar.gz s3://${{ secrets.DELTA_AWS_S3_BUCKET_NAME }}/cortex/latest/linux-amd64/cortex-nightly.tar.gz - aws s3 cp ./engine/cortex.tar.gz s3://${{ secrets.DELTA_AWS_S3_BUCKET_NAME }}/cortex/${{ inputs.new_version }}/linux-amd64/cortex-nightly-${{ inputs.new_version }}.tar.gz - aws s3 cp ./engine/${{ steps.set-output-params.outputs.package_name }}.deb s3://${{ secrets.DELTA_AWS_S3_BUCKET_NAME }}/cortex/${{ inputs.new_version }}/linux-amd64/cortex-linux-amd64-installer-${{ inputs.new_version }}.deb + aws s3 cp ./engine/cortex.tar.gz s3://${{ secrets.DELTA_AWS_S3_BUCKET_NAME }}/cortex/v${{ inputs.new_version }}/linux-amd64/cortex-nightly.tar.gz + aws s3 cp ./engine/${{ steps.set-output-params.outputs.package_name }}.deb s3://${{ secrets.DELTA_AWS_S3_BUCKET_NAME }}/cortex/v${{ inputs.new_version }}/linux-amd64/cortex-linux-amd64-installer-${{ inputs.new_version }}.deb env: AWS_ACCESS_KEY_ID: ${{ secrets.DELTA_AWS_ACCESS_KEY_ID }} AWS_SECRET_ACCESS_KEY: ${{ secrets.DELTA_AWS_SECRET_ACCESS_KEY }} diff --git a/.github/workflows/template-build-macos.yml b/.github/workflows/template-build-macos.yml index 209a50f33..311736e42 100644 --- a/.github/workflows/template-build-macos.yml +++ b/.github/workflows/template-build-macos.yml @@ -151,19 +151,19 @@ jobs: - name: Pre-package run: | cd engine - make pre-package + make pre-package DESTINATION_BINARY_NAME="${{ steps.set-output-params.outputs.destination_binary_name }}" - name: Code Signing binaries run: | cd engine - make codesign-binary CODE_SIGN=true DEVELOPER_ID="${{ secrets.DEVELOPER_ID }}" + make codesign-binary CODE_SIGN=true DEVELOPER_ID="${{ secrets.DEVELOPER_ID }}" DESTINATION_BINARY_NAME="${{ steps.set-output-params.outputs.destination_binary_name }}" - name: Notary macOS Binary run: | curl -sSfL https://raw.githubusercontent.com/anchore/quill/main/install.sh | sh -s -- -b /usr/local/bin cd engine/cortex # Notarize the binary - quill notarize ./cortex + quill notarize ./${{ steps.set-output-params.outputs.destination_binary_name }} env: QUILL_NOTARY_KEY_ID: ${{ secrets.NOTARY_KEY_ID }} QUILL_NOTARY_ISSUER: ${{ secrets.NOTARY_ISSUER }} @@ -173,7 +173,7 @@ jobs: shell: bash run: | cd engine - make build-installer PACKAGE_NAME="${{ steps.set-output-params.outputs.package_name }}" VERSION=${{ inputs.new_version }} DESTINATION_BINARY_NAME="${{ steps.set-output-params.outputs.destination_binary_name }}" DATA_FOLDER_NAME="${{ steps.set-output-params.outputs.data_folder_name }}" CONFIGURATION_FILE_NAME="${{ steps.set-output-params.outputs.configuration_file_name }}" UNINSTALLER_FILE_NAME="${{ steps.set-output-params.outputs.uninstaller_file_name }}" + make build-installer PACKAGE_NAME="${{ steps.set-output-params.outputs.package_name }}" VERSION=${{ inputs.new_version }} SOURCE_BINARY_PATH="../../cortex/${{ steps.set-output-params.outputs.destination_binary_name }}" DESTINATION_BINARY_NAME="${{ steps.set-output-params.outputs.destination_binary_name }}" DATA_FOLDER_NAME="${{ steps.set-output-params.outputs.data_folder_name }}" CONFIGURATION_FILE_NAME="${{ steps.set-output-params.outputs.configuration_file_name }}" UNINSTALLER_FILE_NAME="${{ steps.set-output-params.outputs.uninstaller_file_name }}" - name: Codesign and notary for macos installer run: | @@ -205,8 +205,8 @@ jobs: run: | aws s3 cp ./engine/cortex.tar.gz s3://${{ secrets.DELTA_AWS_S3_BUCKET_NAME }}/cortex/latest/mac-${{ inputs.arch}}/cortex-nightly.tar.gz - aws s3 cp ./engine/cortex.tar.gz s3://${{ secrets.DELTA_AWS_S3_BUCKET_NAME }}/cortex/${{ inputs.new_version }}/mac-${{ inputs.arch}}/cortex-nightly-${{ inputs.new_version }}.tar.gz - aws s3 cp ./engine/${{ steps.set-output-params.outputs.package_name }}.pkg s3://${{ secrets.DELTA_AWS_S3_BUCKET_NAME }}/cortex/${{ inputs.new_version }}/mac-${{ inputs.arch}}/cortex-mac-${{ inputs.arch}}-installer-${{ inputs.new_version }}.pkg + aws s3 cp ./engine/cortex.tar.gz s3://${{ secrets.DELTA_AWS_S3_BUCKET_NAME }}/cortex/v${{ inputs.new_version }}/mac-${{ inputs.arch}}/cortex-nightly.tar.gz + aws s3 cp ./engine/${{ steps.set-output-params.outputs.package_name }}.pkg s3://${{ secrets.DELTA_AWS_S3_BUCKET_NAME }}/cortex/v${{ inputs.new_version }}/mac-${{ inputs.arch}}/cortex-mac-${{ inputs.arch}}-installer-${{ inputs.new_version }}.pkg env: AWS_ACCESS_KEY_ID: ${{ secrets.DELTA_AWS_ACCESS_KEY_ID }} AWS_SECRET_ACCESS_KEY: ${{ secrets.DELTA_AWS_SECRET_ACCESS_KEY }} diff --git a/.github/workflows/template-build-windows-x64.yml b/.github/workflows/template-build-windows-x64.yml index 93fcf053f..e0136036b 100644 --- a/.github/workflows/template-build-windows-x64.yml +++ b/.github/workflows/template-build-windows-x64.yml @@ -159,12 +159,12 @@ jobs: - name: Pre-package run: | cd engine - make pre-package + make pre-package DESTINATION_BINARY_NAME="${{ steps.set-output-params.outputs.destination_binary_name }}" - name: Code Signing binaries run: | cd engine - make codesign-binary AZURE_KEY_VAULT_URI="${{ secrets.AZURE_KEY_VAULT_URI }}" AZURE_CLIENT_ID="${{ secrets.AZURE_CLIENT_ID }}" AZURE_TENANT_ID="${{ secrets.AZURE_TENANT_ID }}" AZURE_CLIENT_SECRET="${{ secrets.AZURE_CLIENT_SECRET }}" AZURE_CERT_NAME="${{ secrets.AZURE_CERT_NAME }}" + make codesign-binary DESTINATION_BINARY_NAME="${{ steps.set-output-params.outputs.destination_binary_name }}" AZURE_KEY_VAULT_URI="${{ secrets.AZURE_KEY_VAULT_URI }}" AZURE_CLIENT_ID="${{ secrets.AZURE_CLIENT_ID }}" AZURE_TENANT_ID="${{ secrets.AZURE_TENANT_ID }}" AZURE_CLIENT_SECRET="${{ secrets.AZURE_CLIENT_SECRET }}" AZURE_CERT_NAME="${{ secrets.AZURE_CERT_NAME }}" - name: Update version in installer.iss using sed shell: bash @@ -220,8 +220,8 @@ jobs: refreshenv aws s3 cp ./engine/cortex.tar.gz s3://${{ secrets.DELTA_AWS_S3_BUCKET_NAME }}/cortex/latest/windows-amd64/cortex-nightly.tar.gz - aws s3 cp ./engine/cortex.tar.gz s3://${{ secrets.DELTA_AWS_S3_BUCKET_NAME }}/cortex/${{ inputs.new_version }}/windows-amd64/cortex-nightly-${{ inputs.new_version }}.tar.gz - aws s3 cp ./setup.exe s3://${{ secrets.DELTA_AWS_S3_BUCKET_NAME }}/cortex/${{ inputs.new_version }}/windows-amd64/cortex-${{ inputs.new_version }}-windows-amd64-installer.exe + aws s3 cp ./engine/cortex.tar.gz s3://${{ secrets.DELTA_AWS_S3_BUCKET_NAME }}/cortex/v${{ inputs.new_version }}/windows-amd64/cortex-nightly.tar.gz + aws s3 cp ./setup.exe s3://${{ secrets.DELTA_AWS_S3_BUCKET_NAME }}/cortex/v${{ inputs.new_version }}/windows-amd64/cortex-${{ inputs.new_version }}-windows-amd64-installer.exe env: AWS_ACCESS_KEY_ID: ${{ secrets.DELTA_AWS_ACCESS_KEY_ID }} AWS_SECRET_ACCESS_KEY: ${{ secrets.DELTA_AWS_SECRET_ACCESS_KEY }} diff --git a/.github/workflows/template-noti-discord.yaml b/.github/workflows/template-noti-discord.yaml new file mode 100644 index 000000000..d91d153f6 --- /dev/null +++ b/.github/workflows/template-noti-discord.yaml @@ -0,0 +1,36 @@ +name: noti-discord +on: + workflow_call: + inputs: + build_reason: + required: true + type: string + default: 'Nightly' + new_version: + required: true + type: string + default: '' + +jobs: + noti-discord: + environment: production + runs-on: ubuntu-latest + permissions: + contents: write + steps: + - name: Set version to environment variable + run: | + echo "VERSION=${{ inputs.new_version }}" >> $GITHUB_ENV + + - name: Notify Discord + uses: Ilshidur/action-discord@master + with: + args: | + Cortex.cpp ${{ inputs.build_reason }} build artifact version {{ VERSION }}: + - Windows: https://delta.jan.ai/cortex/v{{ VERSION }}/windows-amd64/cortex-{{ VERSION }}-windows-amd64-installer.exe + - macOS Intel: https://delta.jan.ai/cortex/v{{ VERSION }}/mac-amd64/cortex-{{ VERSION }}-mac-amd64-installer.pkg + - macOS Apple Silicon: https://delta.jan.ai/cortex/v{{ VERSION }}/mac-arm64/cortex-{{ VERSION }}-mac-amd64-installer.pkg + - Linux Deb: https://delta.jan.ai/cortex/v{{ VERSION }}/linux-amd64/cortex-{{ VERSION }}-linux-amd64-installer.deb + - Github action run: https://github.com/janhq/cortex.cpp/actions/runs/{{ GITHUB_RUN_ID }} + env: + DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }} \ No newline at end of file diff --git a/engine/Makefile b/engine/Makefile index 9f72f8355..5bc84d120 100644 --- a/engine/Makefile +++ b/engine/Makefile @@ -56,16 +56,16 @@ endif pre-package: ifeq ($(OS),Windows_NT) @powershell -Command "mkdir -p cortex;" - @powershell -Command "cp build\cortex.exe .\cortex\;" + @powershell -Command "cp build\cortex.exe .\cortex\$(DESTINATION_BINARY_NAME).exe;" @powershell -Command "cp ..\.github\patches\windows\msvcp140.dll .\cortex\;" @powershell -Command "cp ..\.github\patches\windows\vcruntime140_1.dll .\cortex\;" @powershell -Command "cp ..\.github\patches\windows\vcruntime140.dll .\cortex\;" else ifeq ($(shell uname -s),Linux) @mkdir -p cortex; \ - cp build/cortex cortex/; + cp build/cortex cortex/$(DESTINATION_BINARY_NAME); else @mkdir -p cortex; \ - cp build/cortex cortex/; + cp build/cortex cortex/$(DESTINATION_BINARY_NAME); endif codesign-binary: @@ -76,12 +76,12 @@ endif ifeq ($(OS),Windows_NT) @powershell -Command "dotnet tool install --global AzureSignTool;" - @powershell -Command '~\.dotnet\tools\azuresigntool.exe sign -kvu "$(AZURE_KEY_VAULT_URI)" -kvi "$(AZURE_CLIENT_ID)" -kvt "$(AZURE_TENANT_ID)" -kvs "$(AZURE_CLIENT_SECRET)" -kvc "$(AZURE_CERT_NAME)" -tr http://timestamp.globalsign.com/tsa/r6advanced1 -v ".\cortex\cortex.exe";' + @powershell -Command '~\.dotnet\tools\azuresigntool.exe sign -kvu "$(AZURE_KEY_VAULT_URI)" -kvi "$(AZURE_CLIENT_ID)" -kvt "$(AZURE_TENANT_ID)" -kvs "$(AZURE_CLIENT_SECRET)" -kvc "$(AZURE_CERT_NAME)" -tr http://timestamp.globalsign.com/tsa/r6advanced1 -v ".\cortex\$(DESTINATION_BINARY_NAME).exe";' else ifeq ($(shell uname -s),Linux) @echo "Skipping Code Sign for linux" @exit 0 else - codesign --force -s "$(DEVELOPER_ID)" --options=runtime --entitlements="./templates/macos/entitlements.plist" ./cortex/cortex; + codesign --force -s "$(DEVELOPER_ID)" --options=runtime --entitlements="./templates/macos/entitlements.plist" ./cortex/$(DESTINATION_BINARY_NAME); endif package: @@ -96,8 +96,7 @@ endif build-installer: ifeq ($(OS),Windows_NT) @echo "Building installer for Windows"; \ - cp cortex/* ../; \ - mv ../cortex.exe ../$(DESTINATION_BINARY_NAME).exe; + cp cortex/* ../; else ifeq ($(shell uname -s),Linux) @echo "Building installer for linux"; \ cd templates/linux; \