-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pathAuto Draft Release With Screenshot.yml
More file actions
225 lines (198 loc) · 8.03 KB
/
Copy pathAuto Draft Release With Screenshot.yml
File metadata and controls
225 lines (198 loc) · 8.03 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
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
name: Blink Eye Auto Draft Release with Screenshots
on:
pull_request:
branches: [develop]
paths-ignore:
- 'website/**' # Ignore all website directory changes
- 'website/**/*' # Ignore all nested files in website
- '**.md' # Optional: ignore markdown files
- 'docs/**' # Optional: ignore docs
workflow_dispatch: # Allows manual triggering from GitHub UI
jobs:
build:
permissions:
contents: write
strategy:
fail-fast: false
matrix:
include:
- platform: "macos-latest" # for Arm based macs (M1 and above)
args: "--target aarch64-apple-darwin"
architecture: "arm64"
- platform: "macos-latest" # for Intel based macs
args: "--target x86_64-apple-darwin"
architecture: "x86_64"
- platform: "ubuntu-22.04" # for Tauri v2
args: ""
architecture: ""
- platform: "windows-latest"
args: ""
architecture: ""
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: "lts/*"
- name: Install Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: latest
- name: Cache Bun dependencies
uses: actions/cache@v4
with:
path: ~/.bun/install/cache
key: ${{ runner.os }}-bun-${{ hashFiles('**/bun.lockb') }}
restore-keys: |
${{ runner.os }}-bun-
- name: Cache Rust dependencies
uses: actions/cache@v4
with:
path: |
~/.cargo/registry/index/
~/.cargo/registry/cache/
~/.cargo/git/
src-tauri/target/
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-cargo-
- name: Install Rust stable
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.platform == 'macos-latest' && 'aarch64-apple-darwin,x86_64-apple-darwin' || '' }}
- name: Install dependencies (ubuntu only)
if: matrix.platform == 'ubuntu-22.04'
run: |
sudo apt-get update
sudo apt-get install -y \
libwebkit2gtk-4.1-dev \
libappindicator3-dev \
librsvg2-dev \
libgtk-4-dev \
patchelf \
openssl \
libssl-dev \
build-essential
- name: Install frontend dependencies
run: bun install
- uses: tauri-apps/tauri-action@v0.5.16
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
VITE_HANDSHAKE_PASSWORD: ${{ secrets.VITE_HANDSHAKE_PASSWORD }}
TAURI_SIGNING_PRIVATE_KEY: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY }}
TAURI_SIGNING_PRIVATE_KEY_PASSWORD: ${{ secrets.TAURI_SIGNING_PRIVATE_KEY_PASSWORD }}
NODE_OPTIONS: --openssl-legacy-provider # Add this for Web Crypto API
with:
tagName: v__VERSION__
releaseName: "v__VERSION__"
releaseBody: "See the assets to download this version and install."
releaseDraft: true
prerelease: false
includeUpdaterJson: true
updaterJsonPreferNsis: true
args: ${{ matrix.args }}
# macOS-specific steps: Install and test the built app
- name: Log Device Architecture (macOS only)
if: matrix.platform == 'macos-latest'
run: |
DEVICE_ARCH=$(uname -m)
echo "Detected device architecture: $DEVICE_ARCH"
if [[ "$DEVICE_ARCH" == "arm64" ]]; then
echo "This is an Apple Silicon device (ARM64)."
elif [[ "$DEVICE_ARCH" == "x86_64" ]]; then
echo "This is an Intel-based device (x86_64)."
else
echo "Unknown architecture detected!"
fi
continue-on-error: true
- name: Find and Install Built App (macOS only)
if: matrix.platform == 'macos-latest'
run: |
# Determine the target directory based on architecture
if [[ "${{ matrix.architecture }}" == "arm64" ]]; then
TARGET_DIR="src-tauri/target/aarch64-apple-darwin/release/bundle/macos"
else
TARGET_DIR="src-tauri/target/x86_64-apple-darwin/release/bundle/macos"
fi
echo "Looking for app in: $TARGET_DIR"
# Find the .app bundle
APP_PATH=$(find "$TARGET_DIR" -name "*.app" -type d | head -n 1)
if [ -z "$APP_PATH" ]; then
echo "Error: Could not find .app bundle in $TARGET_DIR"
exit 1
fi
echo "Found app at: $APP_PATH"
# Copy to Applications folder
sudo cp -R "$APP_PATH" /Applications/
APP_NAME=$(basename "$APP_PATH")
echo "Installed: /Applications/$APP_NAME"
# Take screenshot after installation
screencapture -x /tmp/screenshot_install.png || true
continue-on-error: true
- name: Verify Installation (macOS only)
if: matrix.platform == 'macos-latest'
run: |
if [ -d "/Applications/Blink Eye.app" ]; then
echo "Blink Eye installed successfully."
ls -la "/Applications/Blink Eye.app"
else
echo "Blink Eye installation failed, but continuing workflow."
fi
screencapture -x /tmp/screenshot_verify_install.png || true
continue-on-error: true
- name: Test App Architecture (macOS only)
if: matrix.platform == 'macos-latest'
run: |
if [ ! -f "/Applications/Blink Eye.app/Contents/MacOS/Blink-Eye" ]; then
echo "Blink Eye binary not found, but continuing workflow."
else
ARCH=$(file "/Applications/Blink Eye.app/Contents/MacOS/Blink-Eye" | awk '{print $NF}')
echo "Detected architecture: $ARCH"
if [ "$ARCH" != "${{ matrix.architecture }}" ]; then
echo "Architecture test failed! Detected: $ARCH, Expected: ${{ matrix.architecture }}, but continuing workflow."
else
echo "Architecture test passed! Detected: $ARCH matches ${{ matrix.architecture }}"
fi
fi
screencapture -x /tmp/screenshot_architecture.png || true
continue-on-error: true
- name: Launch Blink Eye App 5 Times with Delay (macOS only)
if: matrix.platform == 'macos-latest'
run: |
for i in {1..5}; do
echo "Launch attempt $i..."
open "/Applications/Blink Eye.app" || true
sleep 10 # Wait for the app UI to render
screencapture -x "/tmp/screenshot_launch_$i.png" || true
done
continue-on-error: true
- name: Cleanup - Uninstall App (macOS only)
if: matrix.platform == 'macos-latest'
run: |
sudo rm -rf "/Applications/Blink Eye.app" || true
screencapture -x /tmp/screenshot_uninstall.png || true
continue-on-error: true
- name: Verify Uninstallation (macOS only)
if: matrix.platform == 'macos-latest'
run: |
if [ ! -d "/Applications/Blink Eye.app" ]; then
echo "Blink Eye uninstalled successfully."
else
echo "Blink Eye uninstallation failed, but continuing workflow."
fi
screencapture -x /tmp/screenshot_verify_uninstall.png || true
continue-on-error: true
- name: Upload macOS Screenshots
if: matrix.platform == 'macos-latest'
uses: actions/upload-artifact@v4
with:
name: BlinkEyeScreenshots-${{ matrix.architecture }}
path: /tmp/screenshot_*.png
retention-days: 7
continue-on-error: true
- name: Upload release artifacts
uses: actions/upload-artifact@v4
with:
name: release-${{ matrix.platform }}-${{ matrix.architecture || 'default' }}
path: src-tauri/target/release/bundle/**