mirror of
https://github.com/ivabus/gui
synced 2025-06-08 00:00:27 +03:00
commit
c9f17c398a
4 changed files with 77 additions and 59 deletions
77
.github/workflows/ci.yml
vendored
77
.github/workflows/ci.yml
vendored
|
@ -116,12 +116,19 @@ jobs:
|
||||||
build_tauri:
|
build_tauri:
|
||||||
needs: changes
|
needs: changes
|
||||||
if: needs.changes.outputs.tauri == 'true'
|
if: needs.changes.outputs.tauri == 'true'
|
||||||
|
runs-on: ${{ matrix.platform.os }}
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
matrix:
|
||||||
platform: [macos-latest, ubuntu-latest]
|
platform:
|
||||||
|
- os: macos-11
|
||||||
runs-on: ${{ matrix.platform }}
|
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:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
|
@ -139,15 +146,15 @@ jobs:
|
||||||
with:
|
with:
|
||||||
toolchain: stable
|
toolchain: stable
|
||||||
- name: install dependencies (ubuntu only)
|
- name: install dependencies (ubuntu only)
|
||||||
if: matrix.platform == 'ubuntu-latest'
|
if: matrix.platform.name == 'linux+x86-64'
|
||||||
run: |
|
run: |
|
||||||
sudo apt-get update
|
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
|
- uses: Swatinem/rust-cache@v2
|
||||||
with:
|
with:
|
||||||
# The prefix cache key, this can be changed to start a new cache manually.
|
# The prefix cache key, this can be changed to start a new cache manually.
|
||||||
# default: "v0-rust"
|
# default: "v0-rust"
|
||||||
prefix-key: ${{ matrix.platform }}
|
prefix-key: ${{ matrix.platform.name }}
|
||||||
shared-key: ci
|
shared-key: ci
|
||||||
cache-targets: false
|
cache-targets: false
|
||||||
- name: install app dependencies
|
- name: install app dependencies
|
||||||
|
@ -158,9 +165,22 @@ jobs:
|
||||||
with:
|
with:
|
||||||
path: |
|
path: |
|
||||||
./modules/gui/src-tauri/target
|
./modules/gui/src-tauri/target
|
||||||
key: ${{ matrix.platform }}-build-target
|
key: ${{ matrix.platform.name }}-build-target
|
||||||
restore-keys: |
|
restore-keys: |
|
||||||
${{ matrix.platform }}-build-target
|
${{ matrix.platform.name }}-build-target
|
||||||
|
|
||||||
|
- name: build platform output
|
||||||
|
id: build_platform
|
||||||
|
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
|
- name: test build tauri
|
||||||
run: pnpm --filter gui tauri build
|
run: pnpm --filter gui tauri build
|
||||||
|
@ -171,43 +191,22 @@ jobs:
|
||||||
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
||||||
aws-region: us-east-1
|
aws-region: us-east-1
|
||||||
|
|
||||||
- name: mac-os cp package images from prod to preview bucket
|
- name: cp package images from prod to preview bucket
|
||||||
if: matrix.platform == 'macos-latest'
|
|
||||||
env:
|
env:
|
||||||
prefix: ${{ needs.changes.outputs.preview_folder }}
|
prefix: ${{ needs.changes.outputs.preview_folder }}
|
||||||
|
platform: ${{ steps.build_platform.outputs.build_platform }}
|
||||||
|
extension: ${{ steps.build_platform.outputs.extension }}
|
||||||
run: |
|
run: |
|
||||||
aws s3 cp ./modules/gui/src-tauri/target/release/bundle/dmg/tea_0.1.0_x64.dmg \
|
aws s3 cp "./modules/gui/src-tauri/target/release/bundle/$extension/tea_0.1.0_$platform.$extension" \
|
||||||
"s3://preview.gui.tea.xyz/$prefix/gui.dmg"
|
"s3://preview.gui.tea.xyz/$prefix/gui_$platform.$extension"
|
||||||
|
|
||||||
- name: ubuntu cp package images from prod to preview bucket
|
- name: comment install
|
||||||
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
|
uses: mshick/add-pr-comment@v2
|
||||||
if: matrix.platform == 'ubuntu-latest'
|
|
||||||
with:
|
with:
|
||||||
message-id: ${{ matrix.platform }}-comment-${{steps.prefix.outputs.prefix}}
|
message-id: ${{ matrix.platform.name }}-comment
|
||||||
message: |
|
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)
|
**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
|
```bash
|
||||||
http://preview.gui.tea.xyz.s3-website-us-east-1.amazonaws.com/${{ needs.changes.outputs.preview_folder }}/gui.deb
|
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
|
|
||||||
|
|
||||||
|
|
||||||
- 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
|
copy-paste into a browser to download
|
57
.github/workflows/main.yml
vendored
57
.github/workflows/main.yml
vendored
|
@ -60,12 +60,19 @@ jobs:
|
||||||
build_tauri:
|
build_tauri:
|
||||||
needs: changes
|
needs: changes
|
||||||
if: needs.changes.outputs.tauri == 'true'
|
if: needs.changes.outputs.tauri == 'true'
|
||||||
|
runs-on: ${{ matrix.platform.os }}
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
|
||||||
matrix:
|
matrix:
|
||||||
platform: [macos-latest, ubuntu-latest]
|
platform:
|
||||||
|
- os: macos-11
|
||||||
runs-on: ${{ matrix.platform }}
|
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:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
|
@ -86,11 +93,11 @@ jobs:
|
||||||
with:
|
with:
|
||||||
# The prefix cache key, this can be changed to start a new cache manually.
|
# The prefix cache key, this can be changed to start a new cache manually.
|
||||||
# default: "v0-rust"
|
# default: "v0-rust"
|
||||||
prefix-key: ${{ matrix.platform }}
|
prefix-key: ${{ matrix.platform.name }}
|
||||||
shared-key: prod
|
shared-key: prod
|
||||||
cache-targets: false
|
cache-targets: false
|
||||||
- name: install dependencies (ubuntu only)
|
- name: install dependencies (ubuntu only)
|
||||||
if: matrix.platform == 'ubuntu-latest'
|
if: matrix.platform.name == 'linux+x86-64'
|
||||||
run: |
|
run: |
|
||||||
sudo apt-get update
|
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
|
||||||
|
@ -102,9 +109,9 @@ jobs:
|
||||||
with:
|
with:
|
||||||
path: |
|
path: |
|
||||||
./modules/gui/src-tauri/target
|
./modules/gui/src-tauri/target
|
||||||
key: ${{ matrix.platform }}-build-target-prod
|
key: ${{ matrix.platform.name }}-build-target-prod
|
||||||
restore-keys: |
|
restore-keys: |
|
||||||
${{ matrix.platform }}-build-target-prod
|
${{ matrix.platform.name }}-build-target-prod
|
||||||
|
|
||||||
- name: test build tauri
|
- name: test build tauri
|
||||||
run: pnpm --filter gui tauri build
|
run: pnpm --filter gui tauri build
|
||||||
|
@ -117,20 +124,32 @@ jobs:
|
||||||
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
|
||||||
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
|
||||||
aws-region: us-east-1
|
aws-region: us-east-1
|
||||||
- name: mac-os cp package images from prod to gui bucket
|
|
||||||
if: matrix.platform == 'macos-latest'
|
|
||||||
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
|
|
||||||
|
|
||||||
- name: ubuntu cp package images from prod to gui bucket
|
- name: build platform output
|
||||||
if: matrix.platform == 'ubuntu-latest'
|
id: build_platform
|
||||||
|
env:
|
||||||
|
platform: ${{ matrix.platform.name }}
|
||||||
run: |
|
run: |
|
||||||
aws s3 cp ./modules/gui/src-tauri/target/release/bundle/deb/tea_0.1.0_amd64.deb \
|
BUILD_PLATFORM=$(echo $platform | sed -e "s/darwin+//g" | sed -e "s/linux+//g")
|
||||||
s3://preview.gui.tea.xyz/release/tea_${{ steps.date.outputs.unix_seconds }}.deb
|
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: |
|
||||||
|
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
|
- name: Slack Notification
|
||||||
run: ./.github/notify-slack.js
|
run: ./.github/notify-slack.js
|
||||||
env:
|
env:
|
||||||
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
|
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
|
||||||
PLATFORM: ${{ matrix.platform }}
|
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 }}.${{ matrix.platform == '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 }}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
[package]
|
[package]
|
||||||
name = "app"
|
name = "app"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
description = "A tea.xyz desktop app "
|
description = "A tea.xyz desktop app"
|
||||||
authors = ["you"]
|
authors = ["you"]
|
||||||
license = ""
|
license = ""
|
||||||
repository = ""
|
repository = ""
|
||||||
|
|
|
@ -3,7 +3,7 @@ import Fuse from 'fuse.js';
|
||||||
|
|
||||||
import type { Package, Review, AirtablePost } from '@tea/ui/types';
|
import type { Package, Review, AirtablePost } from '@tea/ui/types';
|
||||||
import type { GUIPackage } from '$libs/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';
|
import { getPackages, getFeaturedPackages, getPackageReviews, getAllPosts } from '@api';
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue