Browse Source

Split arm64 build as a separate step

Kevin Leung 3 years ago
parent
commit
47a02178ad
1 changed files with 34 additions and 16 deletions
  1. 34 16
      .github/workflows/main.yml

+ 34 - 16
.github/workflows/main.yml

@@ -232,16 +232,8 @@ jobs:
   linux-build:
     runs-on: ubuntu-20.04
     env:
-      PLATFORM: linux64
       OPAMYES: 1
-    steps:
-      - name: Set up QEMU
-        id: qemu
-        uses: docker/setup-qemu-action@v1
-        with:
-            image: tonistiigi/binfmt:latest
-            platforms: all
-            
+    steps:  
       - name: Install Earthly
         run: sudo /bin/sh -c 'wget https://github.com/earthly/earthly/releases/latest/download/earthly-linux-amd64 -O /usr/local/bin/earthly && chmod +x /usr/local/bin/earthly && /usr/local/bin/earthly bootstrap --with-autocomplete'
         
@@ -254,7 +246,13 @@ jobs:
         run: echo "ADD_REVISION=1" >> $GITHUB_ENV
 
       - name: Build
-        run: earthly +build-multiarch --ADD_REVISION=$ADD_REVISION
+        run: earthly --platform=linux/amd64 +build --ADD_REVISION=$ADD_REVISION
+      
+      - name: Upload artifact
+        uses: actions/[email protected]
+        with:
+          name: linuxBinaries
+          path: out/linux/amd64
       
       # https://stackoverflow.com/questions/58033366/how-to-get-current-branch-within-github-actions
       - name: Extract branch name
@@ -270,17 +268,37 @@ jobs:
         with:
           name: xmldoc
           path: extra/doc
-      
-      - name: Upload artifact
-        uses: actions/[email protected]
+          
+  linux-arm64-build:
+    runs-on: ubuntu-20.04
+    env:
+      OPAMYES: 1
+    steps:
+      - name: Set up QEMU
+        id: qemu
+        uses: docker/setup-qemu-action@v1
         with:
-          name: linuxBinaries
-          path: out/linux/amd64
+            image: tonistiigi/binfmt:latest
+            platforms: all
+            
+      - name: Install Earthly
+        run: sudo /bin/sh -c 'wget https://github.com/earthly/earthly/releases/latest/download/earthly-linux-amd64 -O /usr/local/bin/earthly && chmod +x /usr/local/bin/earthly && /usr/local/bin/earthly bootstrap --with-autocomplete'
+        
+      - uses: actions/checkout@main
+        with:
+          submodules: recursive
+      
+      - name: Set ADD_REVISION=1 for non-release
+        if: ${{ !startsWith(github.ref, 'refs/tags/') }}
+        run: echo "ADD_REVISION=1" >> $GITHUB_ENV
+
+      - name: Build
+        run: earthly --platform=linux/arm64 +build --ADD_REVISION=$ADD_REVISION
       
       - name: Upload artifact
         uses: actions/[email protected]
         with:
-          name: linuxBinaries-arm64
+          name: linuxArm64Binaries
           path: out/linux/arm64