From 4c70dce568f35c17d2cb047110bbda6a58a2d6a3 Mon Sep 17 00:00:00 2001 From: opti1337 Date: Mon, 22 Dec 2025 21:07:20 +0600 Subject: [PATCH] build --- .gitea/workflows/deploy-client.yml | 37 ++++++++++----------------- client/{Dockerfile => Dockerfile.web} | 0 client/Dockerfile.windows | 32 +++++++++++++++++++++++ 3 files changed, 45 insertions(+), 24 deletions(-) rename client/{Dockerfile => Dockerfile.web} (100%) create mode 100644 client/Dockerfile.windows diff --git a/.gitea/workflows/deploy-client.yml b/.gitea/workflows/deploy-client.yml index c90770b..c4d8004 100644 --- a/.gitea/workflows/deploy-client.yml +++ b/.gitea/workflows/deploy-client.yml @@ -27,7 +27,7 @@ jobs: persist-credentials: false - name: Build - run: docker build -t chad-client ./client --build-arg COMMIT_SHA=${{ gitea.sha }} --build-arg API_BASE_URL=${{ vars.API_BASE_URL }} + run: docker build -t chad-client -f Dockerfile.web ./client --build-arg COMMIT_SHA=${{ gitea.sha }} --build-arg API_BASE_URL=${{ vars.API_BASE_URL }} - name: Stop old container run: docker rm -f chad-client || true @@ -45,30 +45,19 @@ jobs: chad-client:latest publish-tauri: - runs-on: windows-latest + runs-on: ubuntu-latest + steps: - - uses: actions/checkout@v4 + - name: Keyscan + run: | + ssh-keyscan git.koptilnya.xyz >> ~/.ssh/known_hosts - - name: setup node - uses: actions/setup-node@v4 + - name: Checkout + uses: actions/checkout@v4 with: - node-version: lts/* + ssh-key: ${{ secrets.SSH_PRIVATE_KEY }} + ssh-strict: false + persist-credentials: false - - name: install Rust stable - uses: dtolnay/rust-toolchain@stable - - - name: install frontend dependencies - run: yarn install - - - uses: tauri-apps/tauri-action@v1 - env: - GITHUB_TOKEN: ${{ secrets.TOKEN }} - with: - tagName: app-v__VERSION__ - releaseName: "App v__VERSION__" - releaseBody: "See the assets to download this version and install." - releaseDraft: true - projectPath: "./client" - githubBaseUrl: "https://git.koptilnya.xyz/api/v1" - isGitea: true - prerelease: false + - name: Build + run: docker build -t chad-client -f Dockerfile.windows ./client --build-arg COMMIT_SHA=${{ gitea.sha }} --build-arg API_BASE_URL=${{ vars.API_BASE_URL }} diff --git a/client/Dockerfile b/client/Dockerfile.web similarity index 100% rename from client/Dockerfile rename to client/Dockerfile.web diff --git a/client/Dockerfile.windows b/client/Dockerfile.windows new file mode 100644 index 0000000..5059060 --- /dev/null +++ b/client/Dockerfile.windows @@ -0,0 +1,32 @@ +FROM ubuntu:latest + +WORKDIR /app + +RUN corepack enable +RUN yarn set version stable + +COPY package.json yarn.lock .yarnrc.yml ./ + +RUN yarn install +COPY . . + +ARG COMMIT_SHA=unknown +ARG API_BASE_URL + +ENV COMMIT_SHA=$COMMIT_SHA \ + API_BASE_URL=$API_BASE_URL + +RUN apt update && apt install -y \ + nsis \ + lld \ + llvm + +RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh + +RUN rustup target add x86_64-pc-windows-msvc + +RUN cargo install --locked cargo-xwin + +RUN yarn tauri build --runner cargo-xwin --target x86_64-pc-windows-msvc + +RUN ls -la