Build Depends and Submit #512
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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' |