Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
66 changes: 63 additions & 3 deletions .electron-builder.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const config = {
appId: 'co.kr.bugi.electron',
productName: 'bugi',
directories: {
output: 'dist',
output: 'electron-dist',
buildResources: 'buildResources',
},
files: [
Expand Down Expand Up @@ -83,15 +83,75 @@ const config = {
},
],
icon: 'buildResources/icon.png',
artifactName: '${productName}-${version}-${arch}.${ext}',
//publisherName: 'Bugi', #26버전으로 업데이트 되면서 속성 제거됨
artifactName: '거부기린.${ext}',
},
nsis: {
oneClick: false,
allowToChangeInstallationDirectory: true,
createDesktopShortcut: true,
createStartMenuShortcut: true,
},
afterPack: async (context) => {
const fs = require('fs');

const { electronPlatformName, appOutDir } = context;

if (electronPlatformName !== 'darwin') {
return;
}

const {
productFilename,
info: {
_metadata: { electronLanguagesInfoPlistStrings },
},
} = context.packager.appInfo;

const resPath = `${appOutDir}/${productFilename}.app/Contents/Resources/`;

console.log(
'\n> package.json의 "electronLanguagesInfoPlistStrings" 설정을 기반으로 언어 패키지 생성 시작\n',
'\n> electronLanguagesInfoPlistStrings:\n',
electronLanguagesInfoPlistStrings,
'\n\n',
'> ResourcesPath:',
resPath,
);

// APP 언어 패키지 파일 생성
return await Promise.all(
Object.keys(electronLanguagesInfoPlistStrings).map((langKey) => {
const infoPlistStrPath = `${langKey}.lproj/InfoPlist.strings`;
let infos = '';

const langItem = electronLanguagesInfoPlistStrings[langKey];

Object.keys(langItem).forEach((infoKey) => {
infos += `"${infoKey}" = "${langItem[infoKey]}";\n`;
});

return new Promise((resolve) => {
// 디렉토리가 없으면 생성
const dirPath = `${resPath}${langKey}.lproj`;
if (!fs.existsSync(dirPath)) {
fs.mkdirSync(dirPath, { recursive: true });
}

fs.writeFile(`${resPath}${infoPlistStrPath}`, infos, (err) => {
if (err) {
console.error(
`> "${resPath}${infoPlistStrPath}" 생성 실패:`,
err,
);
throw err;
}
console.log(`> "${resPath}${infoPlistStrPath}" 생성 완료.`);
resolve();
});
});
}),
);
},
};

module.exports = config;
18 changes: 12 additions & 6 deletions .github/workflows/electron-build-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,18 @@ jobs:
name: electron-${{ matrix.os }}-${{ github.event.number }}
if-no-files-found: warn
path: |
dist/*.dmg
dist/*.zip
dist/*.exe
dist/*.blockmap
dist/mac/**
dist/mac-arm64/**
# macOS 빌드 결과물
electron-dist/*.dmg
electron-dist/*.zip
electron-dist/*.blockmap
electron-dist/mac/**
electron-dist/mac-arm64/**
# Windows 빌드 결과물
# NSIS 설치 프로그램 (artifactName: 거부기린.${ext})
electron-dist/거부기린.*
# Portable 빌드 결과물 (폴더 형태)
electron-dist/win-ia32-unpacked/**
electron-dist/win-unpacked/**

comment:
needs: build-electron
Expand Down
19 changes: 13 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
{
"name": "electron-app",
"name": "GBGR",
"version": "1.0.0",
"description": "거부기 Electron Application",
"description": "거부기린",
"author": {
"name": "Yerba Team",
"email": "[email protected]"
"name": "GBGR"
},
"homepage": "https://your-project-homepage.com",
"maintainer": "Yerba Team <[email protected]>",
"homepage": "https://bugi.co.kr",
"private": true,
"main": "dist/main/index.cjs",
"engines": {
Expand Down Expand Up @@ -101,5 +99,14 @@
"prettier --write"
],
"*.{json,css,md}": "prettier --write"
},
"electronLanguagesInfoPlistStrings": {
"ko": {
"CFBundleName": "거부기린",
"CFBundleDisplayName": "거부기린",
"NSHumanReadableCopyright": "Copyright © 2025 GBGR",
"NSCameraUsageDescription": "거부기린은 사용자의 자세를 실시간으로 분석하기 위해 카메라에 접근합니다.",
"NSMicrophoneUsageDescription": "거부기린은 사용자의 자세를 실시간으로 분석하기 위해 마이크에 접근합니다."
}
}
}