Skip to content

Commit

Permalink
[feat/#123] 아이콘 추가, 다운로드 URL 설정, 자동 업데이트 코드 추가, github action 디스코드 알림 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
lkhoony committed Nov 18, 2024
1 parent c62536b commit 3a4e217
Show file tree
Hide file tree
Showing 7 changed files with 67 additions and 16 deletions.
20 changes: 12 additions & 8 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ jobs:
- name: Get commit message and author
id: get_commit_info
run: |
echo "::set-output name=message::$(git log --format=%s -n 1)"
echo "::set-output name=author::$(git log --format=%an -n 1)"
echo "::set-output name=author_username::$(git log --format=%ae -n 1 | cut -d@ -f1)"
echo "message=$(git log --format=%s -n 1)" >> $GITHUB_OUTPUT
echo "author=$(git log --format=%an -n 1)" >> $GITHUB_OUTPUT
echo "author_username=$(git log --format=%ae -n 1 | cut -d@ -f1)" >> $GITHUB_OUTPUT
- name: Install dependencies
run: yarn install
Expand All @@ -39,6 +39,8 @@ jobs:
VITE_OAUTH_KAKAO_REST_API_KEY: ${{ secrets.VITE_OAUTH_KAKAO_REST_API_KEY }}
VITE_OAUTH_KAKAO_CLIENT_SECRET_CODE: ${{ secrets.VITE_OAUTH_KAKAO_CLIENT_SECRET_CODE }}
VITE_OAUTH_KAKAO_REDIRECT_URI: ${{ secrets.VITE_OAUTH_KAKAO_REDIRECT_URI }}
VITE_DMG_DOWNLOAD_URL: ${{ secrets.VITE_DMG_DOWNLOAD_URL }}
VITE_EXE_DOWNLOAD_URL: ${{ secrets.VITE_EXE_DOWNLOAD_URL }}
run: |
echo "Building web app..."
yarn build
Expand All @@ -61,8 +63,11 @@ jobs:
VITE_OAUTH_KAKAO_REST_API_KEY: ${{ secrets.VITE_OAUTH_KAKAO_REST_API_KEY }}
VITE_OAUTH_KAKAO_CLIENT_SECRET_CODE: ${{ secrets.VITE_OAUTH_KAKAO_CLIENT_SECRET_CODE }}
VITE_OAUTH_KAKAO_REDIRECT_URI: ${{ secrets.VITE_OAUTH_KAKAO_REDIRECT_URI }}
VITE_DMG_DOWNLOAD_URL: ${{ secrets.VITE_DMG_DOWNLOAD_URL }}
VITE_EXE_DOWNLOAD_URL: ${{ secrets.VITE_EXE_DOWNLOAD_URL }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: yarn electron:publish

# CloudFront 캐시 무효화
invalidate-cache:
runs-on: ubuntu-20.04
Expand All @@ -78,7 +83,6 @@ jobs:
echo "Invalidating CloudFront cache..."
aws cloudfront create-invalidation --region ap-northeast-2 --distribution-id $CLOUDFRONT_DISTRIBUTION_ID --paths "/*"
# Discord 알림 - 성공
notify-success:
runs-on: ubuntu-20.04
Expand All @@ -95,10 +99,10 @@ jobs:
args: |
🎉 배포가 성공적으로 완료되었습니다!
다운로드 링크: https://github.com/${{ github.repository }}/releases/latest
웹 앱 링크: https://alignlab-client.s3.ap-northeast-2.amazonaws.com/index.html
웹 앱 링크: https://alignlab.site
브랜치: develop
커밋: ${{ needs.build-and-deploy.steps.get_commit_info.outputs.message }}
작성자: ${{ needs.build-and-deploy.steps.get_commit_info.outputs.author }}
커밋: ${{ needs.build-and-deploy.outputs.message }}
작성자: ${{ needs.build-and-deploy.outputs.author }}
# Discord 알림 - 실패
notify-failure:
Expand All @@ -114,7 +118,7 @@ jobs:
args: |
❌ ${{ needs.build-and-deploy.outputs.build_outcome == 'failure' && '빌드 중' || '배포 중' }} 오류가 발생했습니다.
브랜치: develop
커밋: ${{ needs.build-and-deploy.steps.get_commit_info.outputs.message }}
커밋: ${{ needs.build-and-deploy.outputs.message }}
작성자: <@${{ secrets.DISCORD_ID_1 }}>
실패한 워크플로우: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
${{ needs.build-and-deploy.outputs.build_outcome == 'failure' && '빌드 오류 메시지:' || '' }}
Expand Down
Binary file added assets/icons/icon.icns
Binary file not shown.
Binary file added assets/icons/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 8 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"name": "alignlab",
"version": "1.0.0",
"version": "1.0.1",
"main": "dist/main.js",
"license": "MIT",
"description": "alignlab",
"description": "Alignlab",
"build": {
"extends": null
},
Expand All @@ -12,7 +12,8 @@
"packagerConfig": {
"name": "AlignLab",
"outDir": "out/",
"executableName": "alignlab"
"executableName": "Alignlab",
"icon" : "assets/icons/icon.png"
},
"rebuildConfig": {},
"makers": [
Expand All @@ -31,7 +32,8 @@
"config": {
"name": "AlignLab",
"overwrite": true,
"format": "ULFO"
"format": "ULFO",
"icon" : "assets/icons/icon.png"
}
}
],
Expand Down Expand Up @@ -80,7 +82,8 @@
"react-router-dom": "^6.8.1",
"react-tailwindcss-datepicker": "^1.7.2",
"socket.io-client": "^4.7.5",
"zustand": "^4.5.5"
"zustand": "^4.5.5",
"update-electron-app": "3.0.0"
},
"devDependencies": {
"@electron-forge/cli": "^6.0.4",
Expand Down
9 changes: 8 additions & 1 deletion src/electron/main.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
import { app, BrowserWindow } from "electron"
import { join } from "path"

import { updateElectronApp } from "update-electron-app"
import "./api"

const isDev = process.env.DEV != undefined
const isPreview = process.env.PREVIEW != undefined

// 자동 업데이트 초기화
updateElectronApp({
repo: "DDD-Community/DDD-11-HERO-WEB",
updateInterval: "1 hour",
logger: console,
})

function createWindow() {
const mainWindow = new BrowserWindow({
width: 800,
Expand Down
20 changes: 18 additions & 2 deletions src/pages/DownloadPage.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
import WindowIcon from "@assets/icons/download-window-icon.svg?react"
import MacIcon from "@assets/icons/download-mac-icon.svg?react"
const DMG_DOWNLOAD_URL = import.meta.env.VITE_DMG_DOWNLOAD_URL
const EXE_DOWNLOAD_URL = import.meta.env.VITE_EXE_DOWNLOAD_URL

const DownloadPage: React.FC = () => {
const onDownload = (os: "mac" | "window"): void => {
if (os === "mac") {
window.open(DMG_DOWNLOAD_URL, "_blank")
} else if (os === "window") {
window.open(EXE_DOWNLOAD_URL, "_blank")
}
}
return (
<div className="flex h-[704px] flex-col items-center justify-center gap-10 bg-gradient-to-b from-white via-[#BFD9FE] to-[#8BBAFE]">
{/* left */}
Expand All @@ -10,11 +20,17 @@ const DownloadPage: React.FC = () => {
PC용 앱을 다운받아보세요
</div>
<div className="flex gap-6">
<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">
<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"
onClick={() => onDownload("window")}
>
<WindowIcon />
<div>Window OS</div>
</div>
<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">
<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"
onClick={() => onDownload("mac")}
>
<MacIcon />
<div>Mac OS</div>
</div>
Expand Down
21 changes: 21 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3214,6 +3214,13 @@ get-tsconfig@^4.7.5:
dependencies:
resolve-pkg-maps "^1.0.0"

github-url-to-object@^4.0.4:
version "4.0.6"
resolved "https://registry.yarnpkg.com/github-url-to-object/-/github-url-to-object-4.0.6.tgz#5ea8701dc8c336b8d582dc3fa5bf964165c3b365"
integrity sha512-NaqbYHMUAlPcmWFdrAB7bcxrNIiiJWJe8s/2+iOc9vlcHlwHqSGrPk+Yi3nu6ebTwgsZEa7igz+NH2vEq3gYwQ==
dependencies:
is-url "^1.1.0"

glob-parent@^5.1.2, glob-parent@~5.1.2:
version "5.1.2"
resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.2.tgz#869832c58034fe68a4093c17dc15e8340d8401c4"
Expand Down Expand Up @@ -3771,6 +3778,11 @@ is-unicode-supported@^0.1.0:
resolved "https://registry.yarnpkg.com/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz#3f26c76a809593b52bfa2ecb5710ed2779b522a7"
integrity sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==

is-url@^1.1.0, is-url@^1.2.4:
version "1.2.4"
resolved "https://registry.yarnpkg.com/is-url/-/is-url-1.2.4.tgz#04a4df46d28c4cff3d73d01ff06abeb318a1aa52"
integrity sha512-ITvGim8FhRiYe4IQ5uHSkj7pVaPDrCTkNd3yq3cV7iZAcJdHTUMPMEHcqSOy9xZ9qFenQCvi+2wjH9a1nXqHww==

is-weakmap@^2.0.2:
version "2.0.2"
resolved "https://registry.yarnpkg.com/is-weakmap/-/is-weakmap-2.0.2.tgz#bf72615d649dfe5f699079c54b83e47d1ae19cfd"
Expand Down Expand Up @@ -6031,6 +6043,15 @@ update-browserslist-db@^1.1.1:
escalade "^3.2.0"
picocolors "^1.1.0"

[email protected]:
version "3.0.0"
resolved "https://registry.yarnpkg.com/update-electron-app/-/update-electron-app-3.0.0.tgz#d705889e5bd86939f22e144c0c8b5f919a90f954"
integrity sha512-Ccs46fgUEcMpSRPMNw82DFMux2MGi5tkKkEpV723JmtPNI3qAtxvTeiYkKczN2/LehA3U7JGrGr4MhraxGdRTw==
dependencies:
github-url-to-object "^4.0.4"
is-url "^1.2.4"
ms "^2.1.1"

uri-js@^4.2.2:
version "4.4.1"
resolved "https://registry.yarnpkg.com/uri-js/-/uri-js-4.4.1.tgz#9b1a52595225859e55f669d928f88c6c57f2a77e"
Expand Down

0 comments on commit 3a4e217

Please sign in to comment.