Skip to content

Commit badc071

Browse files
MacbookMacbook
authored andcommitted
build cloak, macos, awg for macos x86_64, arm64
1 parent 6d998c8 commit badc071

File tree

3 files changed

+70
-14
lines changed

3 files changed

+70
-14
lines changed
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: awg-macos-network-extension
2+
3+
on: [push]
4+
5+
jobs:
6+
Build-WG-macOS-NE:
7+
name: 'AmneziaWG for macOS NE'
8+
runs-on: macos-13
9+
if: |
10+
contains(github.event.head_commit.message, '[all]') ||
11+
contains(github.event.head_commit.message, '[macos]') ||
12+
contains(github.event.head_commit.message, '[awg]') ||
13+
contains(github.event.head_commit.message, '[macos-ne-awg]')
14+
15+
steps:
16+
- name: 'Install dependencies'
17+
run: brew install swiftlint
18+
19+
- name: 'Setup/Update Go'
20+
uses: actions/setup-go@v5
21+
with:
22+
go-version: '>=1.22.1'
23+
24+
- name: 'Get AmneziaWG'
25+
uses: actions/checkout@v4
26+
with:
27+
repository: amnezia-vpn/amneziawg-apple
28+
ref: feature/xray-merge
29+
path: awg-apple
30+
31+
- name: 'Build WG x86_64 for macOS'
32+
working-directory: awg-apple/Sources/WireGuardKitGo
33+
run: |
34+
ARCHS=x86_64
35+
PLATFORM_NAME=macosx
36+
OUTPUT_DIR="${{ github.workspace }}/awg-apple/Sources/WireGuardKitGo/out"
37+
TMP_DIR="${{ github.workspace }}/awg-apple/Sources/WireGuardKitGo/.tmp/wireguard-go-bridge"
38+
make
39+
- name: 'Archive artifacts'
40+
uses: actions/upload-artifact@v4
41+
with:
42+
name: awg-macos
43+
path: ${{ github.workspace }}/awg-apple/Sources/WireGuardKitGo/out
44+
if-no-files-found: error
45+
retention-days: 7

.github/workflows/build_cloak.yml

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -94,10 +94,15 @@ jobs:
9494
if: |
9595
contains(github.event.head_commit.message, '[all]') ||
9696
contains(github.event.head_commit.message, '[macos]') ||
97-
contains(github.event.head_commit.message, '[cloak]')
97+
contains(github.event.head_commit.message, '[cloak]') ||
98+
contains(github.event.head_commit.message, '[cloak-macos]')
9899
99-
name: "Build Cloak Desktop plugin"
100+
name: "Build Cloak MacOS plugin"
100101
steps:
102+
- name: 'Install GO'
103+
uses: actions/setup-go@v2
104+
with:
105+
go-version: '^1.22'
101106

102107
- name: Get Cloak
103108
uses: actions/checkout@v3
@@ -106,16 +111,12 @@ jobs:
106111
ref: master-amnezia
107112
path: Cloak
108113

109-
# - name: 'Run build script'
110-
# working-directory: Cloak
111-
# run: |
112-
# CGO_ENABLED=1 GOOS="darwin" GOARCH="amd64" go build -v -o ./release/plugin/darwin/ck-ovpn-plugin.a -buildmode=c-archive ./cmd/ck-ovpn-plugin/
113-
- name: Build for x86_64
114+
- name: Build for x86_64 MacOS
114115
working-directory: Cloak
115116
run: |
116117
CGO_ENABLED=1 GOOS="darwin" GOARCH="amd64" go build -v -o ./release/plugin/darwin/ck-ovpn-plugin-x86_64.a -buildmode=c-archive ./cmd/ck-ovpn-plugin/
117118
118-
- name: Build for arm64
119+
- name: Build for arm64 MacOS
119120
working-directory: Cloak
120121
run: |
121122
CGO_ENABLED=1 GOOS="darwin" GOARCH="arm64" go build -v -o ./release/plugin/darwin/ck-ovpn-plugin-arm64.a -buildmode=c-archive ./cmd/ck-ovpn-plugin/

