-
Notifications
You must be signed in to change notification settings - Fork 1
319 lines (259 loc) · 10.2 KB
/
auto-release.yml
File metadata and controls
319 lines (259 loc) · 10.2 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
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
name: Build and Release
on:
push:
tags:
- "v*" # Only trigger when tags like v1.0.0 are pushed
jobs:
build-mac:
runs-on: macos-latest
permissions:
contents: write
steps:
- name: Check out Git repository
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: "npm"
cache-dependency-path: app/package-lock.json
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
cache: "pip"
cache-dependency-path: |
server/requirements.txt
- name: Install Python dependencies
run: |
cd server
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Install Node.js dependencies
run: |
cd app
npm ci
# Create .env file with secrets
- name: Create .env file
run: |
cd app
echo "GOOGLE_API_KEY=${{ secrets.GOOGLE_API_KEY }}" > .env
echo "Created .env file with API key"
- name: Get version from tag
id: get_version
run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT
- name: Build Mac App
run: |
cd app
npm run dist:mac
- name: Package Mac App
run: |
cd app/dist
# List directories to see what was created
ls -la
# Find the mac build directory (could be mac, mac-arm64, mac-universal, etc.)
MAC_DIR=$(find . -name "mac*" -type d | head -1)
echo "Found Mac directory: $MAC_DIR"
cd "$MAC_DIR"
# Create installation script
cat > install-tether.sh << 'EOF'
#!/bin/bash
echo "Installing Tether..."
echo "Removing quarantine attributes..."
xattr -cr Tether.app
echo "Moving to Applications folder..."
mv Tether.app /Applications/
echo "Done! You can now run Tether from your Applications folder."
EOF
chmod +x install-tether.sh
# Find the .app directory and zip it with the install script
APP_NAME=$(find . -name "*.app" -type d | head -1)
zip -r "Tether-v${{ steps.get_version.outputs.VERSION }}-mac.zip" "$APP_NAME" install-tether.sh
# Move zip to parent dist directory for easier access
mv "Tether-v${{ steps.get_version.outputs.VERSION }}-mac.zip" ../
- name: Upload Mac artifacts
uses: actions/upload-artifact@v4
with:
name: mac-build
path: app/dist/*.zip
build-windows:
runs-on: windows-latest
permissions:
contents: write
steps:
- name: Check out Git repository
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: "npm"
cache-dependency-path: app/package-lock.json
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.11"
cache: "pip"
cache-dependency-path: |
server/requirements.txt
- name: Install Python dependencies
run: |
cd server
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Install Node.js dependencies
run: |
cd app
npm ci
# Create .env file with secrets
- name: Create .env file
run: |
cd app
echo "GOOGLE_API_KEY=${{ secrets.GOOGLE_API_KEY }}" > .env
echo "Created .env file with API key"
- name: Get version from tag
id: get_version
run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT
shell: bash
- name: Build Windows App
run: |
cd app
npm run dist:win
- name: Package Windows App
run: |
cd app/dist
# List files to see what was created
Get-ChildItem -Recurse
# Create installation instructions
@"
# Tether Installation Instructions for Windows
## Quick Install (Recommended)
1. Download the Tether installer (.msi file) from the release
2. Double-click the .msi file to run the installer
3. Follow the installation wizard
4. Launch Tether from the Start Menu or Desktop shortcut
## Portable Install
1. Download the Tether portable (.exe file) from the release
2. Run the .exe file directly - no installation required
3. The app will create a data folder in the same directory
## Important: Windows Permissions
After installation, you may need to grant permissions for Tether to work properly:
1. **Notifications**: Windows should automatically prompt you to allow notifications
2. **Run at Startup** (optional):
- Open Settings > Apps > Startup
- Find Tether and toggle it on
3. **Windows Defender**: If Windows Defender blocks the app:
- Go to Windows Security > Virus & threat protection
- Click "Manage settings" under Virus & threat protection settings
- Add an exclusion for the Tether installation folder
The app is unsigned, so Windows may show security warnings. Click "More info" then "Run anyway" to proceed.
"@ | Out-File -FilePath "WINDOWS-INSTALL.md" -Encoding UTF8
# Create a simple zip with all Windows builds
$version = "${{ steps.get_version.outputs.VERSION }}"
Compress-Archive -Path "*.exe", "*.msi", "WINDOWS-INSTALL.md" -DestinationPath "Tether-v$version-windows.zip"
shell: powershell
- name: Upload Windows artifacts
uses: actions/upload-artifact@v4
with:
name: windows-build
path: app/dist/*.zip
create-release:
needs: [build-mac, build-windows]
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Check out Git repository
uses: actions/checkout@v4
- name: Get version from tag
id: get_version
run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT
- name: Download Mac artifacts
uses: actions/download-artifact@v4
with:
name: mac-build
path: ./artifacts/
- name: Download Windows artifacts
uses: actions/download-artifact@v4
with:
name: windows-build
path: ./artifacts/
- name: Create Release
id: create_release
uses: softprops/action-gh-release@v1
with:
name: Release v${{ steps.get_version.outputs.VERSION }}
draft: false
prerelease: false
generate_release_notes: true
body: |
## Installation Instructions
### 🪟 Windows Installation
**Quick Install (Recommended):**
1. Download `Tether-v${{ steps.get_version.outputs.VERSION }}-windows.zip`
2. Extract the zip file
3. Run the `.msi` installer file
4. Follow the installation wizard
5. Launch Tether from Start Menu or Desktop shortcut
**Portable Version:**
1. Download `Tether-v${{ steps.get_version.outputs.VERSION }}-windows.zip`
2. Extract and run the `.exe` file directly (no installation needed)
**Windows Security Notes:**
- Windows may show security warnings (app is unsigned)
- Click "More info" → "Run anyway" to proceed
- If Windows Defender blocks it: Add Tether folder to exclusions in Windows Security
**Permissions Setup:**
- **Notifications**: Windows will prompt automatically
- **Startup**: Go to Settings > Apps > Startup to enable auto-start
- **Accessibility**: No special permissions needed on Windows
---
### 🍎 macOS Installation
**Recommended Installation (via Terminal):**
1. Download `Tether-v${{ steps.get_version.outputs.VERSION }}-mac.zip`
2. Extract the zip file
3. Open **Terminal** (Cmd + Space, type "Terminal")
4. Navigate to extracted folder:
```bash
cd ~/Downloads/Tether-v${{ steps.get_version.outputs.VERSION }}-mac
```
5. Make the install script executable:
```bash
chmod +x install-tether.sh
```
6. Run the install script:
```bash
./install-tether.sh
```
This will automatically remove macOS quarantine flags, move the app to your Applications folder, and set the correct permissions.
7. Launch **Tether** from your **Applications** folder.
---
**Alternate Installation (Manual):**
1. Download and extract the zip file.
2. Open Terminal and run:
```bash
xattr -cr Tether.app
```
(This removes macOS quarantine flags on unsigned apps.)
3. Move `Tether.app` to your **Applications** folder.
4. Launch it from Applications.
---
**If you get a warning when launching:**
- Right-click `Tether.app` → Select **"Open"**, then click **"Open"** again in the warning prompt.
- Or go to **System Settings** → **Privacy & Security** → **General** → Click **"Open Anyway"**.
---
**Note:** Both versions are unsigned, which triggers security warnings. Follow the platform-specific steps above to bypass these safely.
---
### What's New
See the auto-generated release notes below.
files: |
./artifacts/*.zip
token: ${{ secrets.GITHUB_TOKEN }}
- name: Set release visibility to public
run: |
gh api \
--method PATCH \
-H "Accept: application/vnd.github+json" \
/repos/${{ github.repository }}/releases/${{ steps.create_release.outputs.id }} \
-f private=false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}