From 3790bd5753d356aa745544e957aabda3951b3ecf Mon Sep 17 00:00:00 2001 From: Minh141120 Date: Thu, 10 Jul 2025 15:01:52 +0700 Subject: [PATCH] refactor: clean up tauri build workflow for linux --- .../template-tauri-build-linux-x64.yml | 65 +------------------ src-tauri/tauri.linux.conf.json | 9 +-- 2 files changed, 5 insertions(+), 69 deletions(-) diff --git a/.github/workflows/template-tauri-build-linux-x64.yml b/.github/workflows/template-tauri-build-linux-x64.yml index b07faa0bc..e2ce4d841 100644 --- a/.github/workflows/template-tauri-build-linux-x64.yml +++ b/.github/workflows/template-tauri-build-linux-x64.yml @@ -39,8 +39,6 @@ on: required: false TAURI_SIGNING_PRIVATE_KEY_PASSWORD: required: false - TAURI_SIGNING_PUBLIC_KEY: - required: false outputs: DEB_SIG: value: ${{ jobs.build-linux-x64.outputs.DEB_SIG }} @@ -154,14 +152,12 @@ jobs: "$APP_IMAGE" env: - RELEASE_CHANNEL: "${{ inputs.channel }}" + RELEASE_CHANNEL: '${{ inputs.channel }}' GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} POSTHOG_KEY: ${{ secrets.POSTHOG_KEY }} POSTHOG_HOST: ${{ secrets.POSTHOG_HOST }} - # CORTEX_API_PORT: ${{ inputs.cortex_api_port }} TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }} TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }} - TAURI_SIGNING_PUBLIC_KEY: ${{ secrets.TAURI_SIGNING_PUBLIC_KEY }} # Publish app @@ -180,8 +176,8 @@ jobs: name: jan-linux-amd64-${{ inputs.new_version }}-AppImage path: ./src-tauri/target/release/bundle/appimage/*.AppImage - ## create zip file and latest-linux.yml for linux electron auto updater - - name: Create zip file and latest-linux.yml for linux electron auto updater + ## Set output filename for linux + - name: Set output filename for linux id: packageinfo run: | cd ./src-tauri/target/release/bundle @@ -198,35 +194,6 @@ jobs: APPIMAGE_SIG=$(cat appimage/Jan_${{ inputs.new_version }}_amd64.AppImage.sig) fi - DEB_FILE_SIZE=$(stat -c%s deb/$DEB_FILE_NAME) - APPIMAGE_FILE_SIZE=$(stat -c%s appimage/$APPIMAGE_FILE_NAME) - echo "deb file size: $DEB_FILE_SIZE" - echo "appimage file size: $APPIMAGE_FILE_SIZE" - - DEB_SH512_CHECKSUM=$(python3 ../../../../.github/scripts/electron-checksum.py deb/$DEB_FILE_NAME) - APPIMAGE_SH512_CHECKSUM=$(python3 ../../../../.github/scripts/electron-checksum.py appimage/$APPIMAGE_FILE_NAME) - echo "deb sh512 checksum: $DEB_SH512_CHECKSUM" - echo "appimage sh512 checksum: $APPIMAGE_SH512_CHECKSUM" - - CURRENT_TIME=$(date -u +"%Y-%m-%dT%H:%M:%S.%3NZ") - echo "releaseDate: $CURRENT_TIME" - - # Create latest-linux.yml file - echo "version: ${{ inputs.new_version }}" > latest-linux.yml - echo "files:" >> latest-linux.yml - echo " - url: $DEB_FILE_NAME" >> latest-linux.yml - echo " sha512: $DEB_SH512_CHECKSUM" >> latest-linux.yml - echo " size: $DEB_FILE_SIZE" >> latest-linux.yml - echo " - url: $APPIMAGE_FILE_NAME" >> latest-linux.yml - echo " sha512: $APPIMAGE_SH512_CHECKSUM" >> latest-linux.yml - echo " size: $APPIMAGE_FILE_SIZE" >> latest-linux.yml - echo "path: $APPIMAGE_FILE_NAME" >> latest-linux.yml - echo "sha512: $APPIMAGE_SH512_CHECKSUM" >> latest-linux.yml - echo "releaseDate: $CURRENT_TIME" >> latest-linux.yml - - cat latest-linux.yml - cp latest-linux.yml beta-linux.yml - echo "DEB_SIG=$DEB_SIG" >> $GITHUB_OUTPUT echo "APPIMAGE_SIG=$APPIMAGE_SIG" >> $GITHUB_OUTPUT echo "DEB_FILE_NAME=$DEB_FILE_NAME" >> $GITHUB_OUTPUT @@ -238,10 +205,6 @@ jobs: run: | cd ./src-tauri/target/release/bundle - # Upload for electron updater for nightly - aws s3 cp ./latest-linux.yml s3://${{ secrets.DELTA_AWS_S3_BUCKET_NAME }}/temp-${{ inputs.channel }}/latest-linux.yml - aws s3 cp ./beta-linux.yml s3://${{ secrets.DELTA_AWS_S3_BUCKET_NAME }}/temp-${{ inputs.channel }}/beta-linux.yml - # Upload for tauri updater aws s3 cp ./appimage/Jan-${{ inputs.channel }}_${{ inputs.new_version }}_amd64.AppImage s3://${{ secrets.DELTA_AWS_S3_BUCKET_NAME }}/temp-${{ inputs.channel }}/Jan-${{ inputs.channel }}_${{ inputs.new_version }}_amd64.AppImage aws s3 cp ./deb/Jan-${{ inputs.channel }}_${{ inputs.new_version }}_amd64.deb s3://${{ secrets.DELTA_AWS_S3_BUCKET_NAME }}/temp-${{ inputs.channel }}/Jan-${{ inputs.channel }}_${{ inputs.new_version }}_amd64.deb @@ -253,28 +216,6 @@ jobs: AWS_DEFAULT_REGION: ${{ secrets.DELTA_AWS_REGION }} AWS_EC2_METADATA_DISABLED: 'true' - ## Upload to github release for stable release - - name: Upload release assert if public provider is github - if: inputs.channel == 'stable' - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - uses: actions/upload-release-asset@v1.0.1 - with: - upload_url: ${{ inputs.upload_url }} - asset_path: ./src-tauri/target/release/bundle/latest-linux.yml - asset_name: latest-linux.yml - asset_content_type: text/yaml - - - name: Upload release assert if public provider is github - if: inputs.channel == 'beta' - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - uses: actions/upload-release-asset@v1.0.1 - with: - upload_url: ${{ inputs.upload_url }} - asset_path: ./src-tauri/target/release/bundle/beta-linux.yml - asset_name: beta-linux.yml - asset_content_type: text/yaml - name: Upload release assert if public provider is github if: inputs.public_provider == 'github' env: diff --git a/src-tauri/tauri.linux.conf.json b/src-tauri/tauri.linux.conf.json index 4174cd770..e34ab965e 100644 --- a/src-tauri/tauri.linux.conf.json +++ b/src-tauri/tauri.linux.conf.json @@ -1,13 +1,8 @@ { "bundle": { "targets": ["deb", "appimage"], - "resources": [ - "resources/pre-install/**/*" - ], - "externalBin": [ - "binaries/cortex-server", - "resources/bin/uv" - ], + "resources": ["resources/pre-install/**/*"], + "externalBin": ["binaries/cortex-server", "resources/bin/uv"], "linux": { "appimage": { "bundleMediaFramework": false,