Skip to content

Commit dd3fc30

Browse files
outspaceyaroslavyaroslav
authored andcommitted
[macos-awg]
1 parent b790452 commit dd3fc30

File tree

1 file changed

+60
-5
lines changed

1 file changed

+60
-5
lines changed

.github/workflows/build_awg_macos.yml

Lines changed: 60 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,62 @@ jobs:
3737
- name: 'Archive artifacts'
3838
uses: actions/upload-artifact@v4
3939
with:
40-
name: awg-macos
40+
name: awg-macos-binary
4141
path: amneziawg-go/amneziawg-go
4242

43+
Build-AWG-macOS-NE:
44+
name: 'AmneziaWG for MacOS NE'
45+
runs-on: macos-13
46+
if: |
47+
contains(github.event.head_commit.message, '[all]') ||
48+
contains(github.event.head_commit.message, '[macos]') ||
49+
contains(github.event.head_commit.message, '[macos-awg]') ||
50+
contains(github.event.head_commit.message, '[macos-awg-ne]') ||
51+
contains(github.event.head_commit.message, '[awg]')
52+
53+
steps:
54+
- name: 'Get AmneziaWG'
55+
uses: actions/checkout@v4
56+
with:
57+
repository: amnezia-vpn/amneziawg-apple
58+
ref: v1.0.0
59+
path: amneziawg-apple
60+
61+
- name: 'Setup Go'
62+
uses: actions/setup-go@v4
63+
with:
64+
go-version: 1.24.4
65+
cache-dependency-path: go.sum
66+
67+
- name: 'Run build script'
68+
working-directory: amneziawg-apple/Sources/WireGuardKitGo
69+
run: |
70+
make build
71+
72+
- name: 'Verify fat binary for libwg-go.a'
73+
working-directory: amneziawg-apple/Sources/WireGuardKitGo/out
74+
run: |
75+
if [ ! -f libwg-go.a ]; then
76+
echo "Error: libwg-go.a not found!"
77+
exit 1
78+
fi
79+
info=$(lipo -info libwg-go.a)
80+
echo "$info"
81+
if [[ "$info" != *"x86_64"* || "$info" != *"arm64"* ]]; then
82+
echo "Error: libwg-go.a is not a fat (universal) binary."
83+
exit 1
84+
fi
85+
86+
- name: 'Archive artifacts'
87+
uses: actions/upload-artifact@v4
88+
with:
89+
name: awg-macos-libwg
90+
path: amneziawg-apple/Sources/WireGuardKitGo/out/libwg-go.a
91+
92+
4393
github-release:
4494
name: GitHub Release
45-
needs: Build-AWG-MacOS
95+
needs: [Build-AWG-MacOS, Build-AWG-macOS-NE]
4696
runs-on: ubuntu-latest
4797
if: startsWith(github.ref, 'refs/tags/')
4898

@@ -54,16 +104,21 @@ jobs:
54104
uses: actions/download-artifact@v4
55105

56106
- name: Setup | Checksums
57-
run: for file in $(find ./ -name '*' ); do openssl dgst -sha256 -r "$file" | awk '{print $1}' > "${file}.sha256"; done
107+
run: |
108+
for file in awg-macos-libwg/libwg-go.a awg-macos-binary/amneziawg-go; do
109+
openssl dgst -sha256 -r "$file" | awk '{print $1}' > "${file}.sha256"
110+
done
58111
59112
- name: Zip ALL
60-
run: for file in *; do zip -r ${file%.*}.zip $file; done
113+
run: |
114+
zip -j libwg-go.a.zip awg-macos-libwg/libwg-go.a awg-macos-libwg/libwg-go.a.sha256
115+
zip -j amneziawg-go.zip awg-macos-binary/amneziawg-go awg-macos-binary/amneziawg-go.sha256
61116
62117
- name: Upload binaries to release
63118
uses: svenstaro/upload-release-action@v2
64119
with:
65120
repo_token: ${{ secrets.GITHUB_TOKEN }}
66-
file: awg-macos.zip
121+
file: "*.zip"
67122
tag: ${{ github.ref }}
68123
overwrite: true
69124
file_glob: true

0 commit comments

Comments
 (0)