From e3709b72c878b35b8897e1f7347b8dc9bb7d4989 Mon Sep 17 00:00:00 2001 From: Alfredo Gallardo Date: Fri, 10 May 2024 13:05:51 -0400 Subject: [PATCH] - improve: desktop cicd (#233) * - improve: changed pp dev name * - improve: add slack message * - fix: folder name * - improve: slack message * - fix: removed job summary --- .github/workflows/release-dev.yml | 85 ++++++++++++++----- .../src-tauri/tauri.conf.development.json | 3 + 2 files changed, 65 insertions(+), 23 deletions(-) diff --git a/.github/workflows/release-dev.yml b/.github/workflows/release-dev.yml index 84d7c1770..9d0640459 100644 --- a/.github/workflows/release-dev.yml +++ b/.github/workflows/release-dev.yml @@ -86,40 +86,43 @@ jobs: include: - arch: x86_64-unknown-linux-gnu os: ubuntu-22.04 - build_output_file_path: apps/shinkai-desktop/src-tauri/target/release/bundle/appimage/shinkai-desktop_${{ needs.prebuild.outputs.version }}${{ github.run_number }}_amd64.AppImage - build_output_update_file_path: apps/shinkai-desktop/src-tauri/target/release/bundle/appimage/shinkai-desktop_${{ needs.prebuild.outputs.version }}${{ github.run_number }}_amd64.AppImage.tar.gz - build_output_update_signature_file_path: apps/shinkai-desktop/src-tauri/target/release/bundle/appimage/shinkai-desktop_${{ needs.prebuild.outputs.version }}${{ github.run_number }}_amd64.AppImage.tar.gz.sig - distributable_file_name: Shinkai-Desktop-${{ needs.prebuild.outputs.version }}.${{ github.run_number }}_x86_64-unknown-linux-gnu.AppImage - distributable_update_file_name: Shinkai-Desktop-${{ needs.prebuild.outputs.version }}.${{ github.run_number }}_x86_64-unknown-linux-gnu.AppImage.tar.gz - distributable_update_signature_file_name: Shinkai-Desktop-${{ needs.prebuild.outputs.version }}.${{ github.run_number }}_x86_64-unknown-linux-gnu.AppImage.tar.gz.sig + build_output_file_path: apps/shinkai-desktop/src-tauri/target/debug/bundle/appimage/shinkai-desktop-dev_${{ needs.prebuild.outputs.version }}${{ github.run_number }}_amd64.AppImage + build_output_update_file_path: apps/shinkai-desktop/src-tauri/target/debug/bundle/appimage/shinkai-desktop-dev_${{ needs.prebuild.outputs.version }}${{ github.run_number }}_amd64.AppImage.tar.gz + build_output_update_signature_file_path: apps/shinkai-desktop/src-tauri/target/debug/bundle/appimage/shinkai-desktop-dev_${{ needs.prebuild.outputs.version }}${{ github.run_number }}_amd64.AppImage.tar.gz.sig + distributable_file_name: Shinkai-Desktop-Dev-${{ needs.prebuild.outputs.version }}.${{ github.run_number }}_x86_64-unknown-linux-gnu.AppImage + distributable_update_file_name: Shinkai-Desktop-Dev-${{ needs.prebuild.outputs.version }}.${{ github.run_number }}_x86_64-unknown-linux-gnu.AppImage.tar.gz + distributable_update_signature_file_name: Shinkai-Desktop-Dev-${{ needs.prebuild.outputs.version }}.${{ github.run_number }}_x86_64-unknown-linux-gnu.AppImage.tar.gz.sig - arch: aarch64-apple-darwin os: macos-14 - build_output_file_path: apps/shinkai-desktop/src-tauri/target/release/bundle/dmg/Shinkai Desktop_${{ needs.prebuild.outputs.version }}${{ github.run_number }}_aarch64.dmg - build_output_update_file_path: apps/shinkai-desktop/src-tauri/target/release/bundle/macos/Shinkai Desktop.app.tar.gz - build_output_update_signature_file_path: apps/shinkai-desktop/src-tauri/target/release/bundle/macos/Shinkai Desktop.app.tar.gz.sig - distributable_file_name: Shinkai-Desktop-${{ needs.prebuild.outputs.version }}.${{ github.run_number }}_aarch64-apple-darwin.dmg - distributable_update_file_name: Shinkai-Desktop-${{ needs.prebuild.outputs.version }}.${{ github.run_number }}_aarch64-apple-darwin.app.tar.gz - distributable_update_signature_file_name: Shinkai-Desktop-${{ needs.prebuild.outputs.version }}.${{ github.run_number }}_aarch64-apple-darwin.app.tar.gz.sig + build_output_file_path: apps/shinkai-desktop/src-tauri/target/debug/bundle/dmg/Shinkai Desktop Dev_${{ needs.prebuild.outputs.version }}${{ github.run_number }}_aarch64.dmg + build_output_update_file_path: apps/shinkai-desktop/src-tauri/target/debug/bundle/macos/Shinkai Desktop Dev.app.tar.gz + build_output_update_signature_file_path: apps/shinkai-desktop/src-tauri/target/debug/bundle/macos/Shinkai Desktop Dev.app.tar.gz.sig + distributable_file_name: Shinkai-Desktop-Dev-${{ needs.prebuild.outputs.version }}.${{ github.run_number }}_aarch64-apple-darwin.dmg + distributable_update_file_name: Shinkai-Desktop-Dev-${{ needs.prebuild.outputs.version }}.${{ github.run_number }}_aarch64-apple-darwin.app.tar.gz + distributable_update_signature_file_name: Shinkai-Desktop-Dev-${{ needs.prebuild.outputs.version }}.${{ github.run_number }}_aarch64-apple-darwin.app.tar.gz.sig - arch: x86_64-pc-windows-msvc os: windows-2022 - build_output_file_path: apps/shinkai-desktop/src-tauri/target/release/bundle/nsis/Shinkai Desktop_${{ needs.prebuild.outputs.version }}${{ github.run_number }}_x64-setup.exe - build_output_update_file_path: apps/shinkai-desktop/src-tauri/target/release/bundle/nsis/Shinkai Desktop_${{ needs.prebuild.outputs.version }}${{ github.run_number }}_x64-setup.nsis.zip - build_output_update_signature_file_path: apps/shinkai-desktop/src-tauri/target/release/bundle/nsis/Shinkai Desktop_${{ needs.prebuild.outputs.version }}${{ github.run_number }}_x64-setup.nsis.zip.sig - distributable_file_name: Shinkai-Desktop-${{ needs.prebuild.outputs.version }}.${{ github.run_number }}_x86_64-pc-windows-msvc.exe - distributable_update_file_name: Shinkai-Desktop-${{ needs.prebuild.outputs.version }}.${{ github.run_number }}_x86_64-pc-windows-msvc.nsis.zip - distributable_update_signature_file_name: Shinkai-Desktop-${{ needs.prebuild.outputs.version }}.${{ github.run_number }}_x86_64-pc-windows-msvc.nsis.zip.sig + build_output_file_path: apps/shinkai-desktop/src-tauri/target/debug/bundle/nsis/Shinkai Desktop Dev_${{ needs.prebuild.outputs.version }}${{ github.run_number }}_x64-setup.exe + build_output_update_file_path: apps/shinkai-desktop/src-tauri/target/debug/bundle/nsis/Shinkai Desktop Dev_${{ needs.prebuild.outputs.version }}${{ github.run_number }}_x64-setup.nsis.zip + build_output_update_signature_file_path: apps/shinkai-desktop/src-tauri/target/debug/bundle/nsis/Shinkai Desktop Dev_${{ needs.prebuild.outputs.version }}${{ github.run_number }}_x64-setup.nsis.zip.sig + distributable_file_name: Shinkai-Desktop-Dev-${{ needs.prebuild.outputs.version }}.${{ github.run_number }}_x86_64-pc-windows-msvc.exe + distributable_update_file_name: Shinkai-Desktop-Dev-${{ needs.prebuild.outputs.version }}.${{ github.run_number }}_x86_64-pc-windows-msvc.nsis.zip + distributable_update_signature_file_name: Shinkai-Desktop-Dev-${{ needs.prebuild.outputs.version }}.${{ github.run_number }}_x86_64-pc-windows-msvc.nsis.zip.sig runs-on: ${{ matrix.os }} environment: development outputs: signature-x86_64-unknown-linux-gnu: ${{ steps.prepare-files.outputs.signature-x86_64-unknown-linux-gnu }} update-url-x86_64-unknown-linux-gnu: ${{ steps.prepare-files.outputs.update-url-x86_64-unknown-linux-gnu }} + app-url-x86_64-unknown-linux-gnu: ${{ steps.prepare-files.outputs.app-url-x86_64-unknown-linux-gnu }} signature-aarch64-apple-darwin: ${{ steps.prepare-files.outputs.signature-aarch64-apple-darwin }} update-url-aarch64-apple-darwin: ${{ steps.prepare-files.outputs.update-url-aarch64-apple-darwin }} + app-url-aarch64-apple-darwin: ${{ steps.prepare-files.outputs.app-url-aarch64-apple-darwin }} signature-x86_64-pc-windows-msvc: ${{ steps.prepare-files.outputs.signature-x86_64-pc-windows-msvc }} update-url-x86_64-pc-windows-msvc: ${{ steps.prepare-files.outputs.update-url-x86_64-pc-windows-msvc }} + app-url-x86_64-pc-windows-msvc: ${{ steps.prepare-files.outputs.app-url-x86_64-pc-windows-msvc }} steps: - name: Check out repository uses: actions/checkout@v4 @@ -199,14 +202,14 @@ jobs: - name: (Linux) Run NX build on shinkai-desktop if: ${{ matrix.arch == 'x86_64-unknown-linux-gnu' }} - run: npx nx build shinkai-desktop --config="./src-tauri/tauri.conf.development.json" --skip-nx-cache + run: npx nx build shinkai-desktop --config="./src-tauri/tauri.conf.development.json" --skip-nx-cache --debug env: TAURI_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }} TAURI_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }} - name: (Macos) Run NX build on shinkai-desktop if: ${{ matrix.arch == 'aarch64-apple-darwin' }} - run: npx nx build shinkai-desktop --config="./src-tauri/tauri.conf.development.json" --skip-nx-cache + run: npx nx build shinkai-desktop --config="./src-tauri/tauri.conf.development.json" --skip-nx-cache --debug env: APPLE_SIGNING_IDENTITY: ${{ secrets.APPLE_SIGNING_IDENTITY }} APPLE_CERTIFICATE: ${{ secrets.APPLE_CERTIFICATE }} @@ -219,7 +222,7 @@ jobs: - name: (Windows) Run NX build on shinkai-desktop if: ${{ matrix.arch == 'x86_64-pc-windows-msvc' }} - run: npx nx build shinkai-desktop --config="./src-tauri/tauri.conf.development.json" --skip-nx-cache + run: npx nx build shinkai-desktop --config="./src-tauri/tauri.conf.development.json" --skip-nx-cache --debug env: TAURI_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }} TAURI_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }} @@ -236,7 +239,8 @@ jobs: cp "${{ matrix.build_output_update_file_path }}" files-to-r2/${{ matrix.distributable_update_file_name }} cp "${{ matrix.build_output_update_signature_file_path }}" files-to-r2/${{ matrix.distributable_update_signature_file_name }} echo "signature-${{ matrix.arch }}=$(cat files-to-r2/${{ matrix.distributable_update_signature_file_name }})" >> "$GITHUB_OUTPUT" - echo "update-url-${{ matrix.arch }}=https://download.shinkai.com/shinkai-desktop/binaries/development/${{ matrix.arch }}/${{ needs.prebuild.outputs.version }}.${{ github.run_number }}/${{ matrix.distributable_update_file_name }}" >> "$GITHUB_OUTPUT" + echo "update-url-${{ matrix.arch }}=https://download.shinkai.com/shinkai-desktop/binaries/development/${{ matrix.arch }}/${{ needs.prebuild.outputs.version }}.${{ github.run_number }}/${{ matrix.distributable_file_name }}" >> "$GITHUB_OUTPUT" + echo "app-url-${{ matrix.arch }}=https://download.shinkai.com/shinkai-desktop/binaries/development/${{ matrix.arch }}/${{ needs.prebuild.outputs.version }}.${{ github.run_number }}/${{ matrix.distributable_update_file_name }}" >> "$GITHUB_OUTPUT" - name: Upload binaries to R2 bucket uses: shallwefootball/s3-upload-action@master @@ -300,7 +304,42 @@ jobs: aws_bucket: shinkai-download source_dir: files-to-r2 destination_dir: ./shinkai-desktop/binaries/development/ - + + notify-slack: + environment: development + needs: + - prebuild + - release-shinkai-desktop + name: Notify Slack + runs-on: ubuntu-22.04 + steps: + - name: Post Shinkai Desktop to a Slack channel + id: slack + uses: slackapi/slack-github-action@v1.26.0 + with: + channel-id: 'C072VJ6E7GC' + payload: | + { + "text": "🚀 New release", + "blocks": [ + { + "type": "section", + "text": { + "type": "mrkdwn", + "text": "*Shinkai Desktop Dev v${{ needs.prebuild.outputs.version }}.${{ github.run_number }}*" + } + }, + { + "type": "section", + "text": { + "type": "mrkdwn", + "text": "Download it from:\n* <${{ needs.release-shinkai-desktop.outputs.app-url-aarch64-apple-darwin }}|Macos>\n* <${{ needs.release-shinkai-desktop.outputs.app-url-x86_64-pc-windows-msvc }}|Windows>\n* <${{ needs.release-shinkai-desktop.outputs.app-url-x86_64-unknown-linux-gnu }}|Linux>" + } + } + ] + } + env: + SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} # At the moment we are not releasing android (CI was working) # release-shinkai-app-android: # runs-on: ubuntu-latest diff --git a/apps/shinkai-desktop/src-tauri/tauri.conf.development.json b/apps/shinkai-desktop/src-tauri/tauri.conf.development.json index ce962a757..74a8894d8 100644 --- a/apps/shinkai-desktop/src-tauri/tauri.conf.development.json +++ b/apps/shinkai-desktop/src-tauri/tauri.conf.development.json @@ -1,4 +1,7 @@ { + "package": { + "productName": "Shinkai Desktop Dev" + }, "tauri": { "updater": { "endpoints": [