-
Notifications
You must be signed in to change notification settings - Fork 7
112 lines (98 loc) · 4.13 KB
/
build_openvpn_apple.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
name: Build OpenVPNAdapter for Apple
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: Configure amnezia.xcconfig
run: |
export WORKINGDIR=`pwd`
echo "Working directory: $WORKINGDIR"
echo "Configuring amnezia.xcconfig..."
cat $WORKINGDIR/OpenVPNAdapter/Configuration/Project-MacNE.xcconfig > $WORKINGDIR/OpenVPNAdapter/Configuration/amnezia.xcconfig
cat << EOF >> $WORKINGDIR/OpenVPNAdapter/Configuration/amnezia.xcconfig
PROJECT_TEMP_DIR = $WORKINGDIR/OpenVPNAdapter/build/OpenVPNAdapter.build
CONFIGURATION_BUILD_DIR = $WORKINGDIR/OpenVPNAdapter/build/Release-macos
BUILT_PRODUCTS_DIR = $WORKINGDIR/OpenVPNAdapter/build/Release-macos
EOF
- name: Get macOS SDK
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 OpenVPNAdapter
export XCODEBUILD="/usr/bin/xcodebuild"
$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: OpenVPNAdapter/build/Release-macos
build-ios:
name: 'Build OpenVPNAdapter for iOS'
runs-on: macos-latest
if: |
contains(github.event.head_commit.message, '[all]') ||
contains(github.event.head_commit.message, '[ios]') ||
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: master
path: OpenVPNAdapter
- name: Configure amnezia.xcconfig
run: |
export WORKINGDIR=`pwd`
echo "Configuring amnezia.xcconfig..."
cat $WORKINGDIR/OpenVPNAdapter/Configuration/Project.xcconfig > $WORKINGDIR/OpenVPNAdapter/Configuration/amnezia.xcconfig
cat << EOF >> $WORKINGDIR/OpenVPNAdapter/Configuration/amnezia.xcconfig
PROJECT_TEMP_DIR = $WORKINGDIR/OpenVPNAdapter/build/OpenVPNAdapter.build
CONFIGURATION_BUILD_DIR = $WORKINGDIR/OpenVPNAdapter/build/Release-iphoneos
BUILT_PRODUCTS_DIR = $WORKINGDIR/OpenVPNAdapter/build/Release-iphoneos
EOF
- name: Build OpenVPNAdapter for iOS
run: |
export SDK_PATH=`xcrun --sdk iphoneos --show-sdk-path`
export CLANG=`xcrun --sdk iphoneos --find clang`
export XCODEBUILD="/usr/bin/xcodebuild"
cd OpenVPNAdapter
$XCODEBUILD -scheme OpenVPNAdapter \
-configuration Release \
-xcconfig Configuration/amnezia.xcconfig \
-sdk iphoneos \
-destination 'generic/platform=iOS' \
-project OpenVPNAdapter.xcodeproj
- name: Archive Build
uses: actions/upload-artifact@v3
with:
name: OpenVPNAdapter-ios
path: OpenVPNAdapter/build/Release-iphoneos