Skip to content

Commit 8ee09bf

Browse files
authored
Merge pull request #17 from amnezia-vpn/cloack-macos
Cloak for macos fat binary ci/cd implemented
2 parents 9c90bdf + caa8a9f commit 8ee09bf

File tree

1 file changed

+25
-19
lines changed

1 file changed

+25
-19
lines changed

.github/workflows/build_cloak.yml

Lines changed: 25 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ on: [push]
44

55

66
jobs:
7-
87
Build-Cloak:
98
name: 'Build-Cloak'
109
runs-on: ubuntu-latest
@@ -52,64 +51,65 @@ jobs:
5251
mkdir ./release/plugin/linux
5352
CGO_ENABLED=1 GOOS="linux" GOARCH="amd64" go build -v -o ./release/plugin/linux/ck-ovpn-plugin.a -buildmode=c-archive ./cmd/ck-ovpn-plugin/
5453
mkdir ./release/plugin/windows
55-
CGO_ENABLED=1 CC=x86_64-w64-mingw32-gcc GOOS="windows" GOARCH="amd64" go build -v -o ./release/plugin/windows/ck-ovpn-plugin.dll -buildmode=c-shared ./cmd/ck-ovpn-plugin/
54+
CGO_ENABLED=1 CC=x86_64-w64-mingw32-gcc GOOS="windows" GOARCH="amd64" go build -v -o ./release/plugin/windows/ck-ovpn-plugin.dll -buildmode=c-shared ./cmd/ck-ovpn-plugin/
5655
5756
- name: Archive Linux client binary
58-
uses: actions/upload-artifact@v3
57+
uses: actions/upload-artifact@v4
5958
with:
6059
retention-days: 1
6160
name: ck-client-linux
6261
path: '~/work/3rd-build-ga/3rd-build-ga/Cloak/release/ck-client-linux*'
6362

6463
- name: Archive Windows client binary
65-
uses: actions/upload-artifact@v3
64+
uses: actions/upload-artifact@v4
6665
with:
6766
retention-days: 1
6867
name: ck-client-windows
6968
path: '~/work/3rd-build-ga/3rd-build-ga/Cloak/release/ck-client-windows*'
7069

7170
- name: Archive Darwin client binary
72-
uses: actions/upload-artifact@v3
71+
uses: actions/upload-artifact@v4
7372
with:
7473
retention-days: 1
7574
name: ck-client-darwin
7675
path: '~/work/3rd-build-ga/3rd-build-ga/Cloak/release/ck-client-darwin*'
7776

7877
- name: Archive Linux server binary
79-
uses: actions/upload-artifact@v3
78+
uses: actions/upload-artifact@v4
8079
with:
8180
retention-days: 1
8281
name: ck-server
8382
path: '~/work/3rd-build-ga/3rd-build-ga/Cloak/release/ck-server-linux*'
8483

8584
- name: Archive Plugin
86-
uses: actions/upload-artifact@v3
85+
uses: actions/upload-artifact@v4
8786
with:
8887
retention-days: 1
8988
name: desktop-plugin
9089
path: '~/work/3rd-build-ga/3rd-build-ga/Cloak/release/plugin'
9190

9291
Build-Cloak-MacOS:
93-
runs-on: macos-12
92+
runs-on: macos-13
9493
if: |
9594
contains(github.event.head_commit.message, '[all]') ||
9695
contains(github.event.head_commit.message, '[macos]') ||
9796
contains(github.event.head_commit.message, '[cloak]')
9897
99-
name: "Build Cloak Desktop plugin"
98+
name: "Build Cloak macOS plugin (fat)"
10099
steps:
101100

102101
- name: Get Cloak
103-
uses: actions/checkout@v3
102+
uses: actions/checkout@v4
104103
with:
105104
repository: amnezia-vpn/Cloak
106105
ref: master-amnezia
107106
path: Cloak
108107

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/
108+
- name: Set up Go
109+
uses: actions/setup-go@v5
110+
with:
111+
go-version: '1.21'
112+
113113
- name: Build for x86_64
114114
working-directory: Cloak
115115
run: |
@@ -126,14 +126,15 @@ jobs:
126126
lipo -create -output ./release/plugin/darwin/ck-ovpn-plugin.a \
127127
./release/plugin/darwin/ck-ovpn-plugin-x86_64.a \
128128
./release/plugin/darwin/ck-ovpn-plugin-arm64.a
129+
129130
- name: Archive artifacts
130-
uses: actions/upload-artifact@v3
131+
uses: actions/upload-artifact@v4
131132
with:
132133
name: darwin-pt
133134
path: Cloak/release/plugin
134135

135136
Build-Cloak-iOS:
136-
runs-on: macos-12
137+
runs-on: macos-13
137138
if: |
138139
contains(github.event.head_commit.message, '[all]') ||
139140
contains(github.event.head_commit.message, '[ios]') ||
@@ -143,27 +144,32 @@ jobs:
143144
steps:
144145

145146
- name: Get Cloak
146-
uses: actions/checkout@v3
147+
uses: actions/checkout@v4
147148
with:
148149
repository: amnezia-vpn/Cloak
149150
ref: master-amnezia
150151
path: Cloak
151152

153+
- name: Set up Go
154+
uses: actions/setup-go@v5
155+
with:
156+
go-version: '1.21'
157+
152158
- name: 'Run build script'
153159
working-directory: Cloak
154160
run: |
155161
GOOS=ios GOARCH=arm64 GOFLAGS="-tags=ios" CGO_CFLAGS="-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk -miphoneos-version-min=9.0 -fembed-bitcode -arch arm64" CGO_CXXFLAGS="-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk -miphoneos-version-min=9.0 -fembed-bitcode -arch arm64" CGO_LDFLAGS="-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk -miphoneos-version-min=9.0 -fembed-bitcode -arch arm64" CGO_ENABLED=1 go build -buildmode=c-archive -o ck-ovpn-plugin.a ./cmd/ck-ovpn-plugin
156162
157163
- name: Archive iOS client binary
158-
uses: actions/upload-artifact@v3
164+
uses: actions/upload-artifact@v4
159165
with:
160166
retention-days: 1
161167
name: ck-ios-plugin
162168
path: '~/work/3rd-build-ga/3rd-build-ga/Cloak/ck-ovpn-plugin*'
163169

164170
github-release:
165171
name: GitHub Release
166-
needs: Build-Cloak
172+
needs: [Build-Cloak-iOS, Build-Cloak-MacOS]
167173
runs-on: ubuntu-latest
168174
if: startsWith(github.ref, 'refs/tags/')
169175

0 commit comments

Comments
 (0)