Compare commits
25 Commits
76f0ec74b5
...
01de23a036
| Author | SHA1 | Date | |
|---|---|---|---|
| 01de23a036 | |||
| aef93ef821 | |||
| 72f46df4d1 | |||
| 50c56e87ff | |||
| a7d65f0e3c | |||
| 649b49a732 | |||
| b887b69997 | |||
| 687a2958c0 | |||
| a7fe94abec | |||
| adb539350f | |||
| d870b7c1f1 | |||
| edd5a69cd4 | |||
| 6343f1de4d | |||
| 3f581ea8e9 | |||
| 10bfcf0727 | |||
| 6b5383ba24 | |||
| 6b5d669f64 | |||
| 40d66d356b | |||
| c665c19cf3 | |||
| b05a7324d6 | |||
| e8cbf6e146 | |||
| 472fa8d907 | |||
| ddc43e4b42 | |||
| 8d02eb380d | |||
| 4c70dce568 |
@@ -2,16 +2,15 @@ name: Deploy
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
tags:
|
||||||
- release
|
- "v[0-9]+.[0-9]+.[0-9]+"
|
||||||
# tags:
|
|
||||||
# - "v[0-9]+.[0-9]+.[0-9]+"
|
|
||||||
paths:
|
paths:
|
||||||
- ".gitea/workflows/deploy-client.yml"
|
- ".gitea/workflows/deploy-client.yml"
|
||||||
- "client/**"
|
- "client/**"
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
publish-web:
|
publish-windows:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
@@ -27,48 +26,55 @@ jobs:
|
|||||||
persist-credentials: false
|
persist-credentials: false
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
run: docker build -t chad-client ./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
|
|
||||||
|
|
||||||
- name: Run
|
|
||||||
run: |
|
run: |
|
||||||
docker run -d \
|
docker build \
|
||||||
--name chad-client \
|
-t chad-client-windows-builder \
|
||||||
--network traefik \
|
-f ./client/Dockerfile.windows \
|
||||||
--label "traefik.enable=true" \
|
./client \
|
||||||
--label "traefik.http.routers.chad-client.rule=Host(\`chad.koptilnya.xyz\`)" \
|
--build-arg COMMIT_SHA=${{ gitea.sha }} \
|
||||||
--label "traefik.http.routers.chad-client.entrypoints=websecure" \
|
--build-arg API_BASE_URL=${{ vars.API_BASE_URL }} \
|
||||||
--label "traefik.http.routers.chad-client.tls.certresolver=myresolver" \
|
--build-arg TAURI_SIGNING_PRIVATE_KEY=${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}
|
||||||
--label "traefik.http.services.chad-client.loadbalancer.server.port=80" \
|
|
||||||
chad-client:latest
|
|
||||||
|
|
||||||
publish-tauri:
|
docker create --name chad-client-windows-container chad-client-windows-builder
|
||||||
runs-on: windows-latest
|
docker cp chad-client-windows-container:/app/src-tauri/target/x86_64-pc-windows-msvc/release/bundle/nsis ./nsis
|
||||||
steps:
|
docker rm chad-client-windows-container
|
||||||
- uses: actions/checkout@v4
|
|
||||||
|
|
||||||
- name: setup node
|
- name: Publish
|
||||||
uses: actions/setup-node@v4
|
uses: akkuman/gitea-release-action@v1
|
||||||
with:
|
with:
|
||||||
node-version: lts/*
|
files: |
|
||||||
|
nsis/**
|
||||||
|
draft: true
|
||||||
|
|
||||||
- name: install Rust stable
|
# publish-web:
|
||||||
uses: dtolnay/rust-toolchain@stable
|
# runs-on: ubuntu-latest
|
||||||
|
|
||||||
- name: install frontend dependencies
|
# steps:
|
||||||
run: yarn install
|
# - name: Keyscan
|
||||||
|
# run: |
|
||||||
|
# ssh-keyscan git.koptilnya.xyz >> ~/.ssh/known_hosts
|
||||||
|
|
||||||
- uses: tauri-apps/tauri-action@v1
|
# - name: Checkout
|
||||||
env:
|
# uses: actions/checkout@v4
|
||||||
GITHUB_TOKEN: ${{ secrets.TOKEN }}
|
# with:
|
||||||
with:
|
# ssh-key: ${{ secrets.SSH_PRIVATE_KEY }}
|
||||||
tagName: app-v__VERSION__
|
# ssh-strict: false
|
||||||
releaseName: "App v__VERSION__"
|
# persist-credentials: false
|
||||||
releaseBody: "See the assets to download this version and install."
|
|
||||||
releaseDraft: true
|
# - name: Build
|
||||||
projectPath: "./client"
|
# run: docker build -t chad-client -f ./client/Dockerfile.web ./client --build-arg COMMIT_SHA=${{ gitea.sha }} --build-arg API_BASE_URL=${{ vars.API_BASE_URL }}
|
||||||
githubBaseUrl: "https://git.koptilnya.xyz/api/v1"
|
|
||||||
isGitea: true
|
# - name: Stop old container
|
||||||
prerelease: false
|
# run: docker rm -f chad-client || true
|
||||||
|
|
||||||
|
# - name: Run
|
||||||
|
# run: |
|
||||||
|
# docker run -d \
|
||||||
|
# --name chad-client \
|
||||||
|
# --network traefik \
|
||||||
|
# --label "traefik.enable=true" \
|
||||||
|
# --label "traefik.http.routers.chad-client.rule=Host(\`chad.koptilnya.xyz\`)" \
|
||||||
|
# --label "traefik.http.routers.chad-client.entrypoints=websecure" \
|
||||||
|
# --label "traefik.http.routers.chad-client.tls.certresolver=myresolver" \
|
||||||
|
# --label "traefik.http.services.chad-client.loadbalancer.server.port=80" \
|
||||||
|
# chad-client:latest
|
||||||
|
|||||||
40
client/Dockerfile.windows
Normal file
40
client/Dockerfile.windows
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
FROM node:lts
|
||||||
|
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
|
RUN corepack enable yarn
|
||||||
|
RUN yarn set version stable
|
||||||
|
|
||||||
|
COPY package.json yarn.lock .yarnrc.yml ./
|
||||||
|
|
||||||
|
RUN yarn install
|
||||||
|
COPY . .
|
||||||
|
|
||||||
|
ARG COMMIT_SHA=unknown
|
||||||
|
ARG API_BASE_URL
|
||||||
|
ARG TAURI_SIGNING_PRIVATE_KEY
|
||||||
|
|
||||||
|
ENV COMMIT_SHA=$COMMIT_SHA \
|
||||||
|
API_BASE_URL=$API_BASE_URL \
|
||||||
|
TAURI_SIGNING_PRIVATE_KEY=$TAURI_SIGNING_PRIVATE_KEY \
|
||||||
|
TAURI_SIGNING_PRIVATE_KEY_PASSWORD=
|
||||||
|
|
||||||
|
RUN apt update && apt install -y \
|
||||||
|
nsis \
|
||||||
|
clang \
|
||||||
|
lld \
|
||||||
|
llvm
|
||||||
|
|
||||||
|
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
|
||||||
|
|
||||||
|
ENV PATH=/root/.cargo/bin:$PATH
|
||||||
|
|
||||||
|
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 node scripts/generate-updater.js
|
||||||
|
|
||||||
|
RUN ls -la
|
||||||
41
client/scripts/generate-updater.mjs
Normal file
41
client/scripts/generate-updater.mjs
Normal file
@@ -0,0 +1,41 @@
|
|||||||
|
import fs from 'node:fs'
|
||||||
|
import path from 'node:path'
|
||||||
|
import { fileURLToPath } from 'node:url'
|
||||||
|
|
||||||
|
const __filename = fileURLToPath(import.meta.url)
|
||||||
|
const __dirname = path.dirname(__filename)
|
||||||
|
|
||||||
|
const TAURI_CONF = path.resolve(__dirname, '../src-tauri/tauri.conf.json')
|
||||||
|
const OUTPUT = path.resolve(__dirname, '../updater.json')
|
||||||
|
|
||||||
|
const PLATFORM = 'windows-x86_64'
|
||||||
|
const BASE_URL = 'https://git.koptilnya.xyz/opti1337/chad/releases/download/latest'
|
||||||
|
|
||||||
|
const tauriConfRaw = fs.readFileSync(TAURI_CONF, 'utf8')
|
||||||
|
const tauriConf = JSON.parse(tauriConfRaw)
|
||||||
|
const version = tauriConf.package.version
|
||||||
|
|
||||||
|
const SIG_FILE = path.resolve(
|
||||||
|
__dirname,
|
||||||
|
`../src-tauri/target/release/bundle/nsis/chad_${version}_x64-setup.exe.sig`,
|
||||||
|
)
|
||||||
|
|
||||||
|
const signature = fs.readFileSync(SIG_FILE, 'utf8').trim()
|
||||||
|
|
||||||
|
const installerName = `chad_${version}_x64-setup.exe`
|
||||||
|
|
||||||
|
const updater = {
|
||||||
|
pub_date: new Date().toISOString(),
|
||||||
|
version,
|
||||||
|
platforms: {
|
||||||
|
[PLATFORM]: {
|
||||||
|
url: `${BASE_URL}/${installerName}`,
|
||||||
|
signature,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
notes: '',
|
||||||
|
}
|
||||||
|
|
||||||
|
fs.writeFileSync(OUTPUT, JSON.stringify(updater, null, 2), 'utf8')
|
||||||
|
|
||||||
|
console.log('updater.json generated')
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"$schema": "../node_modules/@tauri-apps/cli/config.schema.json",
|
"$schema": "../node_modules/@tauri-apps/cli/config.schema.json",
|
||||||
"productName": "chad",
|
"productName": "chad",
|
||||||
"version": "0.2.5-rc.2",
|
"version": "0.2.6",
|
||||||
"identifier": "xyz.koptilnya.chad",
|
"identifier": "xyz.koptilnya.chad",
|
||||||
"build": {
|
"build": {
|
||||||
"frontendDist": "../.output/public",
|
"frontendDist": "../.output/public",
|
||||||
@@ -44,9 +44,9 @@
|
|||||||
},
|
},
|
||||||
"plugins": {
|
"plugins": {
|
||||||
"updater": {
|
"updater": {
|
||||||
"pubkey": "dW50cnVzdGVkIGNvbW1lbnQ6IG1pbmlzaWduIHB1YmxpYyBrZXk6IDI3NDM5Q0I4MDI5M0MyRjQKUldUMHdwTUN1SnhESjBoUFpuWkJxRzFqcWJxdTY4UkNvMmUzcHFnZnJtbSs3WmJoUmhxQ3R5bWYK",
|
"pubkey": "dW50cnVzdGVkIGNvbW1lbnQ6IG1pbmlzaWduIHB1YmxpYyBrZXk6IEU3MzkxMzM3RkQ3NTg4QUQKUldTdGlIWDlOeE01NStIak9VbmZTTm9HY2NyNUQrVXB5ZEdIN1BkK2lhYW9zWkNCQnZQSjRmelIK",
|
||||||
"endpoints": [
|
"endpoints": [
|
||||||
"https://git.koptilnya.xyz/opti1337/chad/releases/download/latest/latest.json"
|
"https://git.koptilnya.xyz/opti1337/chad/releases/download/latest/updater.json"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user