mirror of
https://github.com/ivabus/gui
synced 2025-06-07 07:40: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:
|
||||
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
|
||||
|
||||
|
@ -139,15 +146,15 @@ 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
|
||||
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 }}
|
||||
prefix-key: ${{ matrix.platform.name }}
|
||||
shared-key: ci
|
||||
cache-targets: false
|
||||
- name: install app dependencies
|
||||
|
@ -158,9 +165,22 @@ 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: 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
|
||||
run: pnpm --filter gui tauri build
|
||||
|
@ -171,43 +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 == 'macos-latest'
|
||||
- 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_x64.dmg \
|
||||
"s3://preview.gui.tea.xyz/$prefix/gui.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_$platform.$extension"
|
||||
|
||||
- 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
|
||||
- name: comment install
|
||||
uses: mshick/add-pr-comment@v2
|
||||
if: matrix.platform == 'ubuntu-latest'
|
||||
with:
|
||||
message-id: ${{ matrix.platform }}-comment-${{steps.prefix.outputs.prefix}}
|
||||
message-id: ${{ matrix.platform.name }}-comment
|
||||
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
|
||||
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
|
||||
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
|
55
.github/workflows/main.yml
vendored
55
.github/workflows/main.yml
vendored
|
@ -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,32 @@ 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")
|
||||
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: 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 }}
|
||||
extension: ${{steps.build_platform.outputs.extension}}
|
||||
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
|
||||
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 }}.${{ steps.build_platform.outputs.extension }}
|
||||
|
|
|
@ -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 = ""
|
||||
|
|
|
@ -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';
|
||||
|
||||
|
|
Loading…
Reference in a new issue