Skip to content

Commit c448acb

Browse files
committed
fix: action
1 parent d526e44 commit c448acb

5 files changed

Lines changed: 169 additions & 198 deletions

File tree

.github/workflows/ci.yml

Lines changed: 0 additions & 182 deletions
This file was deleted.

.github/workflows/cicd-desktop.yml

Lines changed: 146 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,146 @@
1+
name: CI/CD Desktop
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
paths:
8+
- 'packages/common/**'
9+
- 'packages/desktop/**'
10+
- 'package.json'
11+
pull_request:
12+
branches:
13+
- main
14+
paths:
15+
- 'packages/common/**'
16+
- 'packages/desktop/**'
17+
- 'package.json'
18+
workflow_dispatch:
19+
20+
jobs:
21+
build:
22+
strategy:
23+
fail-fast: false
24+
matrix:
25+
include:
26+
- platform: macos-latest
27+
build_script: package:mac
28+
- platform: windows-latest
29+
build_script: package:win
30+
- platform: ubuntu-22.04
31+
build_script: package:linux
32+
33+
runs-on: ${{ matrix.platform }}
34+
steps:
35+
- name: Checkout repository
36+
uses: actions/checkout@v4
37+
38+
- name: Setup Node.js
39+
uses: actions/setup-node@v4
40+
with:
41+
node-version: latest
42+
43+
- name: Setup Bun
44+
uses: oven-sh/setup-bun@v2
45+
with:
46+
bun-version: latest
47+
48+
- name: Cache Bun dependencies
49+
uses: actions/cache@v4
50+
with:
51+
path: |
52+
~/.bun/install/cache
53+
node_modules
54+
packages/*/node_modules
55+
key: ${{ runner.os }}-bun-${{ hashFiles('**/bun.lockb', '**/package.json') }}
56+
restore-keys: |
57+
${{ runner.os }}-bun-
58+
59+
- name: Cache Next.js
60+
uses: actions/cache@v4
61+
with:
62+
path: |
63+
packages/desktop/.next/cache
64+
key: ${{ runner.os }}-nextjs-desktop-${{ hashFiles('**/bun.lockb') }}-${{ hashFiles('packages/**/*.ts', 'packages/**/*.tsx') }}
65+
restore-keys: |
66+
${{ runner.os }}-nextjs-desktop-
67+
68+
- name: Cache Webpack
69+
uses: actions/cache@v4
70+
with:
71+
path: |
72+
packages/desktop/build
73+
packages/desktop/.erb
74+
key: ${{ runner.os }}-webpack-${{ hashFiles('**/bun.lockb') }}-${{ hashFiles('packages/desktop/electron/**/*.ts') }}
75+
restore-keys: |
76+
${{ runner.os }}-webpack-
77+
78+
- name: Cache electron-builder
79+
uses: actions/cache@v4
80+
with:
81+
path: |
82+
~/Library/Caches/electron
83+
~/Library/Caches/electron-builder
84+
~/.cache/electron
85+
~/.cache/electron-builder
86+
~/AppData/Local/electron/Cache
87+
~/AppData/Local/electron-builder/Cache
88+
key: ${{ runner.os }}-electron-${{ hashFiles('**/bun.lockb') }}
89+
restore-keys: |
90+
${{ runner.os }}-electron-
91+
92+
- name: Install dependencies
93+
run: bun install
94+
95+
- name: Import Code-Signing Certificates (macOS)
96+
if: matrix.platform == 'macos-latest' && env.APPLE_CERTIFICATE != ''
97+
env:
98+
APPLE_CERTIFICATE: ${{ secrets.APPLE_CERTIFICATE }}
99+
uses: apple-actions/import-codesign-certs@v3
100+
with:
101+
p12-file-base64: ${{ secrets.APPLE_CERTIFICATE }}
102+
p12-password: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }}
103+
104+
- name: Install Linux dependencies
105+
if: matrix.platform == 'ubuntu-22.04'
106+
run: |
107+
sudo apt-get update
108+
sudo apt-get install -y rpm
109+
110+
- name: Build Desktop app
111+
env:
112+
APPLE_ID: ${{ secrets.APPLE_ID }}
113+
APPLE_APP_SPECIFIC_PASSWORD: ${{ secrets.APPLE_APP_SPECIFIC_PASSWORD }}
114+
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
115+
CSC_LINK: ${{ secrets.APPLE_CERTIFICATE }}
116+
CSC_KEY_PASSWORD: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }}
117+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
118+
run: bun run ${{ matrix.build_script }}
119+
120+
- name: Upload artifacts (macOS)
121+
if: matrix.platform == 'macos-latest'
122+
uses: actions/upload-artifact@v4
123+
with:
124+
name: macos-app
125+
path: |
126+
packages/desktop/dist/*.dmg
127+
packages/desktop/dist/*.zip
128+
packages/desktop/dist/*.blockmap
129+
130+
- name: Upload artifacts (Windows)
131+
if: matrix.platform == 'windows-latest'
132+
uses: actions/upload-artifact@v4
133+
with:
134+
name: windows-app
135+
path: |
136+
packages/desktop/dist/*.exe
137+
packages/desktop/dist/*.blockmap
138+
139+
- name: Upload artifacts (Linux)
140+
if: matrix.platform == 'ubuntu-22.04'
141+
uses: actions/upload-artifact@v4
142+
with:
143+
name: linux-app
144+
path: |
145+
packages/desktop/dist/*.AppImage
146+
packages/desktop/dist/*.blockmap
Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,16 @@
1-
name: Deploy Web
1+
name: CI/CD Web
22

33
on:
44
push:
55
branches:
6-
- release
6+
- main
7+
paths:
8+
- 'packages/common/**'
9+
- 'packages/web/**'
10+
- 'package.json'
11+
pull_request:
12+
branches:
13+
- main
714
paths:
815
- 'packages/common/**'
916
- 'packages/web/**'
@@ -12,12 +19,8 @@ on:
1219

1320

1421
jobs:
15-
deploy:
22+
build:
1623
runs-on: ubuntu-latest
17-
permissions:
18-
contents: read
19-
deployments: write
20-
2124
steps:
2225
- name: Checkout repository
2326
uses: actions/checkout@v4
@@ -38,17 +41,17 @@ jobs:
3841
restore-keys: |
3942
${{ runner.os }}-bun-
4043
44+
- name: Cache Next.js
45+
uses: actions/cache@v4
46+
with:
47+
path: |
48+
packages/web/.next/cache
49+
key: ${{ runner.os }}-nextjs-web-${{ hashFiles('**/bun.lockb') }}-${{ hashFiles('packages/**/*.ts', 'packages/**/*.tsx') }}
50+
restore-keys: |
51+
${{ runner.os }}-nextjs-web-
52+
4153
- name: Install dependencies
4254
run: bun install
4355

4456
- name: Build Web app
4557
run: bun run build:web
46-
47-
- name: Deploy to Cloudflare Pages
48-
uses: cloudflare/pages-action@v1
49-
with:
50-
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
51-
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
52-
projectName: DPIP Web
53-
directory: packages/web/out
54-
gitHubToken: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)