Skip to content

Force Proxy to any Windows/MacOS/Linux Application TCP and UDP traffic

ci: make release workflows manual, fix macOS pkg version (#231)

AnoF-Cyber93fa90b59565
diff --git a/.github/workflows/build-mac.yml b/.github/workflows/build-mac.yml
index 6500223..754a4a9 100644
--- a/.github/workflows/build-mac.yml
+++ b/.github/workflows/build-mac.yml
@@ -163,7 +163,7 @@ jobs:
chmod +x build.sh
bash build.sh
- PKG_VERSION="3.2.0"
+ PKG_VERSION=$(grep -m1 '^VERSION=' build.sh | cut -d'"' -f2)
PKG_UNSIGNED="output/ProxyBridge-v${PKG_VERSION}-Universal-Installer.pkg"
PKG_SIGNED="output/ProxyBridge-v${PKG_VERSION}-Universal-Installer-signed.pkg"
diff --git a/.github/workflows/release-linux.yml b/.github/workflows/release-linux.yml
index 7552711..5c53757 100644
--- a/.github/workflows/release-linux.yml
+++ b/.github/workflows/release-linux.yml
@@ -1,9 +1,14 @@
name: Release ProxyBridge Linux
on:
- release:
- types: [published, created]
+ # manual only, so creating a release no longer triggers every OS build. create
+ # the release, then run just the workflow for the OS you want against its tag.
workflow_dispatch:
+ inputs:
+ tag:
+ description: 'Existing release tag to build and attach the installer to (e.g. v4.1.0)'
+ required: true
+ type: string
permissions:
contents: write
@@ -15,11 +20,13 @@ jobs:
permissions:
contents: write
actions: read
- if: github.event_name == 'release' || (github.event_name == 'workflow_dispatch' && github.actor == github.repository_owner)
+ if: github.actor == github.repository_owner
steps:
- name: Checkout code
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
+ with:
+ ref: ${{ inputs.tag }}
- name: Install build dependencies
run: |
@@ -96,16 +103,14 @@ jobs:
- name: Extract version from tag
id: version
run: |
- if [ "${{ github.event_name }}" == "release" ]; then
- VERSION="${{ github.event.release.tag_name }}"
- else
- VERSION="dev-$(date +%Y%m%d-%H%M%S)"
- fi
+ VERSION="$TAG"
# Remove 'v' prefix if present
VERSION="${VERSION#v}"
echo "version=$VERSION" >> $GITHUB_OUTPUT
echo "Version: $VERSION"
shell: bash
+ env:
+ TAG: ${{ inputs.tag }}
- name: Create release archive
run: |
@@ -138,12 +143,12 @@ jobs:
shell: bash
- name: Upload archive to release
- if: github.event_name == 'release'
run: |
- gh release upload "${{ github.event.release.tag_name }}" ProxyBridge-Linux-v*.tar.gz --clobber
+ gh release upload "$TAG" ProxyBridge-Linux-v*.tar.gz --clobber
shell: bash
env:
GH_TOKEN: ${{ github.token }}
+ TAG: ${{ inputs.tag }}
- name: Upload build artifacts
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
diff --git a/.github/workflows/release-mac.yml b/.github/workflows/release-mac.yml
index e7a1e5f..47b7ac7 100644
--- a/.github/workflows/release-mac.yml
+++ b/.github/workflows/release-mac.yml
@@ -3,9 +3,14 @@ permissions:
contents: write
on:
- release:
- types: [published, created]
+ # manual only, so creating a release no longer triggers every OS build. create
+ # the release, then run just the workflow for the OS you want against its tag.
workflow_dispatch:
+ inputs:
+ tag:
+ description: 'Existing release tag to build and attach the installer to (e.g. v4.1.0)'
+ required: true
+ type: string
jobs:
build-and-release:
@@ -13,11 +18,13 @@ jobs:
permissions:
contents: write
actions: read
- if: github.event_name == 'release' || (github.event_name == 'workflow_dispatch' && github.actor == github.repository_owner)
+ if: github.actor == github.repository_owner
steps:
- name: Checkout code
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
+ with:
+ ref: ${{ inputs.tag }}
- name: Set up Xcode
uses: maxim-lobanov/setup-xcode@ed7a3b1fda3918c0306d1b724322adc0b8cc0a90 # v1
@@ -180,7 +187,7 @@ jobs:
chmod +x build.sh
bash build.sh
- PKG_VERSION="3.2.0"
+ PKG_VERSION=$(grep -m1 '^VERSION=' build.sh | cut -d'"' -f2)
PKG_UNSIGNED="output/ProxyBridge-v${PKG_VERSION}-Universal-Installer.pkg"
PKG_SIGNED="output/ProxyBridge-v${PKG_VERSION}-Universal-Installer-signed.pkg"
@@ -223,11 +230,11 @@ jobs:
echo "PKG signed, notarized and stapled successfully"
- name: Upload PKG to Release
- if: github.event_name == 'release'
run: |
- gh release upload "${{ github.event.release.tag_name }}" MacOS/ProxyBridge/output/ProxyBridge-*.pkg --clobber
+ gh release upload "$TAG" MacOS/ProxyBridge/output/ProxyBridge-*.pkg --clobber
env:
GH_TOKEN: ${{ github.token }}
+ TAG: ${{ inputs.tag }}
- name: Upload PKG Artifact
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
diff --git a/.github/workflows/release-windows.yml b/.github/workflows/release-windows.yml
index 501e527..e04c1d2 100644
--- a/.github/workflows/release-windows.yml
+++ b/.github/workflows/release-windows.yml
@@ -1,9 +1,14 @@
name: Release ProxyBridge Windows
on:
- release:
- types: [published, created]
+ # manual only, so creating a release no longer triggers every OS build. create
+ # the release, then run just the workflow for the OS you want against its tag.
workflow_dispatch:
+ inputs:
+ tag:
+ description: 'Existing release tag to build and attach the installer to (e.g. v4.1.0)'
+ required: true
+ type: string
permissions:
contents: write
@@ -14,11 +19,13 @@ jobs:
permissions:
contents: write
actions: read
- if: github.event_name == 'release' || (github.event_name == 'workflow_dispatch' && github.actor == github.repository_owner)
+ if: github.actor == github.repository_owner
steps:
- name: Checkout code
uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
+ with:
+ ref: ${{ inputs.tag }}
- name: Verify WinDivert installation
run: |
@@ -45,16 +52,16 @@ jobs:
shell: pwsh
- name: Upload installer to release
- if: github.event_name == 'release'
run: |
- gh release upload "${{ github.event.release.tag_name }}" (Get-ChildItem Windows/output/ProxyBridge-Setup-*.exe) --clobber
+ gh release upload "$env:TAG" (Get-ChildItem Windows/output/ProxyBridge-Setup-*.exe) --clobber
shell: pwsh
env:
GH_TOKEN: ${{ github.token }}
+ TAG: ${{ inputs.tag }}
- name: Upload build artifacts
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
with:
- name: ProxyBridge-Release-${{ github.event.release.tag_name }}
+ name: ProxyBridge-Release-${{ inputs.tag }}
path: Windows/output/
retention-days: 90
diff --git a/MacOS/ProxyBridge/build.sh b/MacOS/ProxyBridge/build.sh
index 0fd1d42..ca6339f 100755
--- a/MacOS/ProxyBridge/build.sh
+++ b/MacOS/ProxyBridge/build.sh
@@ -5,6 +5,14 @@ set -e
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
VERSION="4.1.0"
+# the pkg name/version here and the version shown in the app (About page, bundle)
+# come from different places, make a mismatch fail the build instead of shipping it
+PROJECT_VERSIONS=$(grep "MARKETING_VERSION" "$SCRIPT_DIR/ProxyBridge.xcodeproj/project.pbxproj" | sed -E 's/.*= *([^;]+);.*/\1/' | sort -u)
+if [ "$PROJECT_VERSIONS" != "$VERSION" ]; then
+ echo "Version mismatch: build.sh VERSION=$VERSION but MARKETING_VERSION in the Xcode project is: $(echo $PROJECT_VERSIONS)"
+ exit 1
+fi
+
if [ -f "$SCRIPT_DIR/.env" ]; then
source "$SCRIPT_DIR/.env"
fi