Browse Source

Add Windows ARM64 workflow.

Miku AuahDark 2 years ago
parent
commit
0f82f6c7b3
1 changed files with 64 additions and 15 deletions
  1. 64 15
      .github/workflows/main.yml

+ 64 - 15
.github/workflows/main.yml

@@ -40,18 +40,54 @@ jobs:
     shell: cmd
     shell: cmd
     strategy:
     strategy:
       matrix:
       matrix:
-        platform: [Win32, x64]
+        platform: [Win32, x64, ARM64]
         install: [compat, modern]
         install: [compat, modern]
-        include:
-        - platform: Win32
-          arch: x86
-        - platform: x64
-          arch: x64
-          upload_jitmodules: true
-        - install: compat
-          compatdef: -DLOVE_INSTALL_UCRT=ON
-          compatname: -compat
+        exclude:
+        - platform: ARM64
+          install: compat
+    continue-on-error: ${{ matrix.platform == 'ARM64' }}
     steps:
     steps:
+    - name: Define Variables
+      id: vars
+      run: |
+        rem Compat/Modern switch
+        if "${{ matrix.install }}" == "compat" (
+          echo moredef=-DLOVE_INSTALL_UCRT=ON >> "%GITHUB_OUTPUT%"
+          echo compatname=-compat >> "%GITHUB_OUTPUT%"
+        ) else (
+          echo moredef= >> "%GITHUB_OUTPUT%"
+          echo compatname= >> "%GITHUB_OUTPUT%"
+        )
+        
+        rem JIT Modules
+        if "${{ matrix.platform }}-${{ matrix.install }}" == "x64-modern" (
+          echo jitmodules=1 >> "%GITHUB_OUTPUT%"
+        ) else (
+          echo jitmodules=0 >> "%GITHUB_OUTPUT%"
+        )
+        
+        rem Architecture-Specific Switch
+        goto ${{ matrix.platform }}
+        exit /b 1
+        
+        :Win32
+        echo arch=x86 >> "%GITHUB_OUTPUT%"
+        echo angle=0 >> "%GITHUB_OUTPUT%"
+        echo nofiles=warn >> "%GITHUB_OUTPUT%"
+        exit /b 0
+        
+        :x64
+        echo arch=x64 >> "%GITHUB_OUTPUT%"
+        echo angle=0 >> "%GITHUB_OUTPUT%"
+        echo nofiles=warn >> "%GITHUB_OUTPUT%"
+        exit /b 0
+        
+        :ARM64
+        echo arch=arm64 >> "%GITHUB_OUTPUT%"
+        echo angle=1 >> "%GITHUB_OUTPUT%"
+        echo nofiles=ignore >> "%GITHUB_OUTPUT%"
+        echo moredef=-DLOVE_EXTRA_DLLS=%CD%\angle\libEGL.dll;%CD%\angle\libGLESv2.dll
+        exit /b 0
     - name: Clone Megasource
     - name: Clone Megasource
       uses: actions/checkout@v2
       uses: actions/checkout@v2
       with:
       with:
@@ -68,21 +104,34 @@ jobs:
         vulkan-query-version: 1.3.204.0
         vulkan-query-version: 1.3.204.0
         vulkan-components: Vulkan-Headers, Vulkan-Loader
         vulkan-components: Vulkan-Headers, Vulkan-Loader
         vulkan-use-cache: true
         vulkan-use-cache: true
+    - name: Download ANGLE
+      uses: robinraju/[email protected]
+      if: steps.vars.outputs.angle == '1'
+      with:
+        repository: MikuAuahDark/angle-winbuild
+        tag: cr_5249
+        fileName: angle-win-${{ steps.vars.outputs.arch }}.zip
+        tarBall: false
+        zipBall: false
+        out-file-path: angle
+    - name: Extract ANGLE
+      if: steps.vars.outputs.angle == '1'
+      working-directory: angle
+      run: 7z x angle-win-${{ steps.vars.outputs.arch }}.zip
     - name: Configure
     - name: Configure
-      env:
-        PLATFORM: ${{ matrix.platform }}
-      run: cmake -Bbuild -Hmegasource -T v142 -A %PLATFORM% ${{ matrix.compatdef }} -DCMAKE_INSTALL_PREFIX=%CD%\install
+      run: cmake -Bbuild -Hmegasource -T v142 -A ${{ matrix.platform }} -DCMAKE_INSTALL_PREFIX=%CD%\install ${{ steps.vars.outputs.moredef }}
     - name: Install
     - name: Install
       run: cmake --build build --target PACKAGE --config Release -j2
       run: cmake --build build --target PACKAGE --config Release -j2
     - name: Artifact
     - name: Artifact
       uses: actions/upload-artifact@v2
       uses: actions/upload-artifact@v2
       with:
       with:
-        name: love-windows-${{ matrix.arch }}${{ matrix.compatname }}
+        name: love-windows-${{ steps.vars.outputs.arch }}${{ steps.vars.outputs.compatname }}
         path: |
         path: |
           build/*.zip
           build/*.zip
           build/*.exe
           build/*.exe
+        if-no-files-found: ${{ steps.vars.outputs.nofiles }}
     - name: Artifact JIT Modules
     - name: Artifact JIT Modules
-      if: matrix.upload_jitmodules
+      if: steps.vars.outputs.jitmodules == '1'
       uses: actions/upload-artifact@v2
       uses: actions/upload-artifact@v2
       with:
       with:
         name: love-windows-jitmodules
         name: love-windows-jitmodules