Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build cloak, macos, awg for macos x86_64, arm64 #13

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 45 additions & 0 deletions .github/workflows/build_awg_macosne.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: awg-macos-network-extension

on: [push]

jobs:
Build-WG-macOS-NE:
name: 'AmneziaWG for macOS NE'
runs-on: macos-13
if: |
contains(github.event.head_commit.message, '[all]') ||
contains(github.event.head_commit.message, '[macos]') ||
contains(github.event.head_commit.message, '[awg]') ||
contains(github.event.head_commit.message, '[macos-ne-awg]')

steps:
- name: 'Install dependencies'
run: brew install swiftlint

- name: 'Setup/Update Go'
uses: actions/setup-go@v5
with:
go-version: '>=1.22.1'

- name: 'Get AmneziaWG'
uses: actions/checkout@v4
with:
repository: amnezia-vpn/amneziawg-apple
ref: feature/xray-merge
path: awg-apple

- name: 'Build WG x86_64 for macOS'
working-directory: awg-apple/Sources/WireGuardKitGo
run: |
ARCHS=x86_64
PLATFORM_NAME=macosx
OUTPUT_DIR="${{ github.workspace }}/awg-apple/Sources/WireGuardKitGo/out"
TMP_DIR="${{ github.workspace }}/awg-apple/Sources/WireGuardKitGo/.tmp/wireguard-go-bridge"
make
- name: 'Archive artifacts'
uses: actions/upload-artifact@v4
with:
name: awg-macos
path: ${{ github.workspace }}/awg-apple/Sources/WireGuardKitGo/out
if-no-files-found: error
retention-days: 7
17 changes: 9 additions & 8 deletions .github/workflows/build_cloak.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,15 @@ jobs:
if: |
contains(github.event.head_commit.message, '[all]') ||
contains(github.event.head_commit.message, '[macos]') ||
contains(github.event.head_commit.message, '[cloak]')
contains(github.event.head_commit.message, '[cloak]') ||
contains(github.event.head_commit.message, '[cloak-macos]')

name: "Build Cloak Desktop plugin"
name: "Build Cloak MacOS plugin"
steps:
- name: 'Install GO'
uses: actions/setup-go@v2
with:
go-version: '^1.22'

- name: Get Cloak
uses: actions/checkout@v3
Expand All @@ -106,16 +111,12 @@ jobs:
ref: master-amnezia
path: Cloak

# - name: 'Run build script'
# working-directory: Cloak
# run: |
# 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/
- name: Build for x86_64
- name: Build for x86_64 MacOS
working-directory: Cloak
run: |
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/

- name: Build for arm64
- name: Build for arm64 MacOS
working-directory: Cloak
run: |
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/
Expand Down
22 changes: 16 additions & 6 deletions .github/workflows/build_libssh_macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
contains(github.event.head_commit.message, '[libssh]')
strategy:
matrix:
arch: [x86_64]
arch: [arm64]
# no-crypto=yes: builds version with all crypto disabled
# no-crypto=no: builds version with all crypto enabled (where required dependencies are available)
no_crypto:
Expand All @@ -48,24 +48,34 @@ jobs:
- name: Build zlib
run: |
cd zlib-${{env.ZLIB_VERSION}}
cmake .
cmake . -DCMAKE_OSX_ARCHITECTURES=${{ matrix.arch }}
make zlibstatic
cp ./libz.a ${{github.workspace}}/libssh-${{env.LIBSSH_VERSION}}/build/libz.a

- name: Build openssl
run: |
cd openssl-${{env.OPENSSL_VERSION}}
./Configure no-asm no-shared darwin64-x86_64-cc
./Configure no-asm no-shared darwin64-${{ matrix.arch }}-cc
make

- name: Build libssh
run: |
cd libssh-${{env.LIBSSH_VERSION}}/build
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}}
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}}
make ssh
make install

- name: Copy libssh.a to build directory
run: |
mkdir -p libssh-${{env.LIBSSH_VERSION}}/build/${{ matrix.arch }}
cp /usr/local/lib/libssh.a libssh-${{env.LIBSSH_VERSION}}/build/${{ matrix.arch }}/libssh.a
cp ${{ github.workspace }}/zlib-${{ env.ZLIB_VERSION }}/libz.a libssh-${{env.LIBSSH_VERSION}}/build/${{ matrix.arch }}/libz.a

- name: List files in build directory
run: ls -la libssh-${{env.LIBSSH_VERSION}}/build/${{ matrix.arch }}

- name: Upload Artifact
uses: actions/upload-artifact@v2.2.4
uses: actions/upload-artifact@v3
with:
name: libssh-macos-${{ matrix.arch }}
path: ${{ github.workspace }}/libssh-${{env.LIBSSH_VERSION}}/build
Expand All @@ -80,7 +90,7 @@ jobs:

steps:
- name: Setup | Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Setup | Artifacts
uses: actions/download-artifact@v2
Expand Down