Skip to content

Commit 3a4e217

Browse files
committed
[feat/#123] 아이콘 추가, 다운로드 URL 설정, 자동 업데이트 코드 추가, github action 디스코드 알림 수정
1 parent c62536b commit 3a4e217

File tree

7 files changed

+67
-16
lines changed

7 files changed

+67
-16
lines changed

.github/workflows/main.yml

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ jobs:
2323
- name: Get commit message and author
2424
id: get_commit_info
2525
run: |
26-
echo "::set-output name=message::$(git log --format=%s -n 1)"
27-
echo "::set-output name=author::$(git log --format=%an -n 1)"
28-
echo "::set-output name=author_username::$(git log --format=%ae -n 1 | cut -d@ -f1)"
26+
echo "message=$(git log --format=%s -n 1)" >> $GITHUB_OUTPUT
27+
echo "author=$(git log --format=%an -n 1)" >> $GITHUB_OUTPUT
28+
echo "author_username=$(git log --format=%ae -n 1 | cut -d@ -f1)" >> $GITHUB_OUTPUT
2929
3030
- name: Install dependencies
3131
run: yarn install
@@ -39,6 +39,8 @@ jobs:
3939
VITE_OAUTH_KAKAO_REST_API_KEY: ${{ secrets.VITE_OAUTH_KAKAO_REST_API_KEY }}
4040
VITE_OAUTH_KAKAO_CLIENT_SECRET_CODE: ${{ secrets.VITE_OAUTH_KAKAO_CLIENT_SECRET_CODE }}
4141
VITE_OAUTH_KAKAO_REDIRECT_URI: ${{ secrets.VITE_OAUTH_KAKAO_REDIRECT_URI }}
42+
VITE_DMG_DOWNLOAD_URL: ${{ secrets.VITE_DMG_DOWNLOAD_URL }}
43+
VITE_EXE_DOWNLOAD_URL: ${{ secrets.VITE_EXE_DOWNLOAD_URL }}
4244
run: |
4345
echo "Building web app..."
4446
yarn build
@@ -61,8 +63,11 @@ jobs:
6163
VITE_OAUTH_KAKAO_REST_API_KEY: ${{ secrets.VITE_OAUTH_KAKAO_REST_API_KEY }}
6264
VITE_OAUTH_KAKAO_CLIENT_SECRET_CODE: ${{ secrets.VITE_OAUTH_KAKAO_CLIENT_SECRET_CODE }}
6365
VITE_OAUTH_KAKAO_REDIRECT_URI: ${{ secrets.VITE_OAUTH_KAKAO_REDIRECT_URI }}
66+
VITE_DMG_DOWNLOAD_URL: ${{ secrets.VITE_DMG_DOWNLOAD_URL }}
67+
VITE_EXE_DOWNLOAD_URL: ${{ secrets.VITE_EXE_DOWNLOAD_URL }}
6468
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6569
run: yarn electron:publish
70+
6671
# CloudFront 캐시 무효화
6772
invalidate-cache:
6873
runs-on: ubuntu-20.04
@@ -78,7 +83,6 @@ jobs:
7883
echo "Invalidating CloudFront cache..."
7984
aws cloudfront create-invalidation --region ap-northeast-2 --distribution-id $CLOUDFRONT_DISTRIBUTION_ID --paths "/*"
8085
81-
8286
# Discord 알림 - 성공
8387
notify-success:
8488
runs-on: ubuntu-20.04
@@ -95,10 +99,10 @@ jobs:
9599
args: |
96100
🎉 배포가 성공적으로 완료되었습니다!
97101
다운로드 링크: https://github.com/${{ github.repository }}/releases/latest
98-
웹 앱 링크: https://alignlab-client.s3.ap-northeast-2.amazonaws.com/index.html
102+
웹 앱 링크: https://alignlab.site
99103
브랜치: develop
100-
커밋: ${{ needs.build-and-deploy.steps.get_commit_info.outputs.message }}
101-
작성자: ${{ needs.build-and-deploy.steps.get_commit_info.outputs.author }}
104+
커밋: ${{ needs.build-and-deploy.outputs.message }}
105+
작성자: ${{ needs.build-and-deploy.outputs.author }}
102106
103107
# Discord 알림 - 실패
104108
notify-failure:
@@ -114,7 +118,7 @@ jobs:
114118
args: |
115119
❌ ${{ needs.build-and-deploy.outputs.build_outcome == 'failure' && '빌드 중' || '배포 중' }} 오류가 발생했습니다.
116120
브랜치: develop
117-
커밋: ${{ needs.build-and-deploy.steps.get_commit_info.outputs.message }}
121+
커밋: ${{ needs.build-and-deploy.outputs.message }}
118122
작성자: <@${{ secrets.DISCORD_ID_1 }}>
119123
실패한 워크플로우: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
120124
${{ needs.build-and-deploy.outputs.build_outcome == 'failure' && '빌드 오류 메시지:' || '' }}

assets/icons/icon.icns

28.6 KB
Binary file not shown.

assets/icons/icon.png

28.6 KB
Loading

package.json

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
22
"name": "alignlab",
3-
"version": "1.0.0",
3+
"version": "1.0.1",
44
"main": "dist/main.js",
55
"license": "MIT",
6-
"description": "alignlab",
6+
"description": "Alignlab",
77
"build": {
88
"extends": null
99
},
@@ -12,7 +12,8 @@
1212
"packagerConfig": {
1313
"name": "AlignLab",
1414
"outDir": "out/",
15-
"executableName": "alignlab"
15+
"executableName": "Alignlab",
16+
"icon" : "assets/icons/icon.png"
1617
},
1718
"rebuildConfig": {},
1819
"makers": [
@@ -31,7 +32,8 @@
3132
"config": {
3233
"name": "AlignLab",
3334
"overwrite": true,
34-
"format": "ULFO"
35+
"format": "ULFO",
36+
"icon" : "assets/icons/icon.png"
3537
}
3638
}
3739
],
@@ -80,7 +82,8 @@
8082
"react-router-dom": "^6.8.1",
8183
"react-tailwindcss-datepicker": "^1.7.2",
8284
"socket.io-client": "^4.7.5",
83-
"zustand": "^4.5.5"
85+
"zustand": "^4.5.5",
86+
"update-electron-app": "3.0.0"
8487
},
8588
"devDependencies": {
8689
"@electron-forge/cli": "^6.0.4",

src/electron/main.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,18 @@
11
import { app, BrowserWindow } from "electron"
22
import { join } from "path"
3-
3+
import { updateElectronApp } from "update-electron-app"
44
import "./api"
55

66
const isDev = process.env.DEV != undefined
77
const isPreview = process.env.PREVIEW != undefined
88

9+
// 자동 업데이트 초기화
10+
updateElectronApp({
11+
repo: "DDD-Community/DDD-11-HERO-WEB",
12+
updateInterval: "1 hour",
13+
logger: console,
14+
})
15+
916
function createWindow() {
1017
const mainWindow = new BrowserWindow({
1118
width: 800,

src/pages/DownloadPage.tsx

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,16 @@
11
import WindowIcon from "@assets/icons/download-window-icon.svg?react"
22
import MacIcon from "@assets/icons/download-mac-icon.svg?react"
3+
const DMG_DOWNLOAD_URL = import.meta.env.VITE_DMG_DOWNLOAD_URL
4+
const EXE_DOWNLOAD_URL = import.meta.env.VITE_EXE_DOWNLOAD_URL
5+
36
const DownloadPage: React.FC = () => {
7+
const onDownload = (os: "mac" | "window"): void => {
8+
if (os === "mac") {
9+
window.open(DMG_DOWNLOAD_URL, "_blank")
10+
} else if (os === "window") {
11+
window.open(EXE_DOWNLOAD_URL, "_blank")
12+
}
13+
}
414
return (
515
<div className="flex h-[704px] flex-col items-center justify-center gap-10 bg-gradient-to-b from-white via-[#BFD9FE] to-[#8BBAFE]">
616
{/* left */}
@@ -10,11 +20,17 @@ const DownloadPage: React.FC = () => {
1020
PC용 앱을 다운받아보세요
1121
</div>
1222
<div className="flex gap-6">
13-
<div className="flex w-[200px] cursor-pointer items-center items-center justify-center gap-2 rounded-full bg-white py-4 text-base font-semibold leading-[24px] text-zinc-900">
23+
<div
24+
className="flex w-[200px] cursor-pointer items-center items-center justify-center gap-2 rounded-full bg-white py-4 text-base font-semibold leading-[24px] text-zinc-900"
25+
onClick={() => onDownload("window")}
26+
>
1427
<WindowIcon />
1528
<div>Window OS</div>
1629
</div>
17-
<div className="flex w-[200px] cursor-pointer items-center items-center justify-center gap-2 rounded-full bg-white px-7 py-4 text-base font-semibold text-zinc-900">
30+
<div
31+
className="flex w-[200px] cursor-pointer items-center items-center justify-center gap-2 rounded-full bg-white px-7 py-4 text-base font-semibold text-zinc-900"
32+
onClick={() => onDownload("mac")}
33+
>
1834
<MacIcon />
1935
<div>Mac OS</div>
2036
</div>

yarn.lock

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3214,6 +3214,13 @@ get-tsconfig@^4.7.5:
32143214
dependencies:
32153215
resolve-pkg-maps "^1.0.0"
32163216

3217+
github-url-to-object@^4.0.4:
3218+
version "4.0.6"
3219+
resolved "https://registry.yarnpkg.com/github-url-to-object/-/github-url-to-object-4.0.6.tgz#5ea8701dc8c336b8d582dc3fa5bf964165c3b365"
3220+
integrity sha512-NaqbYHMUAlPcmWFdrAB7bcxrNIiiJWJe8s/2+iOc9vlcHlwHqSGrPk+Yi3nu6ebTwgsZEa7igz+NH2vEq3gYwQ==
3221+
dependencies:
3222+
is-url "^1.1.0"
3223+
32173224
glob-parent@^5.1.2, glob-parent@~5.1.2:
32183225
version "5.1.2"
32193226
resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.2.tgz#869832c58034fe68a4093c17dc15e8340d8401c4"
@@ -3771,6 +3778,11 @@ is-unicode-supported@^0.1.0:
37713778
resolved "https://registry.yarnpkg.com/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz#3f26c76a809593b52bfa2ecb5710ed2779b522a7"
37723779
integrity sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==
37733780

3781+
is-url@^1.1.0, is-url@^1.2.4:
3782+
version "1.2.4"
3783+
resolved "https://registry.yarnpkg.com/is-url/-/is-url-1.2.4.tgz#04a4df46d28c4cff3d73d01ff06abeb318a1aa52"
3784+
integrity sha512-ITvGim8FhRiYe4IQ5uHSkj7pVaPDrCTkNd3yq3cV7iZAcJdHTUMPMEHcqSOy9xZ9qFenQCvi+2wjH9a1nXqHww==
3785+
37743786
is-weakmap@^2.0.2:
37753787
version "2.0.2"
37763788
resolved "https://registry.yarnpkg.com/is-weakmap/-/is-weakmap-2.0.2.tgz#bf72615d649dfe5f699079c54b83e47d1ae19cfd"
@@ -6031,6 +6043,15 @@ update-browserslist-db@^1.1.1:
60316043
escalade "^3.2.0"
60326044
picocolors "^1.1.0"
60336045

6046+
6047+
version "3.0.0"
6048+
resolved "https://registry.yarnpkg.com/update-electron-app/-/update-electron-app-3.0.0.tgz#d705889e5bd86939f22e144c0c8b5f919a90f954"
6049+
integrity sha512-Ccs46fgUEcMpSRPMNw82DFMux2MGi5tkKkEpV723JmtPNI3qAtxvTeiYkKczN2/LehA3U7JGrGr4MhraxGdRTw==
6050+
dependencies:
6051+
github-url-to-object "^4.0.4"
6052+
is-url "^1.2.4"
6053+
ms "^2.1.1"
6054+
60346055
uri-js@^4.2.2:
60356056
version "4.4.1"
60366057
resolved "https://registry.yarnpkg.com/uri-js/-/uri-js-4.4.1.tgz#9b1a52595225859e55f669d928f88c6c57f2a77e"

0 commit comments

Comments
 (0)