-
Notifications
You must be signed in to change notification settings - Fork 0
113 lines (91 loc) · 3.72 KB
/
build_depends_and_submit.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
113
name: Build Depends and Submit
on:
schedule:
- cron: '00 11 * * *'
workflow_dispatch: {}
jobs:
Builder:
runs-on: macos-12
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Checkout Build Depends
uses: actions/checkout@v4
with:
ref: 'ci_cd_auto_build_depends'
path: 'ci_cd_auto_build_depends'
- name: Checkout Neo-Omega Core
uses: actions/checkout@v4
with:
repository: 'OmineDev/neomega-core'
path: 'neomega_core'
- name: Checkout Raknet
uses: actions/checkout@v4
with:
repository: 'OmineDev/go-raknet'
path: 'neomega_core/go-raknet'
- name: Check for new commits
id: check_commits
run: sh ci_cd_auto_build_depends/test_commit_changes.sh
- name: Set Up Go
if: steps.check_commits.outputs.changed == 'true'
uses: actions/setup-go@v2
- name: Configure Makefile
if: steps.check_commits.outputs.changed == 'true'
run: mv ci_cd_auto_build_depends/Makefile neomega_core/neomega/c_api
- name: Configure Go Mod File
if: steps.check_commits.outputs.changed == 'true'
run: sed -i "" "s/\.\.\/go-raknet/\.\/go-raknet/g" neomega_core/go.mod
- name: Cache NDK
if: steps.cache-ndk.outputs.cache-hit != 'true'
id: cache-ndk
uses: actions/cache@v3
with:
key: android-ndk-r20b-cache
path: ~/android-ndk-r20b
- name: Set up NDK
if: steps.cache-ndk.outputs.cache-hit != 'true'
uses: nttld/[email protected]
id: setup-ndk
with:
ndk-version: r20b
add-to-path: false
- name: Move NDK
if: steps.cache-ndk.outputs.cache-hit != 'true'
run: mv ${{ steps.setup-ndk.outputs.ndk-path }} ${HOME}/android-ndk-r20b
- name: Install Dependencies
if: steps.check_commits.outputs.changed == 'true'
run: |
echo "${{ steps.setup-ndk.outputs.ndk-path }}"
brew install mingw-w64
brew install messense/macos-cross-toolchains/x86_64-unknown-linux-gnu
brew install messense/macos-cross-toolchains/aarch64-unknown-linux-gnu
brew install make
- name: Build Connect Library
if: steps.check_commits.outputs.changed == 'true'
run: |
cd neomega_core/neomega/c_api
make all
rm -rf libs/*.h
- name: Build Access Point
if: steps.check_commits.outputs.changed == 'true'
run: |
cd neomega_core/neomega/entries/access_point_entry/cli
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o build/neomega_linux_access_point_amd64
CGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -o build/neomega_windows_access_point_amd64.exe
CGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -o build/neomega_linux_access_point_arm64
CGO_ENABLED=0 GOOS=windows GOARCH=arm64 go build -o build/neomega_windows_access_point_arm64.exe
CGO_CFLAGS= CGO_ENABLED=1 GOOS=android GOARCH=arm64 CC=${HOME}/android-ndk-r20b/toolchains/llvm/prebuilt/darwin-x86_64/bin/aarch64-linux-android21-clang CXX=${HOME}/android-ndk-r20b/toolchains/llvm/prebuilt/darwin-x86_64/bin/aarch64-linux-android21-clang++ go build -trimpath -ldflags="-s -w" -o build/neomega_android_access_point_arm64
- name: Move Binary Files and Clean Up
if: steps.check_commits.outputs.changed == 'true'
run: |
mv neomega_core/neomega/c_api/libs/* ./
mv neomega_core/neomega/entries/access_point_entry/cli/build/* ./
rm -rf ci_cd_auto_build_depends
rm -rf neomega_core
- name: Submit Changes
if: steps.check_commits.outputs.changed == 'true'
uses: EndBug/add-and-commit@v9
with:
default_author: github_actions
message: '[AUTO] build depends and submit'