Skip to content

Commit def1e38

Browse files
committed
Merge branch 'dev' for release v3.1.1
2 parents 9828d4f + 56fb040 commit def1e38

53 files changed

Lines changed: 2527 additions & 45 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/ci.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: CI
2+
3+
on:
4+
pull_request:
5+
branches: [main, dev]
6+
push:
7+
branches: [main, dev]
8+
9+
jobs:
10+
test:
11+
strategy:
12+
fail-fast: false
13+
matrix:
14+
os: [ubuntu-latest, macos-latest, windows-latest]
15+
runs-on: ${{ matrix.os }}
16+
17+
steps:
18+
- uses: actions/checkout@v4
19+
20+
- uses: actions/setup-go@v5
21+
with:
22+
go-version-file: go.mod
23+
24+
- uses: actions/setup-node@v4
25+
with:
26+
node-version: 24
27+
28+
- name: Install Linux build deps
29+
if: matrix.os == 'ubuntu-latest'
30+
run: |
31+
sudo apt-get update
32+
sudo apt-get install -y --no-install-recommends \
33+
build-essential pkg-config \
34+
libgtk-3-dev libwebkit2gtk-4.1-dev \
35+
libayatana-appindicator3-dev
36+
37+
# `main.go` has `//go:embed all:frontend/dist`, which fails to compile
38+
# if the directory is empty. Build the frontend first so vet/test see
39+
# real files.
40+
- name: Build frontend
41+
working-directory: frontend
42+
run: |
43+
npm ci
44+
npm run build
45+
46+
# unsafeptr trips on legitimate Windows-callback patterns (e.g.,
47+
# converting LPARAM to a struct pointer). The kernel guarantees pointer
48+
# lifetime for the message handler, so the warning is a false positive.
49+
- name: go vet
50+
run: go vet -unsafeptr=false ./...
51+
52+
- name: go test
53+
run: go test ./... -count=1

.github/workflows/release.yml

Lines changed: 109 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66
- 'v*' # Запускается автоматически при создании тега, например v2.1.1
77

88
jobs:
9-
build:
9+
build-windows:
1010
runs-on: windows-latest
1111
permissions:
1212
contents: read
@@ -109,8 +109,113 @@ jobs:
109109
${{ env.INSTALLER_PATH }}
110110
retention-days: 1
111111

