Skip to content

Commit

Permalink
Update Autobuild workflow.
Browse files Browse the repository at this point in the history
  • Loading branch information
SoftwareGuy committed Apr 29, 2021
1 parent dd97d94 commit d2dfc85
Show file tree
Hide file tree
Showing 5 changed files with 105 additions and 40 deletions.
64 changes: 35 additions & 29 deletions .github/workflows/Build-Master.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ jobs:

- name: Run automated build script.
run: |
cd ${{ runner.workspace }}/ENet-CSharp && bash AutoBuild/githubAutoBuild.command
cd "${{ runner.workspace }}/ENet-CSharp" && bash AutoBuild/apple-mac.command
- name: Upload release library
id: upload-release-asset
Expand All @@ -114,7 +114,7 @@ jobs:
with:
upload_url: ${{ needs.create_release.outputs.create_release_url }}
asset_path: ${{ runner.workspace }}/ENet-CSharp/ReleaseOut/Release.zip
asset_name: libenet-release-MacOS.zip
asset_name: libenet-release-macOS.zip
asset_content_type: application/zip

- name: Upload debug library
Expand All @@ -125,7 +125,7 @@ jobs:
with:
upload_url: ${{ needs.create_release.outputs.create_release_url }}
asset_path: ${{ runner.workspace }}/ENet-CSharp/DebugOut/Debug.zip
asset_name: libenet-debug-MacOS.zip
asset_name: libenet-debug-macOS.zip
asset_content_type: application/zip

# END APPLE MACOS BUILD JOB
Expand All @@ -140,7 +140,7 @@ jobs:

- name: Run automated build script
run: |
cd ${{ runner.workspace }}\ENet-CSharp && &.\Autobuild\githubAutobuild.cmd ${{ runner.workspace }}
cd ${{ runner.workspace }}\ENet-CSharp && &.\Autobuild\ms-windows.cmd "${{ runner.workspace }}"
- name: Upload release library
id: upload-release-asset
Expand Down Expand Up @@ -179,20 +179,25 @@ jobs:
- name: Grab the latest copy of the repository.
uses: actions/checkout@v2

- name: Create temporary staging directories.
run: |
mkdir -p ${{ runner.workspace }}/temp/Release
mkdir -p ${{ runner.workspace }}/temp/Debug
- name: Run iOS build script in production mode.
run: |
cd $GITHUB_WORKSPACE/Build-iOS ; chmod +x ./Build-iOS.command ; ./Build-iOS.command
zip -j -9 ${{ runner.workspace }}/temp/Release/libenet.zip $GITHUB_WORKSPACE/Build-iOS/build/Release-iphoneos/libenet.a
- name: Run iOS build script in Debug mode.
- name: Run the iOS build script
run: |
cd $GITHUB_WORKSPACE/Build-iOS; sed -i '' 's/BUILD_TYPE="Release"/BUILD_TYPE="Debug"/g' Build-iOS.command ; chmod +x ./Build-iOS.command ; ./Build-iOS.command
zip -j -9 ${{ runner.workspace }}/temp/Debug/libenet.zip $GITHUB_WORKSPACE/Build-iOS/build/Debug-iphoneos/libenet.a
cd "$GITHUB_WORKSPACE/AutoBuild" && bash ./apple-ios.command
# - name: Create temporary staging directories.
# run: |
# mkdir -p ${{ runner.workspace }}/temp/Release
# mkdir -p ${{ runner.workspace }}/temp/Debug
#
# - name: Run iOS build script in production mode.
# run: |
# cd $GITHUB_WORKSPACE/Build-iOS ; chmod +x ./Build-iOS.command ; ./Build-iOS.command
# zip -j -9 ${{ runner.workspace }}/temp/Release/libenet.zip $GITHUB_WORKSPACE/Build-iOS/build/Release-iphoneos/libenet.a

# - name: Run iOS build script in Debug mode.
# run: |
# cd $GITHUB_WORKSPACE/Build-iOS; sed -i '' 's/BUILD_TYPE="Release"/BUILD_TYPE="Debug"/g' Build-iOS.command ; chmod +x ./Build-iOS.command ; ./Build-iOS.command
# zip -j -9 ${{ runner.workspace }}/temp/Debug/libenet.zip $GITHUB_WORKSPACE/Build-iOS/build/Debug-iphoneos/libenet.a
#

- name: Upload release library
id: upload-release-asset
Expand All @@ -201,20 +206,21 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create_release.outputs.create_release_url }}
asset_path: ${{ runner.workspace }}/temp/Release/libenet.zip
asset_name: libenet-release-iOS.zip
asset_path: ${{ runner.workspace }}/AutoBuild/Binaries/libenet-combo-iOS.zip
asset_name: libenet-combo-iOS.zip
asset_content_type: application/zip

- name: Upload debug library
id: upload-debug-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create_release.outputs.create_release_url }}
asset_path: ${{ runner.workspace }}/temp/Debug/libenet.zip
asset_name: libenet-debug-iOS.zip
asset_content_type: application/zip
# - name: Upload debug library
# id: upload-debug-asset
# uses: actions/upload-release-asset@v1
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# upload_url: ${{ needs.create_release.outputs.create_release_url }}
# asset_path: ${{ runner.workspace }}/temp/Debug/libenet.zip
# asset_name: libenet-debug-iOS.zip
# asset_content_type: application/zip

