Browse Source

Update workflow

Matt Coburn 5 years ago
parent
commit
2664b0adad
1 changed files with 56 additions and 16 deletions
  1. 56 16
      .github/workflows/Build-Master.yaml

+ 56 - 16
.github/workflows/Build-Master.yaml

@@ -8,32 +8,27 @@ on:
 jobs:
     create_release:
         name: Prepare a new release
+        # Really?
+        runs-on: ubuntu-latest
         outputs:
-          build_number: ${{ steps.buildnumber.outputs.build_number }}
-          create_release_url: ${{ steps.create_release.outputs.upload_url }}
+          create_release_url: ${{ steps.create_release.outputs.upload_url }}         
           
         steps:
-        - name: Generate a new build number.
-          id: buildnumber
-          uses: einaregilsson/build-number@v2 
-          with:
-            token: ${{secrets.github_token}}
-
         - name: Create release on repository
           id: create_release
           uses: actions/create-release@v1
           env:
             GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
           with:
-            tag_name: build-number-${{ steps.buildnumber.outputs.build_number }}
-            release_name: ENet Native Libraries (Autobuild ${{ steps.buildnumber.outputs.build_number }})
-            body: This is an automated build of the ENet native libraries, and is up to date with the latest commits. The attached per-platform archives contain ENet built in both production and debug environments.
+            tag_name: "autobuild-${{ github.run_number }}"
+            release_name: "ENet Native Libraries (Autobuild ${{ github.run_number }})"
+            body: "This is an automated build of the ENet native libraries, and is up to date with the latest commits. The attached per-platform archives contain ENet built in both production and debug environments."
             draft: false
             prerelease: false
 
 # START LINUX BUILD JOB
     build_linux64:
-        name: Prepare and build a Linux64 library.
+        name: Build for Linux x64
         needs: create_release
         runs-on: ubuntu-latest
         steps:      
@@ -103,7 +98,47 @@ jobs:
         - name: Grab the latest copy of the repository.
           uses: actions/checkout@v2
 
-    # Stubbed!
+        - name: Build Debug configuration Enet
+          run: |            
+            mkdir ${{ runner.workspace }}\DebugOut
+            cd $GITHUB_WORKSPACE
+            dotnet clean
+            dotnet build
+            copy "${{ runner.workspace }}\Unity\Plugins\x86_64\enet.dll" "${{ runner.workspace }}\DebugOut"
+            cd "${{ runner.workspace }}\DebugOut"
+            Start-Process -NoNewWindow -FilePath "C:\Program Files\7-Zip\7z.exe" -ArgumentList "a Debug.zip enet.dll"
+            
+        - name: Build Release configuration Enet
+          run: |
+            mkdir ${{ runner.workspace }}\ReleaseOut
+            cd $GITHUB_WORKSPACE
+            dotnet clean
+            dotnet build -c Release
+            copy "${{ runner.workspace }}\Unity\Plugins\x86_64\enet.dll" "${{ runner.workspace }}\ReleaseOut"
+            cd "${{ runner.workspace }}\ReleaseOut"
+            Start-Process -NoNewWindow -FilePath "C:\Program Files\7-Zip\7z.exe" -ArgumentList "a Release.zip enet.dll"
+            
+        - 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 }}/ReleaseOut/Release.zip
+            asset_name: libenet-release-win64.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 }}/ReleaseTemp/Debug.zip
+            asset_name: libenet-debug-win64.zip
+            asset_content_type: application/zip
 # END WINDOWS BUILD JOB
 
 # START APPLE MACOS BUILD JOB
@@ -111,7 +146,12 @@ jobs:
         name: Build for MacOS
         needs: create_release
         runs-on: macos-latest
-        steps:
+        steps:         
+        - name: Setup Xcode (with latest Apple SDK)
+          uses: maxim-lobanov/[email protected]
+          with:
+            xcode-version: 11.6
+        
         - name: Grab the latest copy of the repository.
           uses: actions/checkout@v2
 
@@ -128,7 +168,7 @@ jobs:
         - name: Setup Xcode (with latest Apple SDK)
           uses: maxim-lobanov/[email protected]
           with:
-            xcode-version: latest
+            xcode-version: 11.6
 
         - name: Grab the latest copy of the repository.
           uses: actions/checkout@v2
@@ -143,7 +183,7 @@ jobs:
             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 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