From 93b5c3d6af00f1ac60420d3389ff2aef5b685f96 Mon Sep 17 00:00:00 2001 From: neil Date: Tue, 27 Dec 2022 07:08:29 +0800 Subject: [PATCH 01/25] #18 m1 test --- .github/workflows/ci.yml | 85 +++++++++++++++++++++++----------------- 1 file changed, 48 insertions(+), 37 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 799a00f..00acaed 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -119,7 +119,18 @@ jobs: strategy: fail-fast: false matrix: - platform: [macos-latest, ubuntu-latest] + platform: + - os: macos-11 + name: darwin+x86-64 + - os: ubuntu-latest + name: linux+x86-64 + container: + image: debian:buster-slim + options: --memory=24g + - os: [self-hosted, macOS, ARM64] + name: darwin+aarch64 + - os: [self-hosted, linux, ARM64] + name: linux+aarch64 runs-on: ${{ matrix.platform }} steps: @@ -171,43 +182,43 @@ jobs: aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} aws-region: us-east-1 - - name: mac-os cp package images from prod to preview bucket - if: matrix.platform == 'macos-latest' - env: - prefix: ${{ needs.changes.outputs.preview_folder }} - run: | - aws s3 cp ./modules/gui/src-tauri/target/release/bundle/dmg/tea_0.1.0_x64.dmg \ - "s3://preview.gui.tea.xyz/$prefix/gui.dmg" + # - name: mac-os cp package images from prod to preview bucket + # if: matrix.platform == 'macos-latest' + # env: + # prefix: ${{ needs.changes.outputs.preview_folder }} + # run: | + # aws s3 cp ./modules/gui/src-tauri/target/release/bundle/dmg/tea_0.1.0_x64.dmg \ + # "s3://preview.gui.tea.xyz/$prefix/gui.dmg" - - name: ubuntu cp package images from prod to preview bucket - if: matrix.platform == 'ubuntu-latest' - env: - prefix: ${{ needs.changes.outputs.preview_folder }} - run: | - aws s3 cp ./modules/gui/src-tauri/target/release/bundle/deb/tea_0.1.0_amd64.deb \ - "s3://preview.gui.tea.xyz/$prefix/gui.deb" + # - name: ubuntu cp package images from prod to preview bucket + # if: matrix.platform == 'ubuntu-latest' + # env: + # prefix: ${{ needs.changes.outputs.preview_folder }} + # run: | + # aws s3 cp ./modules/gui/src-tauri/target/release/bundle/deb/tea_0.1.0_amd64.deb \ + # "s3://preview.gui.tea.xyz/$prefix/gui.deb" - - name: comment install ubuntu - uses: mshick/add-pr-comment@v2 - if: matrix.platform == 'ubuntu-latest' - with: - message-id: ${{ matrix.platform }}-comment-${{steps.prefix.outputs.prefix}} - message: | - **installer for ${{ matrix.platform }} is at**: [here](http://preview.gui.tea.xyz.s3-website-us-east-1.amazonaws.com/${{steps.prefix.outputs.prefix}}/gui.deb) - ```bash - http://preview.gui.tea.xyz.s3-website-us-east-1.amazonaws.com/${{ needs.changes.outputs.preview_folder }}/gui.deb - ``` - copy-paste into a browser to download + # - name: comment install ubuntu + # uses: mshick/add-pr-comment@v2 + # if: matrix.platform == 'ubuntu-latest' + # with: + # message-id: ${{ matrix.platform }}-comment-${{steps.prefix.outputs.prefix}} + # message: | + # **installer for ${{ matrix.platform }} is at**: [here](http://preview.gui.tea.xyz.s3-website-us-east-1.amazonaws.com/${{steps.prefix.outputs.prefix}}/gui.deb) + # ```bash + # http://preview.gui.tea.xyz.s3-website-us-east-1.amazonaws.com/${{ needs.changes.outputs.preview_folder }}/gui.deb + # ``` + # copy-paste into a browser to download - - name: comment install mac-os - uses: mshick/add-pr-comment@v2 - if: matrix.platform == 'macos-latest' - with: - message-id: ${{ matrix.platform }}-comment-${{steps.prefix.outputs.prefix}} - message: | - **installer for ${{ matrix.platform }} is at**: [here](http://preview.gui.tea.xyz.s3-website-us-east-1.amazonaws.com/${{steps.prefix.outputs.prefix}}/gui.dmg) - ```bash - http://preview.gui.tea.xyz.s3-website-us-east-1.amazonaws.com/${{ needs.changes.outputs.preview_folder }}/gui.dmg - ``` - copy-paste into a browser to download \ No newline at end of file + # - name: comment install mac-os + # uses: mshick/add-pr-comment@v2 + # if: matrix.platform == 'macos-latest' + # with: + # message-id: ${{ matrix.platform }}-comment-${{steps.prefix.outputs.prefix}} + # message: | + # **installer for ${{ matrix.platform }} is at**: [here](http://preview.gui.tea.xyz.s3-website-us-east-1.amazonaws.com/${{steps.prefix.outputs.prefix}}/gui.dmg) + # ```bash + # http://preview.gui.tea.xyz.s3-website-us-east-1.amazonaws.com/${{ needs.changes.outputs.preview_folder }}/gui.dmg + # ``` + # copy-paste into a browser to download \ No newline at end of file From 73fd7008f45aa22ae0df041c91d5d78fbd6a2e04 Mon Sep 17 00:00:00 2001 From: neil Date: Tue, 27 Dec 2022 07:10:54 +0800 Subject: [PATCH 02/25] trigger build --- modules/gui/src-tauri/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/gui/src-tauri/Cargo.toml b/modules/gui/src-tauri/Cargo.toml index c3b3582..6576123 100644 --- a/modules/gui/src-tauri/Cargo.toml +++ b/modules/gui/src-tauri/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "app" version = "0.1.0" -description = "A tea.xyz desktop app " +description = "A tea.xyz desktop app" authors = ["you"] license = "" repository = "" From da08926c8edb0eff22e8d56cc012c79ee839c36c Mon Sep 17 00:00:00 2001 From: neil Date: Tue, 27 Dec 2022 07:14:35 +0800 Subject: [PATCH 03/25] trigger --- modules/gui/src/libs/stores.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/gui/src/libs/stores.ts b/modules/gui/src/libs/stores.ts index d8e2182..4a23a6b 100644 --- a/modules/gui/src/libs/stores.ts +++ b/modules/gui/src/libs/stores.ts @@ -3,7 +3,7 @@ import Fuse from 'fuse.js'; import type { Package, Review, AirtablePost } from '@tea/ui/types'; import type { GUIPackage } from '$libs/types'; -// TODO: figure out a better structure for managing states maybe turn them into models? +// TODO: figure out a better structure for managing states maybe turn them into separate files? import { getPackages, getFeaturedPackages, getPackageReviews, getAllPosts } from '@api'; From 9cf9ed9e53f48a754a699d8f5a69933609bd6519 Mon Sep 17 00:00:00 2001 From: neil Date: Tue, 27 Dec 2022 07:23:46 +0800 Subject: [PATCH 04/25] add container --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 00acaed..db79839 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -131,7 +131,7 @@ jobs: name: darwin+aarch64 - os: [self-hosted, linux, ARM64] name: linux+aarch64 - + container: ${{ matrix.platform.container }} runs-on: ${{ matrix.platform }} steps: - uses: actions/checkout@v2 From bdbc9860707349e51b1ef4462951ac1f8b45731b Mon Sep 17 00:00:00 2001 From: neil Date: Tue, 27 Dec 2022 07:40:51 +0800 Subject: [PATCH 05/25] test macos-11 only --- .github/workflows/ci.yml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index db79839..76fd0f4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -122,15 +122,15 @@ jobs: platform: - os: macos-11 name: darwin+x86-64 - - os: ubuntu-latest - name: linux+x86-64 - container: - image: debian:buster-slim - options: --memory=24g - - os: [self-hosted, macOS, ARM64] - name: darwin+aarch64 - - os: [self-hosted, linux, ARM64] - name: linux+aarch64 + # - os: ubuntu-latest + # name: linux+x86-64 + # container: + # image: debian:buster-slim + # options: --memory=24g + # - os: [self-hosted, macOS, ARM64] + # name: darwin+aarch64 + # - os: [self-hosted, linux, ARM64] + # name: linux+aarch64 container: ${{ matrix.platform.container }} runs-on: ${{ matrix.platform }} steps: From 93617d836de967929fa461874976f2cd2573bfe3 Mon Sep 17 00:00:00 2001 From: neil Date: Tue, 27 Dec 2022 07:45:38 +0800 Subject: [PATCH 06/25] fix --- .github/workflows/ci.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 76fd0f4..682b1bf 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -116,8 +116,8 @@ jobs: build_tauri: needs: changes if: needs.changes.outputs.tauri == 'true' + runs-on: ${{ matrix.platform.os }} strategy: - fail-fast: false matrix: platform: - os: macos-11 @@ -132,7 +132,6 @@ jobs: # - os: [self-hosted, linux, ARM64] # name: linux+aarch64 container: ${{ matrix.platform.container }} - runs-on: ${{ matrix.platform }} steps: - uses: actions/checkout@v2 From 3e994b116ea42ca974d141e2108815e106564c9b Mon Sep 17 00:00:00 2001 From: neil Date: Tue, 27 Dec 2022 07:48:51 +0800 Subject: [PATCH 07/25] fix prefix --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 682b1bf..53ea2a1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -157,7 +157,7 @@ jobs: with: # The prefix cache key, this can be changed to start a new cache manually. # default: "v0-rust" - prefix-key: ${{ matrix.platform }} + prefix-key: ${{ matrix.platform.os }} shared-key: ci cache-targets: false - name: install app dependencies From 708d84a658175bcdffaed72ae7c6fd7c26f69af7 Mon Sep 17 00:00:00 2001 From: neil Date: Tue, 27 Dec 2022 07:52:38 +0800 Subject: [PATCH 08/25] test m1 --- .github/workflows/ci.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 53ea2a1..a539d9a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -127,8 +127,8 @@ jobs: # container: # image: debian:buster-slim # options: --memory=24g - # - os: [self-hosted, macOS, ARM64] - # name: darwin+aarch64 + - os: [self-hosted, macOS, ARM64] + name: darwin+aarch64 # - os: [self-hosted, linux, ARM64] # name: linux+aarch64 container: ${{ matrix.platform.container }} @@ -180,6 +180,10 @@ jobs: aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} aws-region: us-east-1 + + - run: echo $name + env: + name: ${{matrix.platform.name}} # - name: mac-os cp package images from prod to preview bucket # if: matrix.platform == 'macos-latest' From 3e1aaab8f1998c06fc476aec616ea3bdded40328 Mon Sep 17 00:00:00 2001 From: neil Date: Tue, 27 Dec 2022 07:56:09 +0800 Subject: [PATCH 09/25] change platform cache keys --- .github/workflows/ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a539d9a..00b90cd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -157,7 +157,7 @@ jobs: with: # The prefix cache key, this can be changed to start a new cache manually. # default: "v0-rust" - prefix-key: ${{ matrix.platform.os }} + prefix-key: ${{ matrix.platform.name }} shared-key: ci cache-targets: false - name: install app dependencies @@ -168,9 +168,9 @@ jobs: with: path: | ./modules/gui/src-tauri/target - key: ${{ matrix.platform }}-build-target + key: ${{ matrix.platform.name }}-build-target restore-keys: | - ${{ matrix.platform }}-build-target + ${{ matrix.platform.name }}-build-target - name: test build tauri run: pnpm --filter gui tauri build From 24a6b88cb80525d8fe106840cf04dfe0040a99a5 Mon Sep 17 00:00:00 2001 From: neil Date: Tue, 27 Dec 2022 08:05:29 +0800 Subject: [PATCH 10/25] add linux builders --- .github/workflows/ci.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 00b90cd..2858217 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -122,15 +122,15 @@ jobs: platform: - os: macos-11 name: darwin+x86-64 - # - os: ubuntu-latest - # name: linux+x86-64 - # container: - # image: debian:buster-slim - # options: --memory=24g + - os: ubuntu-latest + name: linux+x86-64 + container: + image: debian:buster-slim + options: --memory=24g - os: [self-hosted, macOS, ARM64] name: darwin+aarch64 - # - os: [self-hosted, linux, ARM64] - # name: linux+aarch64 + - os: [self-hosted, linux, ARM64] + name: linux+aarch64 container: ${{ matrix.platform.container }} steps: - uses: actions/checkout@v2 From 23cb57f1619b3e3789eae57422cc9da18c2a2591 Mon Sep 17 00:00:00 2001 From: neil Date: Tue, 27 Dec 2022 08:12:18 +0800 Subject: [PATCH 11/25] install curl on linux --- .github/workflows/ci.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2858217..51118a8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -144,6 +144,9 @@ jobs: node-version: 16 cache: 'pnpm' cache-dependency-path: pnpm-lock.yaml + - name: install wget + if: matrix.platform.name == 'linux+x86-64' || matrix.platform.name == 'linux+aarch64' + run: apt install curl - name: install Rust stable uses: actions-rs/toolchain@v1 with: From 5ed3c21b651415a34cd47d4b97526c56f2bc62e7 Mon Sep 17 00:00:00 2001 From: neil Date: Tue, 27 Dec 2022 08:13:49 +0800 Subject: [PATCH 12/25] sudo --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 51118a8..f7e047b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -144,9 +144,9 @@ jobs: node-version: 16 cache: 'pnpm' cache-dependency-path: pnpm-lock.yaml - - name: install wget + - name: install curl if: matrix.platform.name == 'linux+x86-64' || matrix.platform.name == 'linux+aarch64' - run: apt install curl + run: sudo apt install curl - name: install Rust stable uses: actions-rs/toolchain@v1 with: From eb482872d2dcf6b838df51ba7499cbdc5fd42a78 Mon Sep 17 00:00:00 2001 From: neil Date: Tue, 27 Dec 2022 08:19:03 +0800 Subject: [PATCH 13/25] try non-slim debian:buster --- .github/workflows/ci.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f7e047b..f1d4a6a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -125,8 +125,7 @@ jobs: - os: ubuntu-latest name: linux+x86-64 container: - image: debian:buster-slim - options: --memory=24g + image: debian:buster - os: [self-hosted, macOS, ARM64] name: darwin+aarch64 - os: [self-hosted, linux, ARM64] @@ -144,9 +143,6 @@ jobs: node-version: 16 cache: 'pnpm' cache-dependency-path: pnpm-lock.yaml - - name: install curl - if: matrix.platform.name == 'linux+x86-64' || matrix.platform.name == 'linux+aarch64' - run: sudo apt install curl - name: install Rust stable uses: actions-rs/toolchain@v1 with: From 6f1663f2a9d4ac9fc05d2d86e79568d87df62db8 Mon Sep 17 00:00:00 2001 From: neil Date: Tue, 27 Dec 2022 08:21:49 +0800 Subject: [PATCH 14/25] install curl --- .github/workflows/ci.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f1d4a6a..bbd1ab5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -143,6 +143,9 @@ jobs: node-version: 16 cache: 'pnpm' cache-dependency-path: pnpm-lock.yaml + - name: install curl + if: matrix.platform.name == 'linux+x86-64' || matrix.platform.name == 'linux+aarch64' + run: apt update && apt install curl - name: install Rust stable uses: actions-rs/toolchain@v1 with: From 5c53b865a04b1ac198cbc0ffa3123516b5545400 Mon Sep 17 00:00:00 2001 From: neil Date: Tue, 27 Dec 2022 08:25:06 +0800 Subject: [PATCH 15/25] tmp compromise of x86 builder --- .github/workflows/ci.yml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bbd1ab5..76a0b8c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -124,8 +124,6 @@ jobs: name: darwin+x86-64 - os: ubuntu-latest name: linux+x86-64 - container: - image: debian:buster - os: [self-hosted, macOS, ARM64] name: darwin+aarch64 - os: [self-hosted, linux, ARM64] @@ -143,9 +141,6 @@ jobs: node-version: 16 cache: 'pnpm' cache-dependency-path: pnpm-lock.yaml - - name: install curl - if: matrix.platform.name == 'linux+x86-64' || matrix.platform.name == 'linux+aarch64' - run: apt update && apt install curl - name: install Rust stable uses: actions-rs/toolchain@v1 with: From 2f5f878b50a995165c51777098a6e1df5660be17 Mon Sep 17 00:00:00 2001 From: neil Date: Tue, 27 Dec 2022 08:35:27 +0800 Subject: [PATCH 16/25] tmp skil self-hosting linux --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 76a0b8c..e64831d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -126,8 +126,8 @@ jobs: name: linux+x86-64 - os: [self-hosted, macOS, ARM64] name: darwin+aarch64 - - os: [self-hosted, linux, ARM64] - name: linux+aarch64 + # - os: [self-hosted, linux, ARM64] + # name: linux+aarch64 container: ${{ matrix.platform.container }} steps: - uses: actions/checkout@v2 From f5f712f3884070a261226baaf1e331e841c8043d Mon Sep 17 00:00:00 2001 From: neil Date: Tue, 27 Dec 2022 08:43:26 +0800 Subject: [PATCH 17/25] comment installer in gui build channel macos only --- .github/workflows/ci.yml | 39 ++++++++++++++++++++------------------- 1 file changed, 20 insertions(+), 19 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e64831d..cad2fb6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -146,7 +146,7 @@ jobs: with: toolchain: stable - name: install dependencies (ubuntu only) - if: matrix.platform == 'ubuntu-latest' + if: matrix.platform.name == 'linux+x86-64' run: | sudo apt-get update sudo apt-get install -y libgtk-3-dev webkit2gtk-4.0 libappindicator3-dev librsvg2-dev patchelf @@ -182,13 +182,14 @@ jobs: env: name: ${{matrix.platform.name}} - # - name: mac-os cp package images from prod to preview bucket - # if: matrix.platform == 'macos-latest' - # env: - # prefix: ${{ needs.changes.outputs.preview_folder }} - # run: | - # aws s3 cp ./modules/gui/src-tauri/target/release/bundle/dmg/tea_0.1.0_x64.dmg \ - # "s3://preview.gui.tea.xyz/$prefix/gui.dmg" + - name: mac-os cp package images from prod to preview bucket + if: matrix.platform.name == 'darwin+x86-64' || matrix.platform.name == 'darwin+aarch64' + env: + prefix: ${{ needs.changes.outputs.preview_folder }} + platform: ${{ matrix.platform.name }} + run: | + aws s3 cp ./modules/gui/src-tauri/target/release/bundle/dmg/tea_0.1.0_x64.dmg \ + "s3://preview.gui.tea.xyz/$prefix/gui.$platform.dmg" # - name: ubuntu cp package images from prod to preview bucket # if: matrix.platform == 'ubuntu-latest' @@ -211,14 +212,14 @@ jobs: # copy-paste into a browser to download - # - name: comment install mac-os - # uses: mshick/add-pr-comment@v2 - # if: matrix.platform == 'macos-latest' - # with: - # message-id: ${{ matrix.platform }}-comment-${{steps.prefix.outputs.prefix}} - # message: | - # **installer for ${{ matrix.platform }} is at**: [here](http://preview.gui.tea.xyz.s3-website-us-east-1.amazonaws.com/${{steps.prefix.outputs.prefix}}/gui.dmg) - # ```bash - # http://preview.gui.tea.xyz.s3-website-us-east-1.amazonaws.com/${{ needs.changes.outputs.preview_folder }}/gui.dmg - # ``` - # copy-paste into a browser to download \ No newline at end of file + - name: comment install mac-os + uses: mshick/add-pr-comment@v2 + if: matrix.platform.name == 'darwin+x86-64' || matrix.platform.name == 'darwin+aarch64' + with: + message-id: ${{ matrix.platform.name }}-comment-${{steps.prefix.outputs.prefix}} + message: | + **installer for ${{ matrix.platform }} is at**: [here](http://preview.gui.tea.xyz.s3-website-us-east-1.amazonaws.com/${{steps.prefix.outputs.prefix}}/gui.dmg) + ```bash + http://preview.gui.tea.xyz.s3-website-us-east-1.amazonaws.com/${{ needs.changes.outputs.preview_folder }}/gui.${{ matrix.platform.name }}.dmg + ``` + copy-paste into a browser to download \ No newline at end of file From 51a1168306b4a9c9f00658bab209c8b0789f73db Mon Sep 17 00:00:00 2001 From: neil Date: Tue, 27 Dec 2022 09:50:07 +0800 Subject: [PATCH 18/25] add adjusted macos build platform --- .github/workflows/ci.yml | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cad2fb6..f936b24 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -149,7 +149,7 @@ jobs: if: matrix.platform.name == 'linux+x86-64' run: | sudo apt-get update - sudo apt-get install -y libgtk-3-dev webkit2gtk-4.0 libappindicator3-dev librsvg2-dev patchelf + sudo apt-get install -y libgtk-3-dev webkit2gtk-4.0 libappindicator3-dev librsvg2-dev patchelf pkg-config - uses: Swatinem/rust-cache@v2 with: # The prefix cache key, this can be changed to start a new cache manually. @@ -178,19 +178,22 @@ jobs: aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} aws-region: us-east-1 - - run: echo $name - env: - name: ${{matrix.platform.name}} + - name: build platform output + id: build_platform + run: | + BUILD_PLATFORM=$(echo $platform | sed -e "s/darwin+//g" | sed -e "s/linux+//g") + echo "build_platform=$BUILD_PLATFORM" >> $GITHUB_OUTPUT - name: mac-os cp package images from prod to preview bucket if: matrix.platform.name == 'darwin+x86-64' || matrix.platform.name == 'darwin+aarch64' env: prefix: ${{ needs.changes.outputs.preview_folder }} - platform: ${{ matrix.platform.name }} + platform: ${{ steps.build_platform.outputs.build_platform }} run: | - aws s3 cp ./modules/gui/src-tauri/target/release/bundle/dmg/tea_0.1.0_x64.dmg \ - "s3://preview.gui.tea.xyz/$prefix/gui.$platform.dmg" - + aws s3 cp "./modules/gui/src-tauri/target/release/bundle/dmg/tea_0.1.0_$platform.dmg" \ + "s3://preview.gui.tea.xyz/$prefix/gui_$platform.dmg" + + # - name: ubuntu cp package images from prod to preview bucket # if: matrix.platform == 'ubuntu-latest' # env: @@ -218,8 +221,8 @@ jobs: with: message-id: ${{ matrix.platform.name }}-comment-${{steps.prefix.outputs.prefix}} message: | - **installer for ${{ matrix.platform }} is at**: [here](http://preview.gui.tea.xyz.s3-website-us-east-1.amazonaws.com/${{steps.prefix.outputs.prefix}}/gui.dmg) + **installer for ${{ matrix.platform.name }} is at**: [here](http://preview.gui.tea.xyz.s3-website-us-east-1.amazonaws.com/${{steps.prefix.outputs.prefix}}/gui_${{steps.build_platform.outputs.build_platform}}.dmg) ```bash - http://preview.gui.tea.xyz.s3-website-us-east-1.amazonaws.com/${{ needs.changes.outputs.preview_folder }}/gui.${{ matrix.platform.name }}.dmg + http://preview.gui.tea.xyz.s3-website-us-east-1.amazonaws.com/${{ needs.changes.outputs.preview_folder }}/gui.${{ steps.build_platform.outputs.build_platform }}.dmg ``` copy-paste into a browser to download \ No newline at end of file From 5b339c571fe5c8e3793bbdc6a468254b3f6201d0 Mon Sep 17 00:00:00 2001 From: neil Date: Tue, 27 Dec 2022 09:56:39 +0800 Subject: [PATCH 19/25] fix platform name --- .github/workflows/ci.yml | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f936b24..2483bf4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -168,6 +168,14 @@ jobs: key: ${{ matrix.platform.name }}-build-target restore-keys: | ${{ matrix.platform.name }}-build-target + + - name: build platform output + id: build_platform + env: + platform: ${{ matrix.platform.name }} + run: | + BUILD_PLATFORM=$(echo $platform | sed -e "s/darwin+//g" | sed -e "s/linux+//g") + echo "build_platform=$BUILD_PLATFORM" >> $GITHUB_OUTPUT - name: test build tauri run: pnpm --filter gui tauri build @@ -177,12 +185,7 @@ jobs: aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} aws-region: us-east-1 - - - name: build platform output - id: build_platform - run: | - BUILD_PLATFORM=$(echo $platform | sed -e "s/darwin+//g" | sed -e "s/linux+//g") - echo "build_platform=$BUILD_PLATFORM" >> $GITHUB_OUTPUT + - name: mac-os cp package images from prod to preview bucket if: matrix.platform.name == 'darwin+x86-64' || matrix.platform.name == 'darwin+aarch64' From 5cbb52012cf8887386fb1f9764efe8573deb3391 Mon Sep 17 00:00:00 2001 From: neil Date: Tue, 27 Dec 2022 10:16:09 +0800 Subject: [PATCH 20/25] add proper build_platform postfix --- .github/workflows/ci.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2483bf4..7458dd8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -175,6 +175,7 @@ jobs: platform: ${{ matrix.platform.name }} run: | BUILD_PLATFORM=$(echo $platform | sed -e "s/darwin+//g" | sed -e "s/linux+//g") + [[ $BUILD_PLATFORM = "x86-64" ]] && BUILD_PLATFORM="x64" || BUILD_PLATFORM=$BUILD_PLATFORM echo "build_platform=$BUILD_PLATFORM" >> $GITHUB_OUTPUT - name: test build tauri @@ -226,6 +227,6 @@ jobs: message: | **installer for ${{ matrix.platform.name }} is at**: [here](http://preview.gui.tea.xyz.s3-website-us-east-1.amazonaws.com/${{steps.prefix.outputs.prefix}}/gui_${{steps.build_platform.outputs.build_platform}}.dmg) ```bash - http://preview.gui.tea.xyz.s3-website-us-east-1.amazonaws.com/${{ needs.changes.outputs.preview_folder }}/gui.${{ steps.build_platform.outputs.build_platform }}.dmg + http://preview.gui.tea.xyz.s3-website-us-east-1.amazonaws.com/${{ needs.changes.outputs.preview_folder }}/gui_${{ steps.build_platform.outputs.build_platform }}.dmg ``` copy-paste into a browser to download \ No newline at end of file From 3c84be8aec08e9faa232440fe3c765db67580a67 Mon Sep 17 00:00:00 2001 From: neil Date: Tue, 27 Dec 2022 10:30:21 +0800 Subject: [PATCH 21/25] fix: upload linux build to aws and comment in gh builds --- .github/workflows/ci.yml | 40 +++++++++++++++++++++------------------- 1 file changed, 21 insertions(+), 19 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7458dd8..8f6aa2f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -176,6 +176,7 @@ jobs: run: | BUILD_PLATFORM=$(echo $platform | sed -e "s/darwin+//g" | sed -e "s/linux+//g") [[ $BUILD_PLATFORM = "x86-64" ]] && BUILD_PLATFORM="x64" || BUILD_PLATFORM=$BUILD_PLATFORM + [[ $BUILD_PLATFORM = "linux+x86-64" ]] && BUILD_PLATFORM="amd64" || BUILD_PLATFORM=$BUILD_PLATFORM echo "build_platform=$BUILD_PLATFORM" >> $GITHUB_OUTPUT - name: test build tauri @@ -198,32 +199,33 @@ jobs: "s3://preview.gui.tea.xyz/$prefix/gui_$platform.dmg" - # - name: ubuntu cp package images from prod to preview bucket - # if: matrix.platform == 'ubuntu-latest' - # env: - # prefix: ${{ needs.changes.outputs.preview_folder }} - # run: | - # aws s3 cp ./modules/gui/src-tauri/target/release/bundle/deb/tea_0.1.0_amd64.deb \ - # "s3://preview.gui.tea.xyz/$prefix/gui.deb" + - name: ubuntu cp package images from prod to preview bucket + if: matrix.platform == 'ubuntu-latest' + env: + prefix: ${{ needs.changes.outputs.preview_folder }} + platform: ${{ steps.build_platform.outputs.build_platform }} + run: | + aws s3 cp "./modules/gui/src-tauri/target/release/bundle/deb/tea_0.1.0_$platform.deb" \ + "s3://preview.gui.tea.xyz/$prefix/gui_$platform.deb" - # - name: comment install ubuntu - # uses: mshick/add-pr-comment@v2 - # if: matrix.platform == 'ubuntu-latest' - # with: - # message-id: ${{ matrix.platform }}-comment-${{steps.prefix.outputs.prefix}} - # message: | - # **installer for ${{ matrix.platform }} is at**: [here](http://preview.gui.tea.xyz.s3-website-us-east-1.amazonaws.com/${{steps.prefix.outputs.prefix}}/gui.deb) - # ```bash - # http://preview.gui.tea.xyz.s3-website-us-east-1.amazonaws.com/${{ needs.changes.outputs.preview_folder }}/gui.deb - # ``` - # copy-paste into a browser to download + - name: comment install ubuntu + uses: mshick/add-pr-comment@v2 + if: matrix.platform == 'ubuntu-latest' + with: + message-id: ${{ matrix.platform.name }}-comment + message: | + **installer for ${{ matrix.platform.name }} is at**: [here](http://preview.gui.tea.xyz.s3-website-us-east-1.amazonaws.com/${{steps.prefix.outputs.prefix}}/gui_${{steps.build_platform.outputs.build_platform}}.deb) + ```bash + http://preview.gui.tea.xyz.s3-website-us-east-1.amazonaws.com/${{ needs.changes.outputs.preview_folder }}/gui_${{steps.build_platform.outputs.build_platform}}.deb + ``` + copy-paste into a browser to download - name: comment install mac-os uses: mshick/add-pr-comment@v2 if: matrix.platform.name == 'darwin+x86-64' || matrix.platform.name == 'darwin+aarch64' with: - message-id: ${{ matrix.platform.name }}-comment-${{steps.prefix.outputs.prefix}} + message-id: ${{ matrix.platform.name }}-comment message: | **installer for ${{ matrix.platform.name }} is at**: [here](http://preview.gui.tea.xyz.s3-website-us-east-1.amazonaws.com/${{steps.prefix.outputs.prefix}}/gui_${{steps.build_platform.outputs.build_platform}}.dmg) ```bash From cc7e7d4ad45e3f26de9c4f64c518237727c78f2e Mon Sep 17 00:00:00 2001 From: neil Date: Tue, 27 Dec 2022 10:37:32 +0800 Subject: [PATCH 22/25] fix link in gha action bot comment --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8f6aa2f..0dbf281 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -214,7 +214,7 @@ jobs: with: message-id: ${{ matrix.platform.name }}-comment message: | - **installer for ${{ matrix.platform.name }} is at**: [here](http://preview.gui.tea.xyz.s3-website-us-east-1.amazonaws.com/${{steps.prefix.outputs.prefix}}/gui_${{steps.build_platform.outputs.build_platform}}.deb) + **installer for ${{ matrix.platform.name }} is at**: [here](http://preview.gui.tea.xyz.s3-website-us-east-1.amazonaws.com/${{ needs.changes.outputs.preview_folder }}/gui_${{steps.build_platform.outputs.build_platform}}.deb) ```bash http://preview.gui.tea.xyz.s3-website-us-east-1.amazonaws.com/${{ needs.changes.outputs.preview_folder }}/gui_${{steps.build_platform.outputs.build_platform}}.deb ``` @@ -227,7 +227,7 @@ jobs: with: message-id: ${{ matrix.platform.name }}-comment message: | - **installer for ${{ matrix.platform.name }} is at**: [here](http://preview.gui.tea.xyz.s3-website-us-east-1.amazonaws.com/${{steps.prefix.outputs.prefix}}/gui_${{steps.build_platform.outputs.build_platform}}.dmg) + **installer for ${{ matrix.platform.name }} is at**: [here](http://preview.gui.tea.xyz.s3-website-us-east-1.amazonaws.com/${{ needs.changes.outputs.preview_folder }}/gui_${{steps.build_platform.outputs.build_platform}}.dmg) ```bash http://preview.gui.tea.xyz.s3-website-us-east-1.amazonaws.com/${{ needs.changes.outputs.preview_folder }}/gui_${{ steps.build_platform.outputs.build_platform }}.dmg ``` From adf6c22eb54db3d13927535868e8f8720b4c0349 Mon Sep 17 00:00:00 2001 From: neil Date: Tue, 27 Dec 2022 10:49:06 +0800 Subject: [PATCH 23/25] optimize: release build process --- .github/workflows/ci.yml | 4 +-- .github/workflows/main.yml | 53 +++++++++++++++++++++++++------------- 2 files changed, 37 insertions(+), 20 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0dbf281..84bb621 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -200,7 +200,7 @@ jobs: - name: ubuntu cp package images from prod to preview bucket - if: matrix.platform == 'ubuntu-latest' + if: matrix.platform.name == 'linux+x86-64' env: prefix: ${{ needs.changes.outputs.preview_folder }} platform: ${{ steps.build_platform.outputs.build_platform }} @@ -210,7 +210,7 @@ jobs: - name: comment install ubuntu uses: mshick/add-pr-comment@v2 - if: matrix.platform == 'ubuntu-latest' + if: matrix.platform.name == 'linux+x86-64' with: message-id: ${{ matrix.platform.name }}-comment message: | diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 3b3887c..708a3fd 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -60,12 +60,19 @@ jobs: build_tauri: needs: changes if: needs.changes.outputs.tauri == 'true' + runs-on: ${{ matrix.platform.os }} strategy: - fail-fast: false matrix: - platform: [macos-latest, ubuntu-latest] - - runs-on: ${{ matrix.platform }} + platform: + - os: macos-11 + name: darwin+x86-64 + - os: ubuntu-latest + name: linux+x86-64 + - os: [self-hosted, macOS, ARM64] + name: darwin+aarch64 + # - os: [self-hosted, linux, ARM64] + # name: linux+aarch64 + container: ${{ matrix.platform.container }} steps: - uses: actions/checkout@v2 @@ -86,11 +93,11 @@ jobs: with: # The prefix cache key, this can be changed to start a new cache manually. # default: "v0-rust" - prefix-key: ${{ matrix.platform }} + prefix-key: ${{ matrix.platform.name }} shared-key: prod cache-targets: false - name: install dependencies (ubuntu only) - if: matrix.platform == 'ubuntu-latest' + if: matrix.platform.name == 'linux+x86-64' run: | sudo apt-get update sudo apt-get install -y libgtk-3-dev webkit2gtk-4.0 libappindicator3-dev librsvg2-dev patchelf @@ -102,9 +109,9 @@ jobs: with: path: | ./modules/gui/src-tauri/target - key: ${{ matrix.platform }}-build-target-prod + key: ${{ matrix.platform.name }}-build-target-prod restore-keys: | - ${{ matrix.platform }}-build-target-prod + ${{ matrix.platform.name }}-build-target-prod - name: test build tauri run: pnpm --filter gui tauri build @@ -117,20 +124,30 @@ jobs: aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} aws-region: us-east-1 - - name: mac-os cp package images from prod to gui bucket - if: matrix.platform == 'macos-latest' + + - name: build platform output + id: build_platform + env: + platform: ${{ matrix.platform.name }} run: | - aws s3 cp ./modules/gui/src-tauri/target/release/bundle/dmg/tea_0.1.0_x64.dmg \ - s3://preview.gui.tea.xyz/release/tea_${{ steps.date.outputs.unix_seconds }}.dmg + BUILD_PLATFORM=$(echo $platform | sed -e "s/darwin+//g" | sed -e "s/linux+//g") + [[ $BUILD_PLATFORM = "x86-64" ]] && BUILD_PLATFORM="x64" || BUILD_PLATFORM=$BUILD_PLATFORM + [[ $BUILD_PLATFORM = "linux+x86-64" ]] && BUILD_PLATFORM="amd64" || BUILD_PLATFORM=$BUILD_PLATFORM + echo "build_platform=$BUILD_PLATFORM" >> $GITHUB_OUTPUT - - name: ubuntu cp package images from prod to gui bucket - if: matrix.platform == 'ubuntu-latest' + - name: cp package images from prod to gui bucket + env: + platform: ${{ steps.build_platform.outputs.build_platform }} + build_platform: ${{ matrix.platform.name }} run: | - aws s3 cp ./modules/gui/src-tauri/target/release/bundle/deb/tea_0.1.0_amd64.deb \ - s3://preview.gui.tea.xyz/release/tea_${{ steps.date.outputs.unix_seconds }}.deb + extension=dmg + [[ $build_platform = "linux+x86-64" ]] && extension="deb" || extension="dmg" + aws s3 cp "./modules/gui/src-tauri/target/release/bundle/$extension/tea_0.1.0_$platform.$extension" \ + "s3://preview.gui.tea.xyz/release/tea_${{ steps.date.outputs.unix_seconds }}_$platform.$extension" + - name: Slack Notification run: ./.github/notify-slack.js env: SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} - PLATFORM: ${{ matrix.platform }} - DOWNLOAD_URL: http://preview.gui.tea.xyz.s3-website-us-east-1.amazonaws.com/release/tea_${{ steps.date.outputs.unix_seconds }}.${{ matrix.platform == 'ubuntu-latest' && 'deb' || 'dmg'}} + PLATFORM: ${{ matrix.platform.name }} + DOWNLOAD_URL: http://preview.gui.tea.xyz.s3-website-us-east-1.amazonaws.com/release/tea_${{ steps.date.outputs.unix_seconds }}_${{ steps.build_platform.outputs.build_platform }}.${{ matrix.platform.name == 'ubuntu-latest' && 'deb' || 'dmg'}} From 3a9d2d33405eb3a2f9fb76d6c26905e1f1904665 Mon Sep 17 00:00:00 2001 From: neil Date: Tue, 27 Dec 2022 10:59:02 +0800 Subject: [PATCH 24/25] fix platform check --- .github/workflows/ci.yml | 2 +- .github/workflows/main.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 84bb621..11b06c7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -176,7 +176,7 @@ jobs: run: | BUILD_PLATFORM=$(echo $platform | sed -e "s/darwin+//g" | sed -e "s/linux+//g") [[ $BUILD_PLATFORM = "x86-64" ]] && BUILD_PLATFORM="x64" || BUILD_PLATFORM=$BUILD_PLATFORM - [[ $BUILD_PLATFORM = "linux+x86-64" ]] && BUILD_PLATFORM="amd64" || BUILD_PLATFORM=$BUILD_PLATFORM + [[ $platform = "linux+x86-64" ]] && BUILD_PLATFORM="amd64" || BUILD_PLATFORM=$BUILD_PLATFORM echo "build_platform=$BUILD_PLATFORM" >> $GITHUB_OUTPUT - name: test build tauri diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 708a3fd..08441f5 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -132,7 +132,7 @@ jobs: run: | BUILD_PLATFORM=$(echo $platform | sed -e "s/darwin+//g" | sed -e "s/linux+//g") [[ $BUILD_PLATFORM = "x86-64" ]] && BUILD_PLATFORM="x64" || BUILD_PLATFORM=$BUILD_PLATFORM - [[ $BUILD_PLATFORM = "linux+x86-64" ]] && BUILD_PLATFORM="amd64" || BUILD_PLATFORM=$BUILD_PLATFORM + [[ $platform = "linux+x86-64" ]] && BUILD_PLATFORM="amd64" || BUILD_PLATFORM=$BUILD_PLATFORM echo "build_platform=$BUILD_PLATFORM" >> $GITHUB_OUTPUT - name: cp package images from prod to gui bucket From f6d911f278af35b007deec5e5422834df462d8c9 Mon Sep 17 00:00:00 2001 From: neil Date: Tue, 27 Dec 2022 11:16:55 +0800 Subject: [PATCH 25/25] refactor code --- .github/workflows/ci.yml | 42 +++++++++----------------------------- .github/workflows/main.yml | 8 +++++--- 2 files changed, 15 insertions(+), 35 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 11b06c7..2a5e34e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -174,10 +174,13 @@ jobs: env: platform: ${{ matrix.platform.name }} run: | + EXTENSION=dmg BUILD_PLATFORM=$(echo $platform | sed -e "s/darwin+//g" | sed -e "s/linux+//g") [[ $BUILD_PLATFORM = "x86-64" ]] && BUILD_PLATFORM="x64" || BUILD_PLATFORM=$BUILD_PLATFORM [[ $platform = "linux+x86-64" ]] && BUILD_PLATFORM="amd64" || BUILD_PLATFORM=$BUILD_PLATFORM + [[ $platform = "linux+x86-64" ]] && EXTENSION="deb" echo "build_platform=$BUILD_PLATFORM" >> $GITHUB_OUTPUT + echo "extension=$EXTENSION" >> $GITHUB_OUTPUT - name: test build tauri run: pnpm --filter gui tauri build @@ -188,47 +191,22 @@ jobs: aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} aws-region: us-east-1 - - - name: mac-os cp package images from prod to preview bucket - if: matrix.platform.name == 'darwin+x86-64' || matrix.platform.name == 'darwin+aarch64' + - name: cp package images from prod to preview bucket env: prefix: ${{ needs.changes.outputs.preview_folder }} platform: ${{ steps.build_platform.outputs.build_platform }} + extension: ${{ steps.build_platform.outputs.extension }} run: | - aws s3 cp "./modules/gui/src-tauri/target/release/bundle/dmg/tea_0.1.0_$platform.dmg" \ - "s3://preview.gui.tea.xyz/$prefix/gui_$platform.dmg" - - - - name: ubuntu cp package images from prod to preview bucket - if: matrix.platform.name == 'linux+x86-64' - env: - prefix: ${{ needs.changes.outputs.preview_folder }} - platform: ${{ steps.build_platform.outputs.build_platform }} - run: | - aws s3 cp "./modules/gui/src-tauri/target/release/bundle/deb/tea_0.1.0_$platform.deb" \ - "s3://preview.gui.tea.xyz/$prefix/gui_$platform.deb" - - - name: comment install ubuntu - uses: mshick/add-pr-comment@v2 - if: matrix.platform.name == 'linux+x86-64' - with: - message-id: ${{ matrix.platform.name }}-comment - message: | - **installer for ${{ matrix.platform.name }} is at**: [here](http://preview.gui.tea.xyz.s3-website-us-east-1.amazonaws.com/${{ needs.changes.outputs.preview_folder }}/gui_${{steps.build_platform.outputs.build_platform}}.deb) - ```bash - http://preview.gui.tea.xyz.s3-website-us-east-1.amazonaws.com/${{ needs.changes.outputs.preview_folder }}/gui_${{steps.build_platform.outputs.build_platform}}.deb - ``` - copy-paste into a browser to download - + aws s3 cp "./modules/gui/src-tauri/target/release/bundle/$extension/tea_0.1.0_$platform.$extension" \ + "s3://preview.gui.tea.xyz/$prefix/gui_$platform.$extension" - - name: comment install mac-os + - name: comment install uses: mshick/add-pr-comment@v2 - if: matrix.platform.name == 'darwin+x86-64' || matrix.platform.name == 'darwin+aarch64' with: message-id: ${{ matrix.platform.name }}-comment message: | - **installer for ${{ matrix.platform.name }} is at**: [here](http://preview.gui.tea.xyz.s3-website-us-east-1.amazonaws.com/${{ needs.changes.outputs.preview_folder }}/gui_${{steps.build_platform.outputs.build_platform}}.dmg) + **installer for ${{ matrix.platform.name }} is at**: [here](http://preview.gui.tea.xyz.s3-website-us-east-1.amazonaws.com/${{ needs.changes.outputs.preview_folder }}/gui_${{steps.build_platform.outputs.build_platform}}.${{steps.build_platform.outputs.extension}}) ```bash - http://preview.gui.tea.xyz.s3-website-us-east-1.amazonaws.com/${{ needs.changes.outputs.preview_folder }}/gui_${{ steps.build_platform.outputs.build_platform }}.dmg + http://preview.gui.tea.xyz.s3-website-us-east-1.amazonaws.com/${{ needs.changes.outputs.preview_folder }}/gui_${{ steps.build_platform.outputs.build_platform }}.${{ steps.build_platform.outputs.extension }} ``` copy-paste into a browser to download \ No newline at end of file diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 08441f5..7bae9cb 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -131,17 +131,19 @@ jobs: platform: ${{ matrix.platform.name }} run: | BUILD_PLATFORM=$(echo $platform | sed -e "s/darwin+//g" | sed -e "s/linux+//g") + EXTENSION=dmg [[ $BUILD_PLATFORM = "x86-64" ]] && BUILD_PLATFORM="x64" || BUILD_PLATFORM=$BUILD_PLATFORM [[ $platform = "linux+x86-64" ]] && BUILD_PLATFORM="amd64" || BUILD_PLATFORM=$BUILD_PLATFORM + [[ $platform = "linux+x86-64" ]] && EXTENSION="deb" echo "build_platform=$BUILD_PLATFORM" >> $GITHUB_OUTPUT + echo "extension=$EXTENSION" >> $GITHUB_OUTPUT - name: cp package images from prod to gui bucket env: platform: ${{ steps.build_platform.outputs.build_platform }} build_platform: ${{ matrix.platform.name }} + extension: ${{steps.build_platform.outputs.extension}} run: | - extension=dmg - [[ $build_platform = "linux+x86-64" ]] && extension="deb" || extension="dmg" aws s3 cp "./modules/gui/src-tauri/target/release/bundle/$extension/tea_0.1.0_$platform.$extension" \ "s3://preview.gui.tea.xyz/release/tea_${{ steps.date.outputs.unix_seconds }}_$platform.$extension" @@ -150,4 +152,4 @@ jobs: env: SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} PLATFORM: ${{ matrix.platform.name }} - DOWNLOAD_URL: http://preview.gui.tea.xyz.s3-website-us-east-1.amazonaws.com/release/tea_${{ steps.date.outputs.unix_seconds }}_${{ steps.build_platform.outputs.build_platform }}.${{ matrix.platform.name == 'ubuntu-latest' && 'deb' || 'dmg'}} + DOWNLOAD_URL: http://preview.gui.tea.xyz.s3-website-us-east-1.amazonaws.com/release/tea_${{ steps.date.outputs.unix_seconds }}_${{ steps.build_platform.outputs.build_platform }}.${{ steps.build_platform.outputs.extension }}