From 3a62af24d18cb6e9f9a6a8b739b938d837873bac Mon Sep 17 00:00:00 2001 From: Joscha Date: Wed, 22 Jan 2025 13:40:33 +0100 Subject: [PATCH] Set up CI --- .github/workflows/build.yml | 56 +++++++++++++++++++++++++++++++ build | 14 ++++++++ tta-app/src-tauri/tauri.conf.json | 2 +- 3 files changed, 71 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/build.yml create mode 100755 build diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..1026fed --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,56 @@ +name: build + +on: + push: + pull_request: + +defaults: + run: + shell: bash + +jobs: + main: + strategy: + matrix: + os: [ubuntu-latest, windows-latest] + runs-on: ${{ matrix.os }} + steps: + - name: Check out repo + uses: actions/checkout@v4 + + # https://doc.rust-lang.org/cargo/guide/continuous-integration.html#github-actions + - name: Set up rust + run: | + rustup update stable + rustup default stable + + # - name: Set up node + # uses: actions/setup-node@v4 + # with: + # cache: pnpm + + - name: Set up pnpm + uses: pnpm/action-setup@v4 + with: + version: 10 + + # https://github.com/tauri-apps/tauri-action?tab=readme-ov-file#usage + # https://docs.github.com/en/actions/using-github-hosted-runners/using-github-hosted-runners/customizing-github-hosted-runners#installing-software-on-ubuntu-runners + - name: Install tauri dependencies (Linux) + if: ${{ runner.os == 'Linux' }} + run: | + sudo apt update + sudo apt install libwebkit2gtk-4.1-dev + + - name: Build + run: ./build + + - name: Upload binaries + uses: actions/upload-artifact@v4 + with: + name: binaries-${{ matrix.os }} + path: | + target/release/tta-cli + target/release/tta-cli.exe + target/release/tta-app + target/release/tta-app.exe diff --git a/build b/build new file mode 100755 index 0000000..de42787 --- /dev/null +++ b/build @@ -0,0 +1,14 @@ +#!/usr/bin/env bash +set -euo pipefail + +pushd tta-cli +cargo build --release +popd + +pushd tta-app +pnpm install --frozen-lockfile +pnpm tauri build +popd + +echo "tta-cli can be found at target/release/tta-cli" +echo "tta-app can be found at target/release/tta-app" diff --git a/tta-app/src-tauri/tauri.conf.json b/tta-app/src-tauri/tauri.conf.json index ac3f821..e07f86d 100644 --- a/tta-app/src-tauri/tauri.conf.json +++ b/tta-app/src-tauri/tauri.conf.json @@ -22,7 +22,7 @@ } }, "bundle": { - "active": true, + "active": false, "targets": "all", "icon": [ "icons/32x32.png",