Skip to content

Commit

Permalink
- improve: desktop cicd (#233)
Browse files Browse the repository at this point in the history
* - improve: changed pp dev name

* - improve: add slack message

* - fix: folder name

* - improve: slack message

* - fix: removed job summary
  • Loading branch information
agallardol authored May 10, 2024
1 parent eb4b54f commit e3709b7
Show file tree
Hide file tree
Showing 2 changed files with 65 additions and 23 deletions.
85 changes: 62 additions & 23 deletions .github/workflows/release-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 }}
Expand All @@ -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 }}
Expand All @@ -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
Expand Down Expand Up @@ -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/[email protected]
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
Expand Down
3 changes: 3 additions & 0 deletions apps/shinkai-desktop/src-tauri/tauri.conf.development.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{
"package": {
"productName": "Shinkai Desktop Dev"
},
"tauri": {
"updater": {
"endpoints": [
Expand Down

0 comments on commit e3709b7

Please sign in to comment.