Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,13 @@ jobs:
- run: cargo fmt --all --manifest-path src-tauri/Cargo.toml -- --check
- run: cargo clippy --locked --all-targets --manifest-path src-tauri/Cargo.toml -- -D warnings
- run: cargo test --locked --lib --manifest-path src-tauri/Cargo.toml

rust-windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09
- uses: actions-rust-lang/setup-rust-toolchain@166cdcfd11aee3cb47222f9ddb555ce30ddb9659
with:
cache-workspaces: src-tauri -> target
- run: cargo clippy --locked --all-targets --manifest-path src-tauri/Cargo.toml -- -D warnings
- run: cargo test --locked --lib --manifest-path src-tauri/Cargo.toml
61 changes: 15 additions & 46 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ jobs:
- uses: actions-rust-lang/setup-rust-toolchain@166cdcfd11aee3cb47222f9ddb555ce30ddb9659
with:
target: ${{ matrix.target }}
cache-workspaces: src-tauri -> target

- run: bun install --frozen-lockfile

Expand All @@ -43,61 +44,29 @@ jobs:
git fetch --no-tags --depth=1 origin main:refs/remotes/origin/main
test "$(git rev-parse HEAD)" = "$(git rev-parse origin/main)"

- name: check Apple signing configuration
- name: build ad-hoc signed macOS release
if: startsWith(matrix.os, 'macos')
shell: bash
env:
APPLE_API_ISSUER: ${{ secrets.APPLE_API_ISSUER }}
APPLE_API_KEY_ID: ${{ secrets.APPLE_API_KEY_ID }}
APPSTORE_P8_BASE64: ${{ secrets.APPLE_APPSTORE_CONNECT_P8_BASE64 }}
APPLE_CERTIFICATE: ${{ secrets.APPLE_CERTIFICATE }}
APPLE_CERTIFICATE_PASSWORD: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }}
APPLE_SIGNING_IDENTITY_RAW: ${{ secrets.APPLE_SIGNING_IDENTITY }}
run: |
if [ -z "${APPLE_API_KEY_ID}${APPLE_API_ISSUER}${APPSTORE_P8_BASE64}${APPLE_CERTIFICATE}${APPLE_CERTIFICATE_PASSWORD}${APPLE_SIGNING_IDENTITY_RAW}" ]; then
echo "No Apple signing secrets configured; building unsigned."
exit 0
fi
status=0
for var in APPLE_API_KEY_ID APPLE_API_ISSUER APPSTORE_P8_BASE64 APPLE_CERTIFICATE APPLE_CERTIFICATE_PASSWORD APPLE_SIGNING_IDENTITY_RAW; do
if [ -z "$(eval "printf '%s' \"\${$var}\"")" ]; then
echo "Missing $var"
status=1
fi
done
if [ "$status" -ne 0 ]; then
echo "Apple signing secrets are partially configured."
exit 1
fi

- name: materialize App Store Connect API key
if: startsWith(matrix.os, 'macos')
shell: bash
env:
APPLE_API_KEY_ID: ${{ secrets.APPLE_API_KEY_ID }}
APPSTORE_P8_BASE64: ${{ secrets.APPLE_APPSTORE_CONNECT_P8_BASE64 }}
run: |
if [ -z "$APPLE_API_KEY_ID" ]; then
exit 0
fi
key_path="$RUNNER_TEMP/AuthKey_${APPLE_API_KEY_ID}.p8"
printf '%s' "$APPSTORE_P8_BASE64" | base64 -d > "$key_path"
echo "APPLE_API_KEY_PATH=$key_path" >> "$GITHUB_ENV"
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
APPLE_SIGNING_IDENTITY: "-"
uses: tauri-apps/tauri-action@1deb371b0cd8bd54025b384f1cd735e725c4060f
with:
tagName: v__VERSION__
releaseName: proxybench v__VERSION__
releaseBody: Preview builds made without certificates yet. macOS DMGs need right-click Open on first launch. The Windows NSIS setup wizard may trigger SmartScreen; choose More info, then Run anyway.
releaseDraft: false
tauriScript: bun run tauri
args: ${{ matrix.args }}