.github/workflows/build_libssh_macos.yml

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
contains(github.event.head_commit.message, '[libssh]')
2222
strategy:
2323
matrix:
24-
arch: [x86_64]
24+
arch: [arm64]
2525
# no-crypto=yes: builds version with all crypto disabled
2626
# no-crypto=no: builds version with all crypto enabled (where required dependencies are available)
2727
no_crypto:
@@ -48,24 +48,34 @@ jobs:
4848
- name: Build zlib
4949
run: |
5050
cd zlib-${{env.ZLIB_VERSION}}
51-
cmake .
51+
cmake . -DCMAKE_OSX_ARCHITECTURES=${{ matrix.arch }}
5252
make zlibstatic
5353
cp ./libz.a ${{github.workspace}}/libssh-${{env.LIBSSH_VERSION}}/build/libz.a
5454
5555
- name: Build openssl
5656
run: |
5757
cd openssl-${{env.OPENSSL_VERSION}}
58-
./Configure no-asm no-shared darwin64-x86_64-cc
58+
./Configure no-asm no-shared darwin64-${{ matrix.arch }}-cc
5959
make
6060
6161
- name: Build libssh
6262
run: |
6363
cd libssh-${{env.LIBSSH_VERSION}}/build
64-
cmake .. -DCMAKE_BUILD_TYPE=Release -DOPENSSL_USE_STATIC_LIBS=TRUE -DWITH_GSSAPI=OFF -DBUILD_SHARED_LIBS=OFF -DOPENSSL_ROOT_DIR=${{github.workspace}}/openssl-${{env.OPENSSL_VERSION}} -DZLIB_ROOT_DIR=${{github.workspace}}/zlib-${{env.ZLIB_VERSION}} -DZLIB_LIBRARY=${{github.workspace}}/zlib-${{env.ZLIB_VERSION}}/libz.a -DZLIB_INCLUDE=${{github.workspace}}/zlib-${{env.ZLIB_VERSION}}
64+
cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_OSX_ARCHITECTURES=${{ matrix.arch }} -DOPENSSL_USE_STATIC_LIBS=TRUE -DWITH_GSSAPI=OFF -DBUILD_SHARED_LIBS=OFF -DOPENSSL_ROOT_DIR=${{github.workspace}}/openssl-${{env.OPENSSL_VERSION}} -DZLIB_ROOT_DIR=${{github.workspace}}/zlib-${{env.ZLIB_VERSION}} -DZLIB_LIBRARY=${{github.workspace}}/zlib-${{env.ZLIB_VERSION}}/libz.a -DZLIB_INCLUDE=${{github.workspace}}/zlib-${{env.ZLIB_VERSION}}
6565
make ssh
66+
make install
6667
68+
- name: Copy libssh.a to build directory
69+
run: |
70+
mkdir -p libssh-${{env.LIBSSH_VERSION}}/build/${{ matrix.arch }}
71+
cp /usr/local/lib/libssh.a libssh-${{env.LIBSSH_VERSION}}/build/${{ matrix.arch }}/libssh.a
72+
cp ${{ github.workspace }}/zlib-${{ env.ZLIB_VERSION }}/libz.a libssh-${{env.LIBSSH_VERSION}}/build/${{ matrix.arch }}/libz.a
73+
74+
- name: List files in build directory
75+
run: ls -la libssh-${{env.LIBSSH_VERSION}}/build/${{ matrix.arch }}
76+
6777
- name: Upload Artifact
68-
uses: actions/upload-artifact@v2.2.4
78+
uses: actions/upload-artifact@v3
6979
with:
7080
name: libssh-macos-${{ matrix.arch }}
7181
path: ${{ github.workspace }}/libssh-${{env.LIBSSH_VERSION}}/build
@@ -80,7 +90,7 @@ jobs:
8090

8191
steps:
8292
- name: Setup | Checkout
83-
uses: actions/checkout@v2
93+
uses: actions/checkout@v4
8494

8595
- name: Setup | Artifacts
8696
uses: actions/download-artifact@v2

0 commit comments

Comments
 (0)