From c838041ba4c10cefb7acaae90fe5825f3cd9d8ef Mon Sep 17 00:00:00 2001 From: neil Date: Thu, 5 Jan 2023 07:29:45 +0800 Subject: [PATCH 01/22] #109 test tea/action in ci step --- .github/workflows/ci.yml | 82 +++++++++++----------------------- modules/gui/src/libs/stores.ts | 2 +- 2 files changed, 28 insertions(+), 56 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3629467..031388d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -134,45 +134,35 @@ jobs: # name: linux+aarch64 container: ${{ matrix.platform.container }} steps: - - uses: actions/checkout@v2 - - uses: pnpm/action-setup@v2 - with: - version: 7 - - name: setup node - uses: actions/setup-node@v1 - with: - node-version: 18 - cache: 'pnpm' - cache-dependency-path: pnpm-lock.yaml - - name: install Rust stable - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - - name: install app dependencies - run: pnpm install + - uses: actions/checkout@v3 - - name: install dependencies (ubuntu only) + # will this work on tea? this is not packaged yet? + # - name: install dependencies (ubuntu only) + # 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 pkg-config + + - name: build tauri for MacOS + uses: teaxyz/setup@v0 + if: matrix.platform.name == 'darwin+x86-64' || matrix.platform.name == 'darwin+aarch64' + # FROM: https://tauri.app/v1/guides/distribution/sign-macos + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + ENABLE_CODE_SIGNING: ${{ secrets.GUI_APPLE_CERTIFICATE }} + APPLE_CERTIFICATE: ${{ secrets.GUI_APPLE_CERTIFICATE }} + APPLE_CERTIFICATE_PASSWORD: ${{ secrets.GUI_APPLE_CERTIFICATE_PASSWORD }} + APPLE_SIGNING_IDENTITY: ${{ secrets.APPLE_SIGNING_IDENTITY }} + APPLE_ID: ${{ secrets.APPLE_ID }} + APPLE_PASSWORD: ${{ secrets.APPLE_PASSWORD }} + with: + target: build + + - name: build tauri for Linux + uses: teaxyz/setup@v0 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 pkg-config - - - uses: Swatinem/rust-cache@v2 - with: - # The prefix cache key, this can be changed to start a new cache manually. - # default: "v0-rust" - prefix-key: ${{ matrix.platform.name }} - shared-key: ci - cache-targets: false - - - name: Cache Tauri Target - uses: actions/cache@v3 - with: - path: | - ./modules/gui/src-tauri/target - key: ${{ matrix.platform.name }}-build-target - restore-keys: | - ${{ matrix.platform.name }}-build-target + # TODO: https://tauri.app/v1/guides/distribution/sign-linux + run: pnpm build:gui - name: build platform output id: build_platform @@ -187,24 +177,6 @@ jobs: echo "build_platform=$BUILD_PLATFORM" >> $GITHUB_OUTPUT echo "extension=$EXTENSION" >> $GITHUB_OUTPUT - - name: test build tauri for MacOS - if: matrix.platform.name == 'darwin+x86-64' || matrix.platform.name == 'darwin+aarch64' - # FROM: https://tauri.app/v1/guides/distribution/sign-macos - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - ENABLE_CODE_SIGNING: ${{ secrets.GUI_APPLE_CERTIFICATE }} - APPLE_CERTIFICATE: ${{ secrets.GUI_APPLE_CERTIFICATE }} - APPLE_CERTIFICATE_PASSWORD: ${{ secrets.GUI_APPLE_CERTIFICATE_PASSWORD }} - APPLE_SIGNING_IDENTITY: ${{ secrets.APPLE_SIGNING_IDENTITY }} - APPLE_ID: ${{ secrets.APPLE_ID }} - APPLE_PASSWORD: ${{ secrets.APPLE_PASSWORD }} - run: pnpm build:gui - - - name: test build tauri for Linux - if: matrix.platform.name == 'linux+x86-64' - # TODO: https://tauri.app/v1/guides/distribution/sign-linux - run: pnpm build:gui - - name: zip .app for MacOS if: matrix.platform.name == 'darwin+x86-64' || matrix.platform.name == 'darwin+aarch64' run: | diff --git a/modules/gui/src/libs/stores.ts b/modules/gui/src/libs/stores.ts index acedd96..51d50f6 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 separate files? + import { getPackages, getFeaturedPackages, getPackageReviews, getAllPosts } from '@api'; From 83ade2d02ec10dc3b2c0787707beb532486f3f07 Mon Sep 17 00:00:00 2001 From: neil Date: Thu, 5 Jan 2023 07:30:26 +0800 Subject: [PATCH 02/22] fix --- .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 031388d..1032482 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -162,7 +162,8 @@ jobs: uses: teaxyz/setup@v0 if: matrix.platform.name == 'linux+x86-64' # TODO: https://tauri.app/v1/guides/distribution/sign-linux - run: pnpm build:gui + with: + target: build - name: build platform output id: build_platform From 5245f43c4e43ccd4f7f10297822a3e0e9b3297e7 Mon Sep 17 00:00:00 2001 From: neil Date: Thu, 5 Jan 2023 07:34:39 +0800 Subject: [PATCH 03/22] lint --- modules/gui/src/libs/stores.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/modules/gui/src/libs/stores.ts b/modules/gui/src/libs/stores.ts index 51d50f6..316139a 100644 --- a/modules/gui/src/libs/stores.ts +++ b/modules/gui/src/libs/stores.ts @@ -4,7 +4,6 @@ import Fuse from 'fuse.js'; import type { Package, Review, AirtablePost } from '@tea/ui/types'; import type { GUIPackage } from '$libs/types'; - import { getPackages, getFeaturedPackages, getPackageReviews, getAllPosts } from '@api'; export const backLink = writable('/'); From 85af45715b813eccd526506df8a76687eee8076b Mon Sep 17 00:00:00 2001 From: neil Date: Thu, 5 Jan 2023 07:43:48 +0800 Subject: [PATCH 04/22] uncomment m1 --- .github/workflows/ci.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1032482..6acf4ec 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -127,9 +127,10 @@ jobs: - os: ubuntu-latest name: linux+x86-64 id: linux - - os: [self-hosted, macOS, ARM64] - name: darwin+aarch64 - id: mac_m1 + # TODO: skip temp until new m1 arrives + # - os: [self-hosted, macOS, ARM64] + # name: darwin+aarch64 + # id: mac_m1 # - os: [self-hosted, linux, ARM64] # name: linux+aarch64 container: ${{ matrix.platform.container }} From f2c1afe1f09c9f824909ed41c7270b03a06cbb97 Mon Sep 17 00:00:00 2001 From: neil Date: Thu, 5 Jan 2023 07:52:37 +0800 Subject: [PATCH 05/22] #109 update dependencies --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 58f57aa..34acaef 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,9 @@ For better documentation checkout this [notion](https://www.notion.so/teaxyz/tea | nodejs.org | >=16 | | pnpm.io | >=7.18.2 | | rust-lang.org | >=1.62 | - +| nixos.org/patchelf | >= 0.17.0 | +| freedesktop.org/pkg-config | >= 0.29.2 | +| gnome.org/librsvg | >= 2.55.1 | # Getting Started ```sh pnpm install From ff64088bcb36d1c3af07dd8fec50d8016691b9d0 Mon Sep 17 00:00:00 2001 From: neil Date: Thu, 5 Jan 2023 07:56:51 +0800 Subject: [PATCH 06/22] space --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 34acaef..8e358e9 100644 --- a/README.md +++ b/README.md @@ -16,6 +16,7 @@ For better documentation checkout this [notion](https://www.notion.so/teaxyz/tea | nixos.org/patchelf | >= 0.17.0 | | freedesktop.org/pkg-config | >= 0.29.2 | | gnome.org/librsvg | >= 2.55.1 | + # Getting Started ```sh pnpm install From eea93b99d086509e8e565a2e9e560ef1850b1711 Mon Sep 17 00:00:00 2001 From: neil Date: Thu, 5 Jan 2023 08:07:51 +0800 Subject: [PATCH 07/22] fix version --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 8e358e9..676b0fa 100644 --- a/README.md +++ b/README.md @@ -13,9 +13,9 @@ For better documentation checkout this [notion](https://www.notion.so/teaxyz/tea | nodejs.org | >=16 | | pnpm.io | >=7.18.2 | | rust-lang.org | >=1.62 | -| nixos.org/patchelf | >= 0.17.0 | -| freedesktop.org/pkg-config | >= 0.29.2 | -| gnome.org/librsvg | >= 2.55.1 | +| nixos.org/patchelf | 0.17.0 | +| freedesktop.org/pkg-config | 0.29.2 | +| gnome.org/librsvg | 2.55.1 | # Getting Started ```sh From a9b68524b5baaf80dcc552c974077e734c12afb0 Mon Sep 17 00:00:00 2001 From: neil Date: Thu, 5 Jan 2023 08:16:28 +0800 Subject: [PATCH 08/22] fix semver --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 676b0fa..9cd0fd9 100644 --- a/README.md +++ b/README.md @@ -13,9 +13,9 @@ For better documentation checkout this [notion](https://www.notion.so/teaxyz/tea | nodejs.org | >=16 | | pnpm.io | >=7.18.2 | | rust-lang.org | >=1.62 | -| nixos.org/patchelf | 0.17.0 | -| freedesktop.org/pkg-config | 0.29.2 | -| gnome.org/librsvg | 2.55.1 | +| nixos.org/patchelf | >=0.17 | +| freedesktop.org/pkg-config | >=0.29 | +| gnome.org/librsvg | >=2.55 | # Getting Started ```sh From bd59ad80fa5f5dc0ec011eb00881830c57b8343c Mon Sep 17 00:00:00 2001 From: neil Date: Thu, 5 Jan 2023 08:24:03 +0800 Subject: [PATCH 09/22] run mac latest only --- .github/workflows/ci.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6acf4ec..49f46cf 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -124,9 +124,10 @@ jobs: - os: macos-11 name: darwin+x86-64 id: mac_latest - - os: ubuntu-latest - name: linux+x86-64 - id: linux + # TODO: blocked by gtk packages + # - os: ubuntu-latest + # name: linux+x86-64 + # id: linux # TODO: skip temp until new m1 arrives # - os: [self-hosted, macOS, ARM64] # name: darwin+aarch64 From 7413873974e7a4d2e371647458c015f59fb57192 Mon Sep 17 00:00:00 2001 From: neil Date: Fri, 6 Jan 2023 06:24:25 +0800 Subject: [PATCH 10/22] #109 skip notarization --- .github/workflows/ci.yml | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 49f46cf..79d6391 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -128,10 +128,9 @@ jobs: # - os: ubuntu-latest # name: linux+x86-64 # id: linux - # TODO: skip temp until new m1 arrives - # - os: [self-hosted, macOS, ARM64] - # name: darwin+aarch64 - # id: mac_m1 + - os: [self-hosted, macOS, ARM64] + name: darwin+aarch64 + id: mac_m1 # - os: [self-hosted, linux, ARM64] # name: linux+aarch64 container: ${{ matrix.platform.container }} @@ -155,8 +154,10 @@ jobs: APPLE_CERTIFICATE: ${{ secrets.GUI_APPLE_CERTIFICATE }} APPLE_CERTIFICATE_PASSWORD: ${{ secrets.GUI_APPLE_CERTIFICATE_PASSWORD }} APPLE_SIGNING_IDENTITY: ${{ secrets.APPLE_SIGNING_IDENTITY }} - APPLE_ID: ${{ secrets.APPLE_ID }} - APPLE_PASSWORD: ${{ secrets.APPLE_PASSWORD }} + # TODO: uncomment once isolated m1 runner is setup with latest xcode + # only used for notarization + # APPLE_ID: ${{ secrets.APPLE_ID }} + # APPLE_PASSWORD: ${{ secrets.APPLE_PASSWORD }} with: target: build From a8a93ef98eb0bec95fda59b77fb479644ab8330e Mon Sep 17 00:00:00 2001 From: neil Date: Fri, 6 Jan 2023 06:54:03 +0800 Subject: [PATCH 11/22] test linux build --- .github/workflows/ci.yml | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 79d6391..d55f87c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -125,24 +125,25 @@ jobs: name: darwin+x86-64 id: mac_latest # TODO: blocked by gtk packages - # - os: ubuntu-latest - # name: linux+x86-64 - # id: linux + - os: ubuntu-latest + name: linux+x86-64 + id: linux - os: [self-hosted, macOS, ARM64] name: darwin+aarch64 id: mac_m1 - # - os: [self-hosted, linux, ARM64] - # name: linux+aarch64 + # note: if this fails maybe the runner got replaced, manually installed gtk there + # sudo apt-get install -y libgtk-3-dev webkit2gtk-4.0 libappindicator3-dev librsvg2-dev patchelf + - os: [self-hosted, linux, ARM64] + name: linux+aarch64 container: ${{ matrix.platform.container }} steps: - uses: actions/checkout@v3 - # will this work on tea? this is not packaged yet? - # - name: install dependencies (ubuntu only) - # 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 pkg-config + - name: install dependencies (ubuntu only) + 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 - name: build tauri for MacOS uses: teaxyz/setup@v0 From 4e866f5764a933f911c6e16cbb958146333b6cbb Mon Sep 17 00:00:00 2001 From: neil Date: Fri, 6 Jan 2023 06:57:31 +0800 Subject: [PATCH 12/22] fix linux build --- .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 d55f87c..35f285b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -164,7 +164,7 @@ jobs: - name: build tauri for Linux uses: teaxyz/setup@v0 - if: matrix.platform.name == 'linux+x86-64' + if: matrix.platform.name == 'linux+x86-64' || matrix.platform.name == 'darwin+aarch64' # TODO: https://tauri.app/v1/guides/distribution/sign-linux with: target: build From b5f65e382fac8ad2f4ec607078895c981171e884 Mon Sep 17 00:00:00 2001 From: neil Date: Fri, 6 Jan 2023 07:04:49 +0800 Subject: [PATCH 13/22] test build --- .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 35f285b..7880a71 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -164,7 +164,7 @@ jobs: - name: build tauri for Linux uses: teaxyz/setup@v0 - if: matrix.platform.name == 'linux+x86-64' || matrix.platform.name == 'darwin+aarch64' + if: matrix.platform.name == 'linux+x86-64' || matrix.platform.name == 'linux+aarch64' # TODO: https://tauri.app/v1/guides/distribution/sign-linux with: target: build From 46733038e461be58ebc72d9420266cb834772fc6 Mon Sep 17 00:00:00 2001 From: neil Date: Fri, 6 Jan 2023 07:14:41 +0800 Subject: [PATCH 14/22] tmp rm macos builds --- .github/workflows/ci.yml | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7880a71..aab3837 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -121,16 +121,16 @@ jobs: strategy: matrix: platform: - - os: macos-11 - name: darwin+x86-64 - id: mac_latest + # - os: macos-11 + # name: darwin+x86-64 + # id: mac_latest # TODO: blocked by gtk packages - os: ubuntu-latest name: linux+x86-64 id: linux - - os: [self-hosted, macOS, ARM64] - name: darwin+aarch64 - id: mac_m1 + # - os: [self-hosted, macOS, ARM64] + # name: darwin+aarch64 + # id: mac_m1 # note: if this fails maybe the runner got replaced, manually installed gtk there # sudo apt-get install -y libgtk-3-dev webkit2gtk-4.0 libappindicator3-dev librsvg2-dev patchelf - os: [self-hosted, linux, ARM64] @@ -144,6 +144,7 @@ jobs: run: | sudo apt-get update sudo apt-get install -y libgtk-3-dev webkit2gtk-4.0 libappindicator3-dev librsvg2-dev + sh <(curl https://tea.xyz) - name: build tauri for MacOS uses: teaxyz/setup@v0 @@ -163,11 +164,12 @@ jobs: target: build - name: build tauri for Linux - uses: teaxyz/setup@v0 + # uses: teaxyz/setup@v0 if: matrix.platform.name == 'linux+x86-64' || matrix.platform.name == 'linux+aarch64' # TODO: https://tauri.app/v1/guides/distribution/sign-linux - with: - target: build + run: | + tea . + tea build - name: build platform output id: build_platform From f899c46fab331198700218743d324933c2c5a054 Mon Sep 17 00:00:00 2001 From: neil Date: Fri, 6 Jan 2023 07:17:39 +0800 Subject: [PATCH 15/22] dont install tea --- .github/workflows/ci.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index aab3837..411dd17 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -144,7 +144,6 @@ jobs: run: | sudo apt-get update sudo apt-get install -y libgtk-3-dev webkit2gtk-4.0 libappindicator3-dev librsvg2-dev - sh <(curl https://tea.xyz) - name: build tauri for MacOS uses: teaxyz/setup@v0 @@ -168,8 +167,8 @@ jobs: if: matrix.platform.name == 'linux+x86-64' || matrix.platform.name == 'linux+aarch64' # TODO: https://tauri.app/v1/guides/distribution/sign-linux run: | - tea . - tea build + sh <(curl https://tea.xyz) . + sh <(curl https://tea.xyz) build - name: build platform output id: build_platform From 12d8eb6ce388c7987a8e592ff6de4ca4c293336d Mon Sep 17 00:00:00 2001 From: neil Date: Fri, 6 Jan 2023 07:27:53 +0800 Subject: [PATCH 16/22] test linux arm only --- .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 411dd17..4f9be8a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -125,9 +125,9 @@ jobs: # name: darwin+x86-64 # id: mac_latest # TODO: blocked by gtk packages - - os: ubuntu-latest - name: linux+x86-64 - id: linux + # - os: ubuntu-latest + # name: linux+x86-64 + # id: linux # - os: [self-hosted, macOS, ARM64] # name: darwin+aarch64 # id: mac_m1 From 243d587c94ea0c06f7e0be3b3bd4f9933f0aba24 Mon Sep 17 00:00:00 2001 From: neil Date: Fri, 6 Jan 2023 07:50:31 +0800 Subject: [PATCH 17/22] test --- .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 4f9be8a..444a228 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -168,7 +168,7 @@ jobs: # TODO: https://tauri.app/v1/guides/distribution/sign-linux run: | sh <(curl https://tea.xyz) . - sh <(curl https://tea.xyz) build + sh <(curl https://tea.xyz) . build - name: build platform output id: build_platform From 84698c3669f5ae4ad0e13d6f8d3b23be35a3c739 Mon Sep 17 00:00:00 2001 From: neil Date: Fri, 6 Jan 2023 08:35:04 +0800 Subject: [PATCH 18/22] change build cmd --- .github/workflows/ci.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 444a228..3b9f318 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -125,16 +125,16 @@ jobs: # name: darwin+x86-64 # id: mac_latest # TODO: blocked by gtk packages - # - os: ubuntu-latest - # name: linux+x86-64 - # id: linux + - os: ubuntu-latest + name: linux+x86-64 + id: linux # - os: [self-hosted, macOS, ARM64] # name: darwin+aarch64 # id: mac_m1 # note: if this fails maybe the runner got replaced, manually installed gtk there # sudo apt-get install -y libgtk-3-dev webkit2gtk-4.0 libappindicator3-dev librsvg2-dev patchelf - - os: [self-hosted, linux, ARM64] - name: linux+aarch64 + # - os: [self-hosted, linux, ARM64] + # name: linux+aarch64 container: ${{ matrix.platform.container }} steps: - uses: actions/checkout@v3 @@ -168,7 +168,7 @@ jobs: # TODO: https://tauri.app/v1/guides/distribution/sign-linux run: | sh <(curl https://tea.xyz) . - sh <(curl https://tea.xyz) . build + sh <(curl https://tea.xyz) -x build - name: build platform output id: build_platform From f903885cc9e4a366e4ff5a7351dbae6d7db3c610 Mon Sep 17 00:00:00 2001 From: neil Date: Fri, 6 Jan 2023 09:46:26 +0800 Subject: [PATCH 19/22] update dependencies move to apt-get --- .github/workflows/ci.yml | 12 ++++++------ README.md | 3 --- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3b9f318..0e51df2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -147,7 +147,7 @@ jobs: - name: build tauri for MacOS uses: teaxyz/setup@v0 - if: matrix.platform.name == 'darwin+x86-64' || matrix.platform.name == 'darwin+aarch64' + if: startsWith(matrix.platform.name, 'darwin') # FROM: https://tauri.app/v1/guides/distribution/sign-macos env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -164,11 +164,11 @@ jobs: - name: build tauri for Linux # uses: teaxyz/setup@v0 - if: matrix.platform.name == 'linux+x86-64' || matrix.platform.name == 'linux+aarch64' + if: startsWith(matrix.platform.name, 'linux') # TODO: https://tauri.app/v1/guides/distribution/sign-linux run: | - sh <(curl https://tea.xyz) . - sh <(curl https://tea.xyz) -x build + sudo apt-get install -y libgtk-3-dev webkit2gtk-4.0 libappindicator3-dev librsvg2-dev patchelf pkg-config + sh <(curl https://tea.xyz) build - name: build platform output id: build_platform @@ -212,7 +212,7 @@ jobs: aws s3 cp ./modules/gui/src-tauri/target/release/bundle/macos/tea.zip "s3://preview.gui.tea.xyz/$prefix/tea_$platform.zip" - name: comment install for Linux - if: matrix.platform.name == 'linux+x86-64' + if: startsWith(matrix.platform.name, 'linux') uses: mshick/add-pr-comment@v2 with: message-id: ${{ matrix.platform.id }}-comment @@ -226,7 +226,7 @@ jobs: copy-paste into a browser to download - name: comment install for MacOS - if: matrix.platform.name == 'darwin+x86-64' || matrix.platform.name == 'darwin+aarch64' + if: startsWith(matrix.platform.name, 'darwin') uses: mshick/add-pr-comment@v2 with: message-id: ${{ matrix.platform.id }}-comment diff --git a/README.md b/README.md index 9cd0fd9..58f57aa 100644 --- a/README.md +++ b/README.md @@ -13,9 +13,6 @@ For better documentation checkout this [notion](https://www.notion.so/teaxyz/tea | nodejs.org | >=16 | | pnpm.io | >=7.18.2 | | rust-lang.org | >=1.62 | -| nixos.org/patchelf | >=0.17 | -| freedesktop.org/pkg-config | >=0.29 | -| gnome.org/librsvg | >=2.55 | # Getting Started ```sh From f6b464875bfcb42abfbcf1d1025b443ff4ebee15 Mon Sep 17 00:00:00 2001 From: neil Date: Fri, 6 Jan 2023 10:08:52 +0800 Subject: [PATCH 20/22] test move pkg-config to tea --- .github/workflows/ci.yml | 3 +-- README.md | 1 + 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0e51df2..c23cc30 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -124,7 +124,6 @@ jobs: # - os: macos-11 # name: darwin+x86-64 # id: mac_latest - # TODO: blocked by gtk packages - os: ubuntu-latest name: linux+x86-64 id: linux @@ -167,7 +166,7 @@ jobs: if: startsWith(matrix.platform.name, 'linux') # TODO: https://tauri.app/v1/guides/distribution/sign-linux run: | - sudo apt-get install -y libgtk-3-dev webkit2gtk-4.0 libappindicator3-dev librsvg2-dev patchelf pkg-config + sudo apt-get install -y libgtk-3-dev webkit2gtk-4.0 libappindicator3-dev librsvg2-dev patchelf sh <(curl https://tea.xyz) build - name: build platform output diff --git a/README.md b/README.md index 58f57aa..df0ec2e 100644 --- a/README.md +++ b/README.md @@ -13,6 +13,7 @@ For better documentation checkout this [notion](https://www.notion.so/teaxyz/tea | nodejs.org | >=16 | | pnpm.io | >=7.18.2 | | rust-lang.org | >=1.62 | +| freedesktop.org/pkg-config | >=0.29 | # Getting Started ```sh From d6a31766a74bbb531322127dd4dda406c8979713 Mon Sep 17 00:00:00 2001 From: neil Date: Fri, 6 Jan 2023 10:28:56 +0800 Subject: [PATCH 21/22] #109 final init implementatin of tea in gha --- .github/workflows/ci.yml | 43 ++++++----------- .github/workflows/main.yml | 88 +++++++++-------------------------- .github/workflows/release.yml | 77 +++++++----------------------- README.md | 1 - 4 files changed, 53 insertions(+), 156 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c23cc30..6c5db02 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -66,25 +66,12 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 - with: - persist-credentials: false - - uses: pnpm/action-setup@v2 - with: - version: 7 - - name: setup node - uses: actions/setup-node@v1 - with: - node-version: 18 - cache: 'pnpm' - cache-dependency-path: pnpm-lock.yaml - - name: install Rust stable - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - - name: install app dependencies and build it - env: - BUILD_FOR: preview - run: pnpm install && pnpm --filter gui build + - name: build tauri for Linux + # uses: teaxyz/setup@v0 + if: startsWith(matrix.platform.name, 'linux') + run: | + sudo apt-get install -y libgtk-3-dev webkit2gtk-4.0 libappindicator3-dev librsvg2-dev patchelf pkg-config + sh <(curl https://tea.xyz) build - uses: aws-actions/configure-aws-credentials@v1 with: aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} @@ -121,17 +108,17 @@ jobs: strategy: matrix: platform: - # - os: macos-11 - # name: darwin+x86-64 - # id: mac_latest + - os: macos-11 + name: darwin+x86-64 + id: mac_latest - os: ubuntu-latest name: linux+x86-64 id: linux - # - os: [self-hosted, macOS, ARM64] - # name: darwin+aarch64 - # id: mac_m1 - # note: if this fails maybe the runner got replaced, manually installed gtk there - # sudo apt-get install -y libgtk-3-dev webkit2gtk-4.0 libappindicator3-dev librsvg2-dev patchelf + - os: [self-hosted, macOS, ARM64] + name: darwin+aarch64 + id: mac_m1 + # err: Package atk was not found in the pkg-config search path. + # requires atk >= 2.18 # - os: [self-hosted, linux, ARM64] # name: linux+aarch64 container: ${{ matrix.platform.container }} @@ -166,7 +153,7 @@ jobs: if: startsWith(matrix.platform.name, 'linux') # TODO: https://tauri.app/v1/guides/distribution/sign-linux run: | - 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 sh <(curl https://tea.xyz) build - name: build platform output diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 2722de6..7dbc942 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -37,26 +37,12 @@ jobs: - uses: actions/checkout@v3 with: persist-credentials: false - - uses: pnpm/action-setup@v2 - with: - version: 7 - - name: setup node - uses: actions/setup-node@v1 - with: - node-version: 18 - cache: 'pnpm' - cache-dependency-path: pnpm-lock.yaml - - name: install Rust stable - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - - name: install app dependencies and build it - run: pnpm install && pnpm --filter gui build - - uses: aws-actions/configure-aws-credentials@v1 - with: - 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 tauri for Linux + if: startsWith(matrix.platform.name, 'linux') + run: | + sudo apt-get install -y libgtk-3-dev webkit2gtk-4.0 libappindicator3-dev librsvg2-dev patchelf pkg-config + sh <(curl https://tea.xyz) build + build_tauri: needs: changes if: needs.changes.outputs.tauri == 'true' @@ -74,47 +60,10 @@ jobs: # name: linux+aarch64 container: ${{ matrix.platform.container }} steps: - - uses: actions/checkout@v2 - - - uses: pnpm/action-setup@v2 - with: - version: 7 - - name: setup node - uses: actions/setup-node@v1 - with: - node-version: 18 - cache: 'pnpm' - cache-dependency-path: pnpm-lock.yaml - - name: install Rust stable - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - - uses: Swatinem/rust-cache@v2 - with: - # The prefix cache key, this can be changed to start a new cache manually. - # default: "v0-rust" - prefix-key: ${{ matrix.platform.name }} - shared-key: prod - cache-targets: false - - name: install dependencies (ubuntu only) - 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 - - name: install app dependencies - run: pnpm install - - - name: Cache Tauri Target - uses: actions/cache@v3 - with: - path: | - ./modules/gui/src-tauri/target - key: ${{ matrix.platform.name }}-build-target-prod - restore-keys: | - ${{ matrix.platform.name }}-build-target-prod + - uses: actions/checkout@v3 - name: test build tauri for MacOS - if: matrix.platform.name == 'darwin+x86-64' || matrix.platform.name == 'darwin+aarch64' + if: startsWith(matrix.platform.name, 'darwin') # FROM: https://tauri.app/v1/guides/distribution/sign-macos env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -122,14 +71,19 @@ jobs: APPLE_CERTIFICATE: ${{ secrets.GUI_APPLE_CERTIFICATE }} APPLE_CERTIFICATE_PASSWORD: ${{ secrets.GUI_APPLE_CERTIFICATE_PASSWORD }} APPLE_SIGNING_IDENTITY: ${{ secrets.APPLE_SIGNING_IDENTITY }} - APPLE_ID: ${{ secrets.APPLE_ID }} - APPLE_PASSWORD: ${{ secrets.APPLE_PASSWORD }} + # todo: uncomment when m1 with latest xcode is deployed + # this only helps in notarization + # APPLE_ID: ${{ secrets.APPLE_ID }} + # APPLE_PASSWORD: ${{ secrets.APPLE_PASSWORD }} run: pnpm build:gui - - name: test build tauri for Linux - if: matrix.platform.name == 'linux+x86-64' + - name: build tauri for Linux + # uses: teaxyz/setup@v0 + if: startsWith(matrix.platform.name, 'linux') # TODO: https://tauri.app/v1/guides/distribution/sign-linux - run: pnpm build:gui + run: | + sudo apt-get install -y libgtk-3-dev webkit2gtk-4.0 libappindicator3-dev librsvg2-dev patchelf pkg-config + sh <(curl https://tea.xyz) build - name: Get current unix ts - seconds id: date @@ -154,7 +108,7 @@ jobs: echo "extension=$EXTENSION" >> $GITHUB_OUTPUT - name: zip .app for MacOS - if: matrix.platform.name == 'darwin+x86-64' || matrix.platform.name == 'darwin+aarch64' + if: startsWith(matrix.platform.name, 'darwin') run: | cd ./modules/gui/src-tauri/target/release/bundle/macos/ && zip -r tea.zip tea.app @@ -168,7 +122,7 @@ jobs: "s3://preview.gui.tea.xyz/release/tea_${{ steps.date.outputs.unix_seconds }}_$platform.$extension" - name: cp package zip for MacOS - if: matrix.platform.name == 'darwin+x86-64' || matrix.platform.name == 'darwin+aarch64' + if: startsWith(matrix.platform.name, 'darwin') env: platform: ${{ steps.build_platform.outputs.build_platform }} build_platform: ${{ matrix.platform.name }} @@ -185,7 +139,7 @@ jobs: - name: Slack Notification for .app Mac run: ./.github/notify-slack.js - if: matrix.platform.name == 'darwin+x86-64' || matrix.platform.name == 'darwin+aarch64' + if: startsWith(matrix.platform.name, 'darwin') env: SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} PLATFORM: ${{ matrix.platform.name }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d4d1cc9..45016a2 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -19,59 +19,10 @@ jobs: # name: linux+aarch64 container: ${{ matrix.platform.container }} steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - - uses: pnpm/action-setup@v2 - with: - version: 7 - - name: setup node - uses: actions/setup-node@v1 - with: - node-version: 18 - cache: 'pnpm' - cache-dependency-path: pnpm-lock.yaml - - name: install Rust stable - uses: actions-rs/toolchain@v1 - with: - toolchain: stable - - 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") - 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 - - uses: Swatinem/rust-cache@v2 - with: - # The prefix cache key, this can be changed to start a new cache manually. - # default: "v0-rust" - prefix-key: ${{ matrix.platform.name }} - shared-key: prod - cache-targets: false - - name: install dependencies (ubuntu only) - 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 - - name: install app dependencies - run: pnpm install - - - name: Cache Tauri Target - uses: actions/cache@v3 - with: - path: | - ./modules/gui/src-tauri/target - key: ${{ matrix.platform.name }}-build-target-prod - restore-keys: | - ${{ matrix.platform.name }}-build-target-prod - - - name: test build tauri for MacOS - if: matrix.platform.name == 'darwin+x86-64' || matrix.platform.name == 'darwin+aarch64' + - name: build tauri for MacOS + if: startsWith(matrix.platform.name, 'darwin') # FROM: https://tauri.app/v1/guides/distribution/sign-macos env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} @@ -79,14 +30,20 @@ jobs: APPLE_CERTIFICATE: ${{ secrets.GUI_APPLE_CERTIFICATE }} APPLE_CERTIFICATE_PASSWORD: ${{ secrets.GUI_APPLE_CERTIFICATE_PASSWORD }} APPLE_SIGNING_IDENTITY: ${{ secrets.APPLE_SIGNING_IDENTITY }} - APPLE_ID: ${{ secrets.APPLE_ID }} - APPLE_PASSWORD: ${{ secrets.APPLE_PASSWORD }} + # todo: uncomment when m1 with latest xcode is deployed + # this only helps in notarization + # APPLE_ID: ${{ secrets.APPLE_ID }} + # APPLE_PASSWORD: ${{ secrets.APPLE_PASSWORD }} run: pnpm build:gui - - name: test build tauri for Linux - if: matrix.platform.name == 'linux+x86-64' + - name: build tauri for Linux + # uses: teaxyz/setup@v0 + if: startsWith(matrix.platform.name, 'linux') # TODO: https://tauri.app/v1/guides/distribution/sign-linux - run: pnpm build:gui + run: | + sudo apt-get install -y libgtk-3-dev webkit2gtk-4.0 libappindicator3-dev librsvg2-dev patchelf pkg-config + sh <(curl https://tea.xyz) build + - name: Get current unix ts - seconds id: date @@ -114,12 +71,12 @@ jobs: "s3://preview.gui.tea.xyz/release/tea_gui_$tag_$platform.$extension" - name: zip .app for MacOS - if: matrix.platform.name == 'darwin+x86-64' || matrix.platform.name == 'darwin+aarch64' + if: startsWith(matrix.platform.name, 'darwin') run: | cd ./modules/gui/src-tauri/target/release/bundle/macos/ && zip -r tea.zip tea.app - name: publish .zip(.app) for MacOS - if: matrix.platform.name == 'darwin+x86-64' || matrix.platform.name == 'darwin+aarch64' + if: startsWith(matrix.platform.name, 'darwin') env: platform: ${{ steps.build_platform.outputs.build_platform }} extension: ${{ steps.build_platform.outputs.extension }} @@ -140,7 +97,7 @@ jobs: - name: Slack Notification for .app Mac run: ./.github/notify-slack.js - if: matrix.platform.name == 'darwin+x86-64' || matrix.platform.name == 'darwin+aarch64' + if: startsWith(matrix.platform.name, 'darwin') env: SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} PLATFORM: ${{ matrix.platform.name }} diff --git a/README.md b/README.md index df0ec2e..58f57aa 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,6 @@ For better documentation checkout this [notion](https://www.notion.so/teaxyz/tea | nodejs.org | >=16 | | pnpm.io | >=7.18.2 | | rust-lang.org | >=1.62 | -| freedesktop.org/pkg-config | >=0.29 | # Getting Started ```sh From 6e50ff195b8dc51b96e357de4aaa0c0e8a1eb9df Mon Sep 17 00:00:00 2001 From: neil Date: Fri, 6 Jan 2023 10:30:21 +0800 Subject: [PATCH 22/22] fix build --- .github/workflows/ci.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6c5db02..17c6a6b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -67,8 +67,6 @@ jobs: steps: - uses: actions/checkout@v3 - name: build tauri for Linux - # uses: teaxyz/setup@v0 - if: startsWith(matrix.platform.name, 'linux') run: | sudo apt-get install -y libgtk-3-dev webkit2gtk-4.0 libappindicator3-dev librsvg2-dev patchelf pkg-config sh <(curl https://tea.xyz) build