- uses: tauri-apps/tauri-action@1deb371b0cd8bd54025b384f1cd735e725c4060f
- name: build Windows release
if: startsWith(matrix.os, 'windows')
uses: tauri-apps/tauri-action@1deb371b0cd8bd54025b384f1cd735e725c4060f
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
APPLE_CERTIFICATE: ${{ startsWith(matrix.os, 'macos') && secrets.APPLE_CERTIFICATE || '' }}
APPLE_CERTIFICATE_PASSWORD: ${{ startsWith(matrix.os, 'macos') && secrets.APPLE_CERTIFICATE_PASSWORD || '' }}
APPLE_SIGNING_IDENTITY: ${{ startsWith(matrix.os, 'macos') && secrets.APPLE_SIGNING_IDENTITY || '-' }}
APPLE_API_ISSUER: ${{ startsWith(matrix.os, 'macos') && secrets.APPLE_API_ISSUER || '' }}
APPLE_API_KEY: ${{ startsWith(matrix.os, 'macos') && secrets.APPLE_API_KEY_ID || '' }}
APPLE_API_KEY_PATH: ${{ env.APPLE_API_KEY_PATH }}
with:
tagName: v__VERSION__
releaseName: proxybench v__VERSION__
releaseBody: Preview builds made without certificates yet. macOS DMGs need right-click Open on first launch. The Windows NSIS setup wizard may trigger SmartScreen; choose More info, then Run anyway.
releaseDraft: false
tauriScript: bun run tauri
retryAttempts: 3
args: ${{ matrix.args }}
4 changes: 2 additions & 2 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,5 +119,5 @@ to the same `X.Y.Z`, merge to `main`, then tag `vX.Y.Z`.

GitHub Actions (`.github/workflows/ci.yml` on `main` and pull requests,
`.github/workflows/release.yml` on `vX.Y.Z`) builds macOS DMGs for Apple
Silicon and Intel and a Windows NSIS setup wizard. Apple signing runs only
when those secrets exist; otherwise the installers stay unsigned.
Silicon and Intel and a Windows NSIS setup wizard. macOS uses ad-hoc signing;
Windows installers are unsigned.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ On Windows, run the setup wizard. If SmartScreen appears, choose **More
info**, then **Run anyway**. Windows needs WebView2; Windows 10 and 11
usually already have it.

Builds are unsigned until signing certificates are configured.
macOS builds use ad-hoc signing and are not notarized. Windows installers are
unsigned.

## Use

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "proxybench",
"version": "0.2.0",
"version": "0.2.1",
"description": "Split HTTP proxy lists by subnet and measure Connect and TTFB",
"type": "module",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion src-tauri/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src-tauri/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "proxybench"
version = "0.2.0"
version = "0.2.1"
description = "Split HTTP proxy lists by subnet and measure Connect and TTFB"
edition = "2021"
license = "MIT"
Expand Down
2 changes: 1 addition & 1 deletion src-tauri/src/export.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
use std::fs;
use std::io::Write;
use std::path::Path;

use crate::session::StoredBucket;
Expand Down Expand Up @@ -78,6 +77,7 @@ fn io_error(path: &Path, err: std::io::Error) -> String {
fn write_mode(path: &Path, bytes: &[u8]) -> std::io::Result<()> {
#[cfg(unix)]
{
use std::io::Write;
use std::os::unix::fs::{OpenOptionsExt, PermissionsExt};
let mut file = fs::OpenOptions::new()
.write(true)
Expand Down
3 changes: 2 additions & 1 deletion src-tauri/src/inventory.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use std::collections::{BTreeMap, HashMap, HashSet};
use std::fs;
use std::io::{ErrorKind, Write};
use std::io::ErrorKind;
use std::path::{Path, PathBuf};

use crate::parse::{self, ProxyLine};
Expand Down Expand Up @@ -202,6 +202,7 @@ fn write_atomic(path: &Path, bytes: &[u8]) -> Result<(), String> {
fn write_mode(path: &Path, bytes: &[u8]) -> std::io::Result<()> {
#[cfg(unix)]
{
use std::io::Write;
use std::os::unix::fs::{OpenOptionsExt, PermissionsExt};
let mut file = fs::OpenOptions::new()
.write(true)
Expand Down
4 changes: 2 additions & 2 deletions src-tauri/tauri.conf.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"$schema": "https://schema.tauri.app/config/2",
"productName": "proxybench",
"version": "0.2.0",
"identifier": "com.proxybench.app",
"version": "0.2.1",
"identifier": "com.mathious.proxybench",
"build": {
"beforeDevCommand": "bun run dev",
"devUrl": "http://localhost:1420",
Expand Down