forked from tw93/Pake
-
Notifications
You must be signed in to change notification settings - Fork 0
210 lines (179 loc) · 5.64 KB
/
pake-cli.yaml
File metadata and controls
210 lines (179 loc) · 5.64 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
name: Build App With Pake CLI
env:
NODE_VERSION: "22"
PNPM_VERSION: "10.26.2"
on:
workflow_dispatch:
inputs:
platform:
description: "Platform"
required: true
default: "macos-latest"
type: choice
options:
- "windows-latest"
- "macos-latest"
- "ubuntu-24.04"
url:
description: "Website URL"
required: true
name:
description: "App name (lowercase for Linux)"
required: true
icon:
description: "Icon URL, auto-fetch if empty"
required: false
width:
description: "Window width (px)"
required: false
default: "1200"
height:
description: "Window height (px)"
required: false
default: "780"
fullscreen:
description: "Start in fullscreen mode"
required: false
type: boolean
default: false
hide_title_bar:
description: "Hide title bar (macOS only)"
required: false
type: boolean
default: false
multi_arch:
description: "Universal binary (macOS only)"
required: false
type: boolean
default: false
targets:
description: "Package formats (comma-separated: deb,appimage,rpm)"
required: false
default: "deb"
jobs:
build:
name: ${{ inputs.platform }}
runs-on: ${{ inputs.platform }}
strategy:
fail-fast: false
steps:
- name: Checkout repository
uses: actions/checkout@v6
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
- name: Setup Node.js Environment
uses: ./.github/actions/setup-env
with:
mode: build
- name: Build CLI
run: pnpm run cli:build
- name: Setup mold linker
if: runner.os == 'Linux'
uses: rui314/setup-mold@v1
- name: Rust cache restore
uses: actions/cache/restore@v4.2.0
id: cache_store
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
src-tauri/target/
key: ${{ runner.os }}-cargo-pake-${{ hashFiles('**/Cargo.lock') }}
- name: Build App (Linux/macOS)
if: runner.os != 'Windows'
timeout-minutes: 25
shell: bash
run: |
ARGS=("${{ inputs.url }}" "--name" "${{ inputs.name }}")
if [ -n "${{ inputs.icon }}" ]; then
ARGS+=("--icon" "${{ inputs.icon }}")
fi
if [ -n "${{ inputs.width }}" ]; then
ARGS+=("--width" "${{ inputs.width }}")
fi
if [ -n "${{ inputs.height }}" ]; then
ARGS+=("--height" "${{ inputs.height }}")
fi
if [ "${{ inputs.fullscreen }}" == "true" ]; then
ARGS+=("--fullscreen")
fi
if [ "${{ inputs.hide_title_bar }}" == "true" ]; then
ARGS+=("--hide-title-bar")
fi
if [ "${{ inputs.multi_arch }}" == "true" ]; then
ARGS+=("--multi-arch")
fi
if [ -n "${{ inputs.targets }}" ] && [ "${{ runner.os }}" == "Linux" ]; then
ARGS+=("--targets" "${{ inputs.targets }}")
fi
echo "Running: node dist/cli.js ${ARGS[@]}"
node dist/cli.js "${ARGS[@]}"
- name: Build App (Windows)
if: runner.os == 'Windows'
timeout-minutes: 25
shell: pwsh
run: |
$args = "${{ inputs.url }}", "--name", "${{ inputs.name }}"
if ("${{ inputs.icon }}" -ne "") {
$args += "--icon", "${{ inputs.icon }}"
}
if ("${{ inputs.width }}" -ne "") {
$args += "--width", "${{ inputs.width }}"
}
if ("${{ inputs.height }}" -ne "") {
$args += "--height", "${{ inputs.height }}"
}
if ("${{ inputs.fullscreen }}" -eq "true") {
$args += "--fullscreen"
}
if ("${{ inputs.hide_title_bar }}" -eq "true") {
$args += "--hide-title-bar"
}
Write-Host "Running: node dist/cli.js $($args -join ' ')"
node dist/cli.js $args
git checkout -- src-tauri/Cargo.lock
- name: Upload DMG (macOS)
if: runner.os == 'macOS'
uses: actions/upload-artifact@v6
with:
name: ${{ inputs.name }}-macOS
path: ${{ inputs.name }}.dmg
retention-days: 3
- name: Upload DEB (Linux)
if: runner.os == 'Linux'
uses: actions/upload-artifact@v6
with:
name: ${{ inputs.name }}-Linux-deb
path: ${{ inputs.name }}.deb
retention-days: 3
if-no-files-found: ignore
- name: Upload AppImage (Linux)
if: runner.os == 'Linux'
uses: actions/upload-artifact@v6
with:
name: ${{ inputs.name }}-Linux-AppImage
path: ${{ inputs.name }}.AppImage
retention-days: 3
if-no-files-found: ignore
- name: Upload MSI (Windows)
if: runner.os == 'Windows'
uses: actions/upload-artifact@v6
with:
name: ${{ inputs.name }}-Windows
path: ${{ inputs.name }}.msi
retention-days: 3
- name: Rust cache store
uses: actions/cache/save@v4.2.0
if: steps.cache_store.outputs.cache-hit != 'true'
with:
path: |
~/.cargo/bin/
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/db/
src-tauri/target/
key: ${{ runner.os }}-cargo-pake-${{ hashFiles('**/Cargo.lock') }}