Browse Source

Update Autobuild workflow.

Matt Coburn 4 years ago
parent
commit
d2dfc8529f

+ 35 - 29
.github/workflows/Build-Master.yaml

@@ -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 
@@ -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
@@ -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
@@ -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 
@@ -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 
@@ -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

+ 67 - 11
AutoBuild/ios-autobuild.command → AutoBuild/apple-ios.command

@@ -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"
@@ -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
@@ -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
@@ -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
@@ -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"
 }
@@ -209,4 +265,4 @@ compress_and_exfil
 FINAL_STAND=$?
 
 echo "Build script has finished."
-exit $FINAL_STAND
+exit $FINAL_STAND

+ 0 - 0
AutoBuild/githubAutoBuild.command → AutoBuild/apple-mac.command


+ 3 - 0
AutoBuild/linux-androidndk.sh

@@ -0,0 +1,3 @@
+#!/bin/bash
+# Stubbed.
+exit 0

+ 0 - 0
AutoBuild/githubAutoBuild.cmd → AutoBuild/ms-windows.cmd