Browse Source

Test new MacOS autobuilder script

Matt Coburn 5 years ago
parent
commit
f890534da7
2 changed files with 65 additions and 4 deletions
  1. 29 4
      .github/workflows/Build-Master.yaml
  2. 36 0
      AutoBuild/githubAutoBuild.command

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

@@ -94,7 +94,7 @@ jobs:
         needs: create_release
         needs: create_release
         runs-on: macos-latest
         runs-on: macos-latest
         steps:         
         steps:         
-        - name: Setup Xcode (with latest Apple SDK)
+        - name: Setup XCode
           uses: maxim-lobanov/[email protected]
           uses: maxim-lobanov/[email protected]
           with:
           with:
             xcode-version: 11.6
             xcode-version: 11.6
@@ -102,7 +102,32 @@ jobs:
         - name: Grab the latest copy of the repository.
         - name: Grab the latest copy of the repository.
           uses: actions/checkout@v2
           uses: actions/checkout@v2
 
 
-    # Stubbed!
+        - name: Run automated build script.
+          run: |
+            cd ${{ runner.workspace }}/ENet-CSharp && bash AutoBuild/githubAutoBuild.command
+            
+        - name: Upload release library
+          id: upload-release-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 }}/ENet-CSharp/ReleaseOut/Release.zip
+            asset_name: libenet-release-MacOS.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 }}/ENet-CSharp/DebugOut/Debug.zip
+            asset_name: libenet-debug-MacOS.zip
+            asset_content_type: application/zip
+
 # END APPLE MACOS BUILD JOB
 # END APPLE MACOS BUILD JOB
 
 
     build_windows_64:
     build_windows_64:
@@ -135,7 +160,7 @@ jobs:
             GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
             GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
           with:
           with:
             upload_url: ${{ needs.create_release.outputs.create_release_url }} 
             upload_url: ${{ needs.create_release.outputs.create_release_url }} 
-            asset_path: ${{ runner.workspace }}\DebugOut\Debug.zip
+            asset_path: ${{ runner.workspace }}/DebugOut/Debug.zip
             asset_name: libenet-debug-win64.zip
             asset_name: libenet-debug-win64.zip
             asset_content_type: application/zip
             asset_content_type: application/zip
 
 
@@ -146,7 +171,7 @@ jobs:
         runs-on: macos-latest
         runs-on: macos-latest
         steps:
         steps:
       
       
-        - name: Setup Xcode (with latest Apple SDK)
+        - name: Setup XCode
           uses: maxim-lobanov/[email protected]
           uses: maxim-lobanov/[email protected]
           with:
           with:
             xcode-version: 11.6
             xcode-version: 11.6

+ 36 - 0
AutoBuild/githubAutoBuild.command

@@ -0,0 +1,36 @@
+#!/bin/bash
+# MacOS flavoured version of Coburn's autobuild script, since YAML
+# can go suck it.
+
+# Cache variables.
+WORKDIR=$(pwd)
+
+# Make work directories.
+mkdir -p $WORKDIR/ReleaseOut
+mkdir -p $WORKDIR/DebugOut
+
+echo Preparing build environment...
+dotnet clean
+
+echo Building Debug Library...
+dotnet build
+
+echo Stashing...
+cp -v Unity/Plugins/x86_64/* $WORKDIR/DebugOut
+
+echo Cleaning up...
+dotnet clean
+rm -vf Unity/Plugins/x86_64/*
+
+echo Building Release Library...
+dotnet build -c Release
+
+echo Stashing
+cp -v Unity/Plugins/x86_64/* $WORKDIR/ReleaseOut
+
+echo Compressing...
+cd $WORKDIR/ReleaseOut && zip -9 Release.zip libenet.dylib
+cd $WORKDIR/DebugOut && zip -9 Debug.zip libenet.dylib
+
+echo End of Build Script.
+exit $?