diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 601c543..7e7c23b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -67,8 +67,15 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 + - name: cache gui linux + uses: actions/cache@v3 + with: + key: linux+x86-64-20-pnpm-cargo + path: | + ./pnpm + ./target - name: build tauri for Linux - uses: docker://getneil/tea-builder:latest + uses: ./devops/linux-builder - uses: aws-actions/configure-aws-credentials@v1 with: aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} @@ -120,10 +127,24 @@ jobs: - uses: teaxyz/setup@v0 if: startsWith(matrix.platform.name, 'darwin') + - name: cache gui build + # TODO: cache issue in our self-hosted macos runner ESPIPE: invalid seek, read + # but its ok to ignore, its still the fastest builder + # NOTE: enabling cache in the self hosted runner slows down the pipeline by 4m because post-cache builder error ^ + if: startsWith(matrix.platform.name, 'linux') || matrix.platform.name == 'darwin+x86-64' + uses: actions/cache@v3 + with: + key: ${{matrix.platform.name}}-pnpm-cargo + path: | + ./pnpm + ./target + # - name: build tauri for Linux + # uses: ./devops/linux-build - name: build tauri for MacOS if: startsWith(matrix.platform.name, 'darwin') # FROM: https://tauri.app/v1/guides/distribution/sign-macos env: + CARGO_TARGET_DIR: ${{ github.workspace }}/target GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} ENABLE_CODE_SIGNING: ${{ secrets.GUI_APPLE_CERTIFICATE }} APPLE_CERTIFICATE: ${{ secrets.GUI_APPLE_CERTIFICATE }} @@ -134,9 +155,9 @@ jobs: - 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 + uses: ./devops/linux-builder - - run: tar -czvf artifacts.tgz -C ./modules/gui/src-tauri/target/release/bundle . + - run: tar -czvf artifacts.tgz -C ./target/release/bundle . - name: upload artifacts uses: actions/upload-artifact@v3 diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index ae25d6b..89f0942 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -36,6 +36,13 @@ jobs: - uses: actions/checkout@v3 with: persist-credentials: false + - name: cache gui linux + uses: actions/cache@v3 + with: + key: linux+x86-64-20-pnpm-cargo-main + path: | + ./pnpm + ./target - name: build tauri for Linux if: startsWith(matrix.platform.name, 'linux') uses: docker://getneil/tea-builder:latest @@ -59,11 +66,22 @@ jobs: - uses: actions/checkout@v3 - uses: teaxyz/setup@v0 if: startsWith(matrix.platform.name, 'darwin') - + - name: cache gui build + # TODO: cache issue in our self-hosted macos runner ESPIPE: invalid seek, read + # but its ok to ignore, its still the fastest builder + # NOTE: enabling cache in the self hosted runner slows down the pipeline by 4m because post-cache builder error ^ + if: startsWith(matrix.platform.name, 'linux') || matrix.platform.name == 'darwin+x86-64' + uses: actions/cache@v3 + with: + key: ${{matrix.platform.name}}-pnpm-cargo-main + path: | + ./pnpm + ./target - name: build tauri for MacOS if: startsWith(matrix.platform.name, 'darwin') run: tea -ES xc build env: + CARGO_TARGET_DIR: ${{ github.workspace }}/target GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} ENABLE_CODE_SIGNING: ${{ secrets.GUI_APPLE_CERTIFICATE }} APPLE_CERTIFICATE: ${{ secrets.GUI_APPLE_CERTIFICATE }} @@ -73,9 +91,9 @@ jobs: - 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 + uses: ./devops/linux-builder - - run: tar -czvf artifacts.tgz -C ./modules/gui/src-tauri/target/release/bundle . + - run: tar -czvf artifacts.tgz -C ./target/release/bundle . - name: upload artifacts uses: actions/upload-artifact@v3 diff --git a/.gitignore b/.gitignore index 21bcdde..eeab4fb 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ node_modules yarn-error.log .DS_Store -.pnpm-store \ No newline at end of file +.pnpm-store +target \ No newline at end of file diff --git a/devops/linux-builder/Dockerfile b/devops/linux-builder/Dockerfile new file mode 100644 index 0000000..f1be13e --- /dev/null +++ b/devops/linux-builder/Dockerfile @@ -0,0 +1,5 @@ +FROM getneil/tea-builder:bincache + +COPY entrypoint.sh /entrypoint.sh + +ENTRYPOINT ["/entrypoint.sh"] \ No newline at end of file diff --git a/devops/linux-builder/action.yml b/devops/linux-builder/action.yml new file mode 100644 index 0000000..e1c90cb --- /dev/null +++ b/devops/linux-builder/action.yml @@ -0,0 +1,18 @@ +name: 'build-gui-linux' +description: 'Tea GUI builder for linux' +# TODO: cache +# inputs: +# who-to-greet: # id of input +# description: 'Who to greet' +# required: true +# default: 'World' +# outputs: +# time: # id of output +# description: 'The time we greeted you' +runs: + using: 'docker' + image: 'Dockerfile' + env: + CARGO_TARGET_DIR: /github/workspace/target + args: + - ${{ inputs.who-to-greet }} \ No newline at end of file diff --git a/devops/linux-builder/entrypoint.sh b/devops/linux-builder/entrypoint.sh new file mode 100755 index 0000000..2af50bd --- /dev/null +++ b/devops/linux-builder/entrypoint.sh @@ -0,0 +1,3 @@ +#!/bin/sh -l +tea -SE xc setup +tea -SE xc build \ No newline at end of file diff --git a/devops/ubuntu/Dockerfile b/devops/ubuntu/Dockerfile index 27822a2..6b6d640 100644 --- a/devops/ubuntu/Dockerfile +++ b/devops/ubuntu/Dockerfile @@ -7,11 +7,21 @@ RUN apt-get install -y libgtk-3-dev webkit2gtk-4.0 RUN apt-get install -y --fix-missing libappindicator3-dev librsvg2-dev RUN apt-get install -y --fix-missing patchelf pkg-config curl libatomic1 gcc-multilib libsoup-gnome2.4 RUN apt-get install -y libjavascriptcoregtk-4.0-dev wget + RUN curl https://tea.xyz -o ./tea.sh RUN chmod +x tea.sh RUN ./tea.sh --yes -# Copies your code file from your action repository to the filesystem path `/` of the container -COPY entrypoint.sh /entrypoint.sh + +RUN mkdir -p /tmp/app/.git +COPY README.md /tmp/app/README.md +COPY package.json /tmp/app/package.json + +RUN tea +nodejs.org +RUN tea +pnpm.io +RUN tea +rust-lang.org +RUN tea +rust-lang.org/cargo +RUN tea +xcfile.dev # Code file to execute when the docker container starts up (`entrypoint.sh`) +COPY entrypoint.sh /entrypoint.sh ENTRYPOINT ["/entrypoint.sh"] \ No newline at end of file diff --git a/modules/gui/src/routes/+layout.svelte b/modules/gui/src/routes/+layout.svelte index 82fd45b..1da402c 100644 --- a/modules/gui/src/routes/+layout.svelte +++ b/modules/gui/src/routes/+layout.svelte @@ -74,13 +74,6 @@ padding: 0vw 3.33vw; } } - header { - position: absolute; - top: 0px; - left: 0px; - width: 100%; - height: 40px; - } slot { z-index: 1;