# END APPLE IOS BUILD JOB

# START ANDROID BUILD JOB
Expand Down
78 changes: 67 additions & 11 deletions AutoBuild/ios-autobuild.command → AutoBuild/apple-ios.command
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@
# https://github.com/nxrighthere/ENet-CSharp/blob/master/Source/Native/build-ios.sh
# Original portions by JohannesDeml, modifications by Coburn.

# Point sysdir to iOS SDK
export SDKROOT=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk
# Cache this for later.
WORKSPACE=$(pwd)
# Point sysdir to iOS SDK
RELEASE_SDKROOT="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk"
SIMULATOR_SDKROOT="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk"
WORKSPACE="$(pwd)"
OUTPUT="$WORKSPACE/Binaries"
X64_SIMULATOR_STAGING="$WORKSPACE/x86_64-apple-ios-simulator"
ARM64_STAGING="$WORKSPACE/arm64-apple-ios"
Expand Down Expand Up @@ -106,7 +107,8 @@ make_enet_directories() {

compile_enet_x64simulator () {
echo "Start compiling x64 Simulator"

export SDKROOT=$SIMULATOR_SDKROOT

cd "$X64_SIMULATOR_STAGING"
# Pre-clean
rm -vf *.a *.o
Expand All @@ -115,23 +117,40 @@ compile_enet_x64simulator () {

# Release Binaries
gcc -c Sources/enet.c -fembed-bitcode -target x86_64-apple-ios-simulator
if [ $? -ne 0 ]; then
echo "ERROR: Compile step resulted in failure."
exit $?
fi

# Create static library
libtool -static enet.o -o libenet-release-simulator64.a

if [ $? -ne 0 ]; then
echo "ERROR: Libtool step resulted in failure."
exit $?
fi

# Cleanup
rm -vf *.o

# Debug Binaries
gcc -DENET_DEBUG=1 -c Sources/enet.c -fembed-bitcode -target x86_64-apple-ios-simulator
if [ $? -ne 0 ]; then
echo "ERROR: Compile step resulted in failure."
exit $?
fi
libtool -static enet.o -o libenet-debug-simulator64.a

if [ $? -ne 0 ]; then
echo "ERROR: Libtool step resulted in failure."
exit $?
fi

# Copy.
cp -v *.a "$OUTPUT"
}

compile_enet_armv7 () {
echo "Start compiling ARMv7"

export SDKROOT=$RELEASE_SDKROOT
cd "$ARMV7_STAGING"

# Pre-clean
Expand All @@ -141,22 +160,41 @@ compile_enet_armv7 () {

# Release Binaries
gcc -c Sources/enet.c -fembed-bitcode -target armv7-apple-ios
if [ $? -ne 0 ]; then
echo "ERROR: Compile step resulted in failure."
exit $?
fi

# Create static library
libtool -static enet.o -o libenet-release-armv7.a
if [ $? -ne 0 ]; then
echo "ERROR: Libtool step resulted in failure."
exit $?
fi

# Cleanup
rm -vf *.o

# Debug Binaries
gcc -DENET_DEBUG=1 -c Sources/enet.c -fembed-bitcode -target armv7-apple-ios
if [ $? -ne 0 ]; then
echo "ERROR: Compile step resulted in failure."
exit $?
fi

libtool -static enet.o -o libenet-debug-armv7.a

if [ $? -ne 0 ]; then
echo "ERROR: Libtool step resulted in failure."
exit $?
fi

# Copy.
cp -v *.a "$OUTPUT"
}

compile_enet_arm64 () {
echo "Start compiling ARM64"
export SDKROOT=$RELEASE_SDKROOT
cd "$ARM64_STAGING"

# Pre-clean
Expand All @@ -166,16 +204,34 @@ compile_enet_arm64 () {

# Release Binaries
gcc -c Sources/enet.c -fembed-bitcode -target arm64-apple-ios
if [ $? -ne 0 ]; then
echo "ERROR: Compile step resulted in failure."
exit $?
fi

# Create static library
libtool -static enet.o -o libenet-release-arm64.a

if [ $? -ne 0 ]; then
echo "ERROR: Libtool step resulted in failure."
exit $?
fi

# Cleanup
rm -v *.o

# Debug Binaries
gcc -DENET_DEBUG=1 -c Sources/enet.c -fembed-bitcode -target arm64-apple-ios
if [ $? -ne 0 ]; then
echo "ERROR: Compile step resulted in failure."
exit $?
fi

libtool -static enet.o -o libenet-debug-arm64.a

if [ $? -ne 0 ]; then
echo "ERROR: Libtool step resulted in failure."
exit $?
fi

# Copy.
cp -v *.a "$OUTPUT"
}
Expand Down Expand Up @@ -209,4 +265,4 @@ compress_and_exfil
FINAL_STAND=$?

echo "Build script has finished."
exit $FINAL_STAND
exit $FINAL_STAND
File renamed without changes.
3 changes: 3 additions & 0 deletions AutoBuild/linux-androidndk.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash
# Stubbed.
exit 0
File renamed without changes.

0 comments on commit d2dfc85

Please sign in to comment.