mirror of
https://github.com/ivabus/gui
synced 2025-04-24 06:27:09 +03:00
192 lines
5.8 KiB
YAML
192 lines
5.8 KiB
YAML
name: "deploy"
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
- notorize
|
|
|
|
|
|
jobs:
|
|
changes:
|
|
runs-on: ubuntu-latest
|
|
outputs:
|
|
svelte: ${{steps.svelte.outputs.src}}
|
|
tauri: ${{steps.tauri.outputs.src}}
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
- uses: dorny/paths-filter@v2
|
|
id: svelte
|
|
with:
|
|
filters: |
|
|
src:
|
|
- 'modules/gui/src/**'
|
|
- 'modules/ui/**'
|
|
- uses: dorny/paths-filter@v2
|
|
id: tauri
|
|
with:
|
|
filters: |
|
|
src:
|
|
- 'modules/gui/src-tauri/**'
|
|
- 'modules/gui/src/**'
|
|
- 'modules/ui/src/**'
|
|
build_svelte:
|
|
needs: changes
|
|
if: needs.changes.outputs.svelte == 'true'
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
with:
|
|
persist-credentials: false
|
|
- name: build tauri for Linux
|
|
if: startsWith(matrix.platform.name, 'linux')
|
|
uses: docker://getneil/tea-builder:latest
|
|
|
|
build_tauri:
|
|
needs: changes
|
|
if: needs.changes.outputs.tauri == 'true'
|
|
runs-on: ${{ matrix.platform.os }}
|
|
strategy:
|
|
matrix:
|
|
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@v3
|
|
- uses: teaxyz/setup@v0
|
|
|
|
- name: build tauri for MacOS
|
|
if: startsWith(matrix.platform.name, 'darwin')
|
|
run: tea -ES xc build
|
|
|
|
# git on Linux panics tea --sync otherwise
|
|
- run: git config --global --add safe.directory $TEA_PREFIX
|
|
|
|
- name: build tauri for Linux
|
|
if: startsWith(matrix.platform.name, 'linux')
|
|
# TODO: https://tauri.app/v1/guides/distribution/sign-linux
|
|
uses: docker://getneil/tea-builder:latest
|
|
|
|
- run: |
|
|
tar -czvf artifacts.tgz -C ./modules/gui/src-tauri/target/release/bundle .
|
|
|
|
- name: upload artifacts
|
|
uses: actions/upload-artifact@v3
|
|
with:
|
|
name: ${{ matrix.platform.name }}
|
|
path: artifacts.tgz
|
|
if-no-files-found: error
|
|
|
|
notorize_tauri:
|
|
needs: [build_tauri]
|
|
runs-on: macos-11
|
|
steps:
|
|
- run: >
|
|
true
|
|
|
|
upload:
|
|
needs: [build_tauri, notorize_tauri]
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
matrix:
|
|
platform:
|
|
- darwin+x86-64
|
|
- linux+x86-64
|
|
- darwin+aarch64
|
|
# - linux+aarch64
|
|
steps:
|
|
- uses: actions/download-artifact@v3
|
|
with:
|
|
name: ${{ matrix.platform }}
|
|
|
|
- run: tar xzf artifacts.tgz
|
|
|
|
- name: Get current unix ts - seconds
|
|
id: date
|
|
run: echo "unix_seconds=$(date +'%s')" >> $GITHUB_OUTPUT
|
|
|
|
- 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 platform output
|
|
id: build_platform
|
|
env:
|
|
platform: ${{ matrix.platform }}
|
|
run: |
|
|
BUILD_PLATFORM=$(echo $platform | sed -e "s/darwin+//g" | sed -e "s/linux+//g")
|
|
EXTENSION=dmg
|
|
case $platform in
|
|
"linux+x86-64")
|
|
BUILD_PLATFORM="amd64"
|
|
EXTENSION="deb"
|
|
;;
|
|
"linux+aarch64")
|
|
BUILD_PLATFORM="aarch64"
|
|
EXTENSION="deb"
|
|
;;
|
|
"darwin+aarch64")
|
|
BUILD_PLATFORM="aarch64"
|
|
EXTENSION="dmg"
|
|
;;
|
|
"darwin+x86-64")
|
|
BUILD_PLATFORM="x64"
|
|
EXTENSION="dmg"
|
|
;;
|
|
*)
|
|
echo "Unknown platform $platform"
|
|
exit 1
|
|
;;
|
|
esac
|
|
echo "build_platform=$BUILD_PLATFORM" >> $GITHUB_OUTPUT
|
|
echo "extension=$EXTENSION" >> $GITHUB_OUTPUT
|
|
|
|
- name: zip .app for MacOS
|
|
if: startsWith(matrix.platform, 'darwin')
|
|
run: |
|
|
cd ./macos/ && zip -r tea.zip tea.app
|
|
|
|
# - name: cp package images from prod to gui bucket
|
|
# env:
|
|
# platform: ${{ steps.build_platform.outputs.build_platform }}
|
|
# build_platform: ${{ matrix.platform }}
|
|
# extension: ${{steps.build_platform.outputs.extension}}
|
|
# run: |
|
|
# aws s3 cp "./$extension/tea_0.1.0_$platform.$extension" \
|
|
# "s3://preview.gui.tea.xyz/release/tea_${{ steps.date.outputs.unix_seconds }}_$platform.$extension"
|
|
|
|
# - name: cp package zip for MacOS
|
|
# if: startsWith(matrix.platform, 'darwin')
|
|
# env:
|
|
# platform: ${{ steps.build_platform.outputs.build_platform }}
|
|
# build_platform: ${{ matrix.platform }}
|
|
# run: |
|
|
# aws s3 cp ./macos/tea.zip "s3://preview.gui.tea.xyz/release/tea_${{ steps.date.outputs.unix_seconds }}_$platform.zip"
|
|
# - uses: actions/setup-node@v3
|
|
# with:
|
|
# node-version: 18
|
|
# - name: Slack Notification
|
|
# run: ./.github/notify-slack.js
|
|
# env:
|
|
# SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
|
|
# PLATFORM: ${{ matrix.platform }}
|
|
# EXT: ${{ steps.build_platform.outputs.extension }}
|
|
# 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 }}
|
|
|
|
# - name: Slack Notification for .app Mac
|
|
# run: ./.github/notify-slack.js
|
|
# if: startsWith(matrix.platform, 'darwin')
|
|
# env:
|
|
# SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
|
|
# PLATFORM: ${{ matrix.platform }}
|
|
# EXT: .zip(.app)
|
|
# 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 }}.zip
|