-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Macbook
authored and
Macbook
committed
Dec 20, 2024
1 parent
badc071
commit 3742af2
Showing
1 changed file
with
67 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
name: Build OpenVPNAdapter for ios | ||
|
||
on: [push] | ||
|
||
jobs: | ||
build-macos: | ||
name: 'AmneziaWG for macOS NE' | ||
runs-on: macos-latest | ||
if: | | ||
contains(github.event.head_commit.message, '[all]') || | ||
contains(github.event.head_commit.message, '[macos]') || | ||
contains(github.event.head_commit.message, '[openvpnadapter]') | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
|
||
- name: 'Get OpenVPNAdapter' | ||
uses: actions/checkout@v3 | ||
with: | ||
repository: amnezia-vpn/OpenVPNAdapter | ||
ref: feature/macox-network-extension | ||
path: OpenVPNAdapter | ||
|
||
- name: Set up Xcode environment | ||
run: | | ||
echo "Setting up Xcode environment" | ||
export XCODEBUILD="/usr/bin/xcodebuild" | ||
export WORKINGDIR=`pwd` | ||
export PATCH="/usr/bin/patch" | ||
- name: Configure amnezia.xcconfig | ||
run: | | ||
echo "Configuring amnezia.xcconfig..." | ||
cat $WORKINGDIR/3rd/OpenVPNAdapter/Configuration/Project-MacNE.xcconfig > $WORKINGDIR/3rd/OpenVPNAdapter/Configuration/amnezia.xcconfig | ||
cat << EOF >> $WORKINGDIR/3rd/OpenVPNAdapter/Configuration/amnezia.xcconfig | ||
PROJECT_TEMP_DIR = $WORKINGDIR/3rd/OpenVPNAdapter/build/OpenVPNAdapter.build | ||
CONFIGURATION_BUILD_DIR = $WORKINGDIR/3rd/OpenVPNAdapter/build/Release-macos | ||
BUILT_PRODUCTS_DIR = $WORKINGDIR/3rd/OpenVPNAdapter/build/Release-macos | ||
EOF | ||
- name: Get macOS SDK version | ||
id: sdk_version | ||
run: | | ||
MACOSX_SDK=$(xcrun --sdk macosx --show-sdk-path | sed -E 's/.*MacOSX([0-9]+\.[0-9]+)\.sdk/\1/') | ||
echo "Using macOS SDK version: $MACOSX_SDK" | ||
echo "::set-output name=sdk::$MACOSX_SDK" | ||
- name: Build OpenVPNAdapter | ||
run: | | ||
cd 3rd/OpenVPNAdapter | ||
$XCODEBUILD -scheme OpenVPNAdapter \ | ||
-configuration Release \ | ||
-xcconfig Configuration/amnezia.xcconfig \ | ||
-sdk macosx${{ steps.sdk_version.outputs.sdk }} \ | ||
-destination 'generic/platform=macOS' \ | ||
-project OpenVPNAdapter.xcodeproj | ||
- name: Remove CodeSignature | ||
run: | | ||
echo "Removing CodeSignature if exists..." | ||
rm -rf ./build/Release-macos/OpenVPNAdapter.framework/Versions/A/_CodeSignature | ||
- name: Archive Build | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: OpenVPNAdapter-macos | ||
path: 3rd/OpenVPNAdapter/build/Release-macos |