diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 908ee23..bb7ffe1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 138d4f8..a5653f0 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -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 @@ -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 }} diff --git a/AGENTS.md b/AGENTS.md index 2e54a32..ecc9ac0 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -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. diff --git a/README.md b/README.md index 35c47f1..654fff3 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/package.json b/package.json index fa28941..92d5623 100644 --- a/package.json +++ b/package.json @@ -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": { diff --git a/src-tauri/Cargo.lock b/src-tauri/Cargo.lock index 17f658f..160a1b0 100644 --- a/src-tauri/Cargo.lock +++ b/src-tauri/Cargo.lock @@ -2370,7 +2370,7 @@ dependencies = [ [[package]] name = "proxybench" -version = "0.2.0" +version = "0.2.1" dependencies = [ "base64 0.22.1", "bytes", diff --git a/src-tauri/Cargo.toml b/src-tauri/Cargo.toml index 39da988..07effca 100644 --- a/src-tauri/Cargo.toml +++ b/src-tauri/Cargo.toml @@ -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" diff --git a/src-tauri/src/export.rs b/src-tauri/src/export.rs index 58e1e86..45e443c 100644 --- a/src-tauri/src/export.rs +++ b/src-tauri/src/export.rs @@ -1,5 +1,4 @@ use std::fs; -use std::io::Write; use std::path::Path; use crate::session::StoredBucket; @@ -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) diff --git a/src-tauri/src/inventory.rs b/src-tauri/src/inventory.rs index 96dbbf0..72ce772 100644 --- a/src-tauri/src/inventory.rs +++ b/src-tauri/src/inventory.rs @@ -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}; @@ -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) diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index ff47638..baa3040 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -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",