mirror of
https://github.com/YuzuZensai/Discord-Presence-Relay.git
synced 2026-09-14 01:08:50 +00:00
👷 ci: Add GitHub Actions workflow for cross-platform builds
This commit is contained in:
+18
-1
@@ -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()]
|
||||
|
||||
Reference in New Issue
Block a user