112+
build-macos:
113+
runs-on: macos-latest
114+
permissions:
115+
contents: read
116+
actions: write
117+
118+
steps:
119+
- name: Check out Git repository
120+
uses: actions/checkout@v4
121+
122+
- name: Setup Go
123+
uses: actions/setup-go@v5
124+
with:
125+
go-version-file: go.mod
126+
127+
- name: Install Node.js
128+
uses: actions/setup-node@v4
129+
with:
130+
node-version: 24
131+
132+
- name: Install Wails CLI
133+
run: |
134+
go install github.com/wailsapp/wails/v2/cmd/wails@latest
135+
echo "$(go env GOPATH)/bin" >> "$GITHUB_PATH"
136+
137+
- name: Build macOS app and .dmg
138+
env:
139+
SUBSCRIPTION_ENCRYPT_KEY: ${{ secrets.SUBSCRIPTION_ENCRYPT_KEY }}
140+
APPLE_DEVELOPER_ID: ${{ secrets.APPLE_DEVELOPER_ID }}
141+
APPLE_NOTARY_APPLE_ID: ${{ secrets.APPLE_NOTARY_APPLE_ID }}
142+
APPLE_NOTARY_TEAM_ID: ${{ secrets.APPLE_NOTARY_TEAM_ID }}
143+
APPLE_NOTARY_PASSWORD: ${{ secrets.APPLE_NOTARY_PASSWORD }}
144+
run: |
145+
chmod +x build-macos.sh
146+
./build-macos.sh
147+
148+
- name: Upload macOS artifacts
149+
uses: actions/upload-artifact@v4
150+
with:
151+
name: release-assets-macos
152+
path: build/bin/ResultV.dmg
153+
retention-days: 1
154+
155+
build-linux:
156+
runs-on: ubuntu-latest
157+
permissions:
158+
contents: read
159+
actions: write
160+
161+
steps:
162+
- name: Check out Git repository
163+
uses: actions/checkout@v4
164+
165+
- name: Setup Go
166+
uses: actions/setup-go@v5
167+
with:
168+
go-version-file: go.mod
169+
170+
- name: Install Node.js
171+
uses: actions/setup-node@v4
172+
with:
173+
node-version: 24
174+
175+
- name: Install Linux build dependencies
176+
run: |
177+
sudo apt-get update
178+
sudo apt-get install -y --no-install-recommends \
179+
build-essential pkg-config \
180+
libgtk-3-dev libwebkit2gtk-4.1-dev \
181+
libayatana-appindicator3-dev \
182+
rpm fuse libfuse2
183+
184+
- name: Install Wails CLI
185+
run: |
186+
go install github.com/wailsapp/wails/v2/cmd/wails@latest
187+
echo "$(go env GOPATH)/bin" >> "$GITHUB_PATH"
188+
189+
- name: Install nfpm
190+
run: |
191+
go install github.com/goreleaser/nfpm/v2/cmd/nfpm@latest
192+
193+
- name: Install linuxdeploy
194+
run: |
195+
curl -fsSL -o /usr/local/bin/linuxdeploy \
196+
https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage
197+
chmod +x /usr/local/bin/linuxdeploy
198+
199+
- name: Build Linux artifacts
200+
env:
201+
SUBSCRIPTION_ENCRYPT_KEY: ${{ secrets.SUBSCRIPTION_ENCRYPT_KEY }}
202+
run: |
203+
chmod +x build-linux.sh
204+
./build-linux.sh
205+
206+
- name: Upload Linux artifacts
207+
uses: actions/upload-artifact@v4
208+
with:
209+
name: release-assets-linux
210+
path: |
211+
build/bin/*.deb
212+
build/bin/*.rpm
213+
build/bin/*.AppImage
214+
retention-days: 1
215+
if-no-files-found: warn
216+
112217
create-release:
113-
needs: build
218+
needs: [build-windows, build-macos, build-linux]
114219
runs-on: ubuntu-latest
115220
permissions:
116221
contents: write
@@ -169,7 +274,8 @@ jobs:
169274
uses: actions/download-artifact@v4
170275
with:
171276
path: release-assets
172-
name: release-assets-windows
277+
pattern: release-assets-*
278+
merge-multiple: true
173279

174280
- name: Create GitHub Release
175281
id: create_release
@@ -182,4 +288,3 @@ jobs:
182288
prerelease: false
183289
env:
184290
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
185-

README.en.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
</p>
1111

1212
<p align="center">
13-
<img src="https://img.shields.io/badge/version-3.1.0-blue.svg" alt="Version">
13+
<img src="https://img.shields.io/badge/version-3.1.1-blue.svg" alt="Version">
1414
<img src="https://img.shields.io/badge/desktop-Wails-27272f.svg" alt="Wails">
1515
<img src="https://img.shields.io/badge/backend-Go-00ADD8.svg" alt="Go">
1616
<img src="https://img.shields.io/badge/frontend-React_18-61dafb.svg" alt="React">
@@ -33,7 +33,7 @@
3333

3434
## Overview
3535

36-
ResultV **3.1.0** is a native desktop application built with **[Wails v2](https://wails.io/)**. The UI is **React 18** with **Vite** and **Tailwind CSS**; traffic is handled by a **Go** backend and **[sing-box](https://github.com/SagerNet/sing-box)** (with project-specific build tags in `wails.json`). The interface is localized with **i18next** (English and Russian).
36+
ResultV **3.1.1** is a native desktop application built with **[Wails v2](https://wails.io/)**. The UI is **React 18** with **Vite** and **Tailwind CSS**; traffic is handled by a **Go** backend and **[sing-box](https://github.com/SagerNet/sing-box)** (with project-specific build tags in `wails.json`). The interface is localized with **i18next** (English and Russian).
3737

3838
**Prebuilt releases:** GitHub Actions currently publishes **Windows amd64** artifacts (portable `.exe` and NSIS installer) when a `v*` tag is pushed. **macOS and Linux** code paths exist in the repository, but automated CI releases are currently Windows-only; other platforms will be available later due to the full migration of the project to the Go stack.
3939

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
</p>
1111

1212
<p align="center">
13-
<img src="https://img.shields.io/badge/version-3.1.0-blue.svg" alt="Version">
13+
<img src="https://img.shields.io/badge/version-3.1.1-blue.svg" alt="Version">
1414
<img src="https://img.shields.io/badge/desktop-Wails-27272f.svg" alt="Wails">
1515
<img src="https://img.shields.io/badge/backend-Go-00ADD8.svg" alt="Go">
1616
<img src="https://img.shields.io/badge/frontend-React_18-61dafb.svg" alt="React">
@@ -33,7 +33,7 @@
3333

3434
## О проекте
3535

36-
ResultV **3.1.0** — нативное настольное приложение на **[Wails v2](https://wails.io/)**. Интерфейс: **React 18**, **Vite**, **Tailwind CSS**; трафик обрабатывает бэкенд на **Go** и движок **[sing-box](https://github.com/SagerNet/sing-box)** (теги сборки заданы в `wails.json`). Локализация через **i18next** (русский и английский).
36+
ResultV **3.1.1** — нативное настольное приложение на **[Wails v2](https://wails.io/)**. Интерфейс: **React 18**, **Vite**, **Tailwind CSS**; трафик обрабатывает бэкенд на **Go** и движок **[sing-box](https://github.com/SagerNet/sing-box)** (теги сборки заданы в `wails.json`). Локализация через **i18next** (русский и английский).
3737

3838
**Готовые сборки:** в GitHub Actions публикуются артефакты **Windows amd64** (portable `.exe` и установщик NSIS) при push тега `v`*. Код содержит ветки под **macOS** и **Linux**, но автоматические релизы в CI сейчас только для Windows; остальные платформы будут доступны позже, в связи с полным переносом проекта на GO стек.
3939

app.go

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -743,6 +743,42 @@ func (a *App) GetPlatform() string {
743743
return runtime.GOOS
744744
}
745745

746+
// PickAppForWhitelist opens a native file dialog so the user can choose an
747+
// application to add to the per-app whitelist. The returned string is the
748+
// canonical entry (basename of the executable on Windows/Linux, resolved
749+
// CFBundleExecutable on macOS) ready to be appended to RoutingRules.AppWhitelist.
750+
//
751+
// Returns an empty string if the user cancels the dialog.
752+
func (a *App) PickAppForWhitelist() (string, error) {
753+
if a.ctx == nil {
754+
return "", fmt.Errorf("app not started")
755+
}
756+
opts := wailsRuntime.OpenDialogOptions{
757+
Title: "Select application",
758+
}
759+
switch runtime.GOOS {
760+
case "windows":
761+
opts.Filters = []wailsRuntime.FileFilter{
762+
{DisplayName: "Executables (*.exe)", Pattern: "*.exe"},
763+
}
764+
case "darwin":
765+
// Cocoa's NSOpenPanel treats .app bundles as files by default, so the
766+
// user can pick "Brave.app" directly. Don't set a filter — it would
767+
// hide the bundles from the dialog.
768+
opts.DefaultDirectory = "/Applications"
769+
case "linux":
770+
opts.DefaultDirectory = "/usr/bin"
771+
}
772+
path, err := wailsRuntime.OpenFileDialog(a.ctx, opts)
773+
if err != nil {
774+
return "", err
775+
}
776+
if path == "" {
777+
return "", nil
778+
}
779+
return system.NormalizeAppEntry(path), nil
780+
}
781+
746782
func (a *App) IsAdmin() bool {
747783
return system.IsAdmin()
748784
}

build-linux.sh

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
#!/usr/bin/env bash
2+
# Build the Linux binary and bundle it as .deb/.rpm via nfpm, plus an .AppImage
3+
# via linuxdeploy when available.
4+
#
5+
# Optional environment:
6+
# SUBSCRIPTION_ENCRYPT_KEY — pinned at link time if set.
7+
# VERSION — overrides the version stamped into the packages
8+
# (default: pulled from update.json).
9+
10+
set -euo pipefail
11+
12+
OUT_DIR="build/bin"
13+
mkdir -p "$OUT_DIR"
14+
15+
if [ -z "${VERSION:-}" ]; then
16+
VERSION=$(node -e "process.stdout.write(require('./update.json').version)" 2>/dev/null || echo "0.0.0")
17+
fi
18+
export VERSION
19+
20+
LDFLAGS=""
21+
if [ -n "${SUBSCRIPTION_ENCRYPT_KEY:-}" ]; then
22+
LDFLAGS="-X resultproxy-wails/internal/proxy.subscriptionEncryptKey=${SUBSCRIPTION_ENCRYPT_KEY}"
23+
fi
24+
25+
echo "==> wails build (linux/amd64) version=$VERSION"
26+
# webkit2_41 selects libwebkit2gtk-4.1 (Ubuntu 22.04+/24.04, Debian 12+).
27+
# Drop the tag if you target distros that still ship webkit2gtk-4.0.
28+
BUILD_TAGS="${WAILS_TAGS:-webkit2_41}"
29+
if [ -n "$LDFLAGS" ]; then
30+
wails build -clean -platform linux/amd64 -tags "$BUILD_TAGS" -ldflags "$LDFLAGS"
31+
else
32+
wails build -clean -platform linux/amd64 -tags "$BUILD_TAGS"
33+
fi
34+
35+
BIN_PATH=$(find "$OUT_DIR" -maxdepth 2 -type f -name "ResultV" | head -n1)
36+
if [ -z "$BIN_PATH" ]; then
37+
echo "ERROR: ResultV binary not produced under $OUT_DIR" >&2
38+
exit 1
39+
fi
40+
41+
echo "==> nfpm pkg (.deb)"
42+
if command -v nfpm >/dev/null 2>&1; then
43+
nfpm pkg --packager deb --target "$OUT_DIR/" --config build/linux/nfpm.yaml
44+
nfpm pkg --packager rpm --target "$OUT_DIR/" --config build/linux/nfpm.yaml
45+
else
46+
echo "WARN: nfpm not installed — skipping .deb/.rpm. Install: go install github.com/goreleaser/nfpm/v2/cmd/nfpm@latest"
47+
fi
48+
49+
echo "==> AppImage"
50+
if command -v linuxdeploy >/dev/null 2>&1; then
51+
APPDIR="$OUT_DIR/ResultV.AppDir"
52+
rm -rf "$APPDIR"
53+
mkdir -p "$APPDIR/usr/bin" "$APPDIR/usr/share/applications" "$APPDIR/usr/share/icons/hicolor/512x512/apps"
54+
cp "$BIN_PATH" "$APPDIR/usr/bin/resultv"
55+
cp build/linux/resultv.desktop "$APPDIR/usr/share/applications/resultv.desktop"
56+
cp public/logo.png "$APPDIR/usr/share/icons/hicolor/512x512/apps/resultv.png"
57+
ARCH=x86_64 linuxdeploy --appdir "$APPDIR" --output appimage --desktop-file "$APPDIR/usr/share/applications/resultv.desktop"
58+
mv ResultV*.AppImage "$OUT_DIR/" 2>/dev/null || true
59+
else
60+
echo "WARN: linuxdeploy not installed — skipping AppImage. https://github.com/linuxdeploy/linuxdeploy/releases"
61+
fi
62+
63+
echo "Done. Artifacts under $OUT_DIR/"
64+
ls -la "$OUT_DIR/"

0 commit comments

Comments
 (0)