👷 ci: Add GitHub Actions workflow for cross-platform builds

This commit is contained in:
2026-06-16 00:14:16 +07:00
parent b8b133c9f2
commit efc810c2e2
7 changed files with 101 additions and 2 deletions
+18 -1
View File
@@ -1,10 +1,27 @@
import { execSync } from 'child_process'
import { defineConfig, externalizeDepsPlugin } from 'electron-vite'
import tailwindcss from '@tailwindcss/vite'
import react from '@vitejs/plugin-react'
function getCommitHash(): string {
if (process.env.GITHUB_SHA) return process.env.GITHUB_SHA.slice(0, 7)
try {
const hash = execSync('git rev-parse --short HEAD').toString().trim()
const dirty = execSync('git status --porcelain').toString().trim().length > 0
return dirty ? `${hash}-dirty` : hash
} catch {
return 'unknown'
}
}
const commitHash = JSON.stringify(getCommitHash())
export default defineConfig({
main: {
plugins: [externalizeDepsPlugin()]
plugins: [externalizeDepsPlugin()],
define: {
__COMMIT_HASH__: commitHash
}
},
preload: {
plugins: [externalizeDepsPlugin()]