diff --git a/.github/workflows/build-validation.yml b/.github/workflows/build.yml similarity index 73% rename from .github/workflows/build-validation.yml rename to .github/workflows/build.yml index f1e7d57..c275f6c 100644 --- a/.github/workflows/build-validation.yml +++ b/.github/workflows/build.yml @@ -1,4 +1,4 @@ -name: Test Build Frontend +name: Build on: push: @@ -15,30 +15,21 @@ jobs: image: ubuntu:22.04 steps: - - name: Install git - run: apt update && apt install -y git + - name: Update APT + run: apt update + + - name: Install Git and dependencies for Tauri + run: apt install -y git libwebkit2gtk-4.0-dev build-essential curl wget file libssl-dev libgtk-3-dev libayatana-appindicator3-dev librsvg2-dev - name: Checkout Repository - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Get Variables run: | git config --global --add safe.directory /__w/stort/stort echo "TAG_NAME=commit-$(date +%Y%m%d)-$(git rev-parse --short HEAD)" >> $GITHUB_ENV - - name: Update packages - run: apt update && apt upgrade -y - - - name: Install dependencies for Tauri - run: apt install -y libwebkit2gtk-4.0-dev build-essential curl wget file libssl-dev libgtk-3-dev libayatana-appindicator3-dev librsvg2-dev - - - name: Install Rust - run: | - curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh - . "$HOME/.cargo/env" - rustup update - - - name: Install mise + - name: Install Mise run: | install -dm 755 /etc/apt/keyrings wget -qO - https://mise.jdx.dev/gpg-key.pub | gpg --dearmor | tee /etc/apt/keyrings/mise-archive-keyring.gpg 1> /dev/null @@ -46,16 +37,19 @@ jobs: apt update apt install -y mise - - name: Install mise tools + - name: Install Mise Tools run: | mise install mise settings set experimental true - - name: Install bun packages + - name: Install Bun Packages run: mise exec bun --command 'bun install' - name: Build Tauri - run: mise exec bun --command 'bun run tauri build' + run: | + curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y + . "$HOME/.cargo/env" + mise exec bun --command 'bun run tauri build' - name: Create Release id: create_release @@ -68,7 +62,7 @@ jobs: draft: false prerelease: false - - name: Upload build to release + - name: Upload Build to Release uses: actions/upload-release-asset@v1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/testing.yml b/.github/workflows/testing.yml new file mode 100644 index 0000000..f43bc06 --- /dev/null +++ b/.github/workflows/testing.yml @@ -0,0 +1,32 @@ +name: Testing + +on: + push: + branches: + - "*" + +permissions: + contents: write + +jobs: + testing: + runs-on: ubuntu-latest + container: + image: ubuntu:22.04 + + steps: + - name: Debug shell + run: | + echo $0 + echo $SHELL + + - name: Debug Bash shell + run: | + echo $0 + echo $SHELL + shell: bash + + - name: Debug sh Shell + run: echo $0 + echo $SHELL + shell: sh diff --git a/build2.sh b/build2.sh new file mode 100644 index 0000000..a85634c --- /dev/null +++ b/build2.sh @@ -0,0 +1,26 @@ +#!/bin/bash + +IMAGE_NAME="ubuntu:22.04" +HOST_PROJECT_DIR="$PWD" +CONTAINER_PROJECT_DIR="/app" +HOST_OUTPUT_DIR="$PWD/src-tauri/target/release/bundle/appimage" +CONTAINER_OUTPUT_DIR="$CONTAINER_PROJECT_DIR/src-tauri/target/release/bundle/appimage" +USER_ID=$(id -u) +GROUP_ID=$(id -g) + +docker pull $IMAGE_NAME + +# run the docker image and remove on completion +docker run --rm -it \ + -v "$HOST_PROJECT_DIR":$CONTAINER_PROJECT_DIR \ + $IMAGE_NAME \ + /bin/bash -c " + + # update packages + apt update && apt install curl -y && \ + + curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y && \ + echo $HOME && \ + source "/root/.cargo/env" && \ + cargo --version + "