From 311a1435921ad269d2398c98143501ea1a32b769 Mon Sep 17 00:00:00 2001
From: Silvano Cerza <silvanocerza@gmail.com>
Date: Tue, 28 Jul 2020 11:21:36 +0200
Subject: [PATCH 1/5] [skip changelog] Build is now uploaded as artifact when
 running tests workflow

---
 .github/workflows/test.yaml | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)

diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml
index 71aada3a107..bf44ab6a43c 100644
--- a/.github/workflows/test.yaml
+++ b/.github/workflows/test.yaml
@@ -117,3 +117,28 @@ jobs:
           token: ${{secrets.CODECOV_TOKEN}}
           file: ./coverage_integ.txt
           flags: integ
+
+  create-pull-request-artifacts:
+    runs-on: ubuntu-latest
+    needs: test-matrix
+
+    container:
+      image: arduino/arduino-cli:builder-1
+      volumes:
+        # cache go dependencies across pipeline's steps
+        - ${{ github.workspace }}/go:/go
+
+    steps:
+      - name: checkout
+        uses: actions/checkout@v1
+
+      - name: build
+        env:
+          PACKAGE_NAME_PREFIX: ${{ github.workflow }}
+        run: goreleaser --snapshot
+
+      - name: Upload artifacts
+        uses: actions/upload-artifact@v1
+        with:
+          name: dist
+          path: dist

From 302b8422a434b20c8b5d8d757f402cadb5599f09 Mon Sep 17 00:00:00 2001
From: Silvano Cerza <silvanocerza@gmail.com>
Date: Fri, 31 Jul 2020 11:12:49 +0200
Subject: [PATCH 2/5] [skip changelog] Added more information to workflow
 artifacts

---
 .github/workflows/test.yaml | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)

diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml
index bf44ab6a43c..e3030146ae2 100644
--- a/.github/workflows/test.yaml
+++ b/.github/workflows/test.yaml
@@ -133,12 +133,20 @@ jobs:
         uses: actions/checkout@v1
 
       - name: build
-        env:
-          PACKAGE_NAME_PREFIX: ${{ github.workflow }}
-        run: goreleaser --snapshot
+        shell: bash
+        run: |
+          PACKAGE_NAME_PREFIX="${{ github.workflow }}"
+          if [ "${{ github.event_name }}" = "pull_request" ]; then
+            PACKAGE_NAME_PREFIX="$PACKAGE_NAME_PREFIX-${{ github.event.number }}"
+          fi
+          PACKAGE_NAME_PREFIX="$PACKAGE_NAME_PREFIX-${{ github.sha }}"
+          export PACKAGE_NAME_PREFIX
+          goreleaser --snapshot
 
       - name: Upload artifacts
         uses: actions/upload-artifact@v1
         with:
           name: dist
-          path: dist
+          path: |
+            dist/.*\.(tar\.gz|zip)
+            dist/.*checksums\.txt

From 93053d31e69e5c512a5654d5cbc4b194c0edc15e Mon Sep 17 00:00:00 2001
From: Silvano Cerza <silvanocerza@gmail.com>
Date: Fri, 31 Jul 2020 11:53:59 +0200
Subject: [PATCH 3/5] [skip changelog] Fix artifacts paths

---
 .github/workflows/test.yaml | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml
index e3030146ae2..735a66f3a07 100644
--- a/.github/workflows/test.yaml
+++ b/.github/workflows/test.yaml
@@ -148,5 +148,6 @@ jobs:
         with:
           name: dist
           path: |
-            dist/.*\.(tar\.gz|zip)
-            dist/.*checksums\.txt
+            dist/*.tar.gz
+            dist/*.zip
+            dist/*checksums.txt

From 03412bc6a9c8669002417b00e9550b0cf2dd4fa9 Mon Sep 17 00:00:00 2001
From: Silvano Cerza <silvanocerza@gmail.com>
Date: Fri, 31 Jul 2020 14:29:05 +0200
Subject: [PATCH 4/5] [skip changelog] Update upload-artifact action version in
 test workflow

---
 .github/workflows/test.yaml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml
index 735a66f3a07..60bf71529f2 100644
--- a/.github/workflows/test.yaml
+++ b/.github/workflows/test.yaml
@@ -144,7 +144,7 @@ jobs:
           goreleaser --snapshot
 
       - name: Upload artifacts
-        uses: actions/upload-artifact@v1
+        uses: actions/upload-artifact@v2
         with:
           name: dist
           path: |

From 3dad19667b396adbf01e346fafe05a7452622210 Mon Sep 17 00:00:00 2001
From: Silvano Cerza <silvanocerza@gmail.com>
Date: Tue, 4 Aug 2020 11:59:09 +0200
Subject: [PATCH 5/5] [skip changelog] Test artifacts are now uploaded
 separately

---
 .github/workflows/test.yaml | 66 +++++++++++++++++++++++++++++++++----
 1 file changed, 59 insertions(+), 7 deletions(-)

diff --git a/.github/workflows/test.yaml b/.github/workflows/test.yaml
index 60bf71529f2..f25443c9c35 100644
--- a/.github/workflows/test.yaml
+++ b/.github/workflows/test.yaml
@@ -118,7 +118,7 @@ jobs:
           file: ./coverage_integ.txt
           flags: integ
 
-  create-pull-request-artifacts:
+  create-test-artifacts:
     runs-on: ubuntu-latest
     needs: test-matrix
 
@@ -143,11 +143,63 @@ jobs:
           export PACKAGE_NAME_PREFIX
           goreleaser --snapshot
 
-      - name: Upload artifacts
+      # Uploads all architectures as separate artifacts
+      - name: Upload Linux 32 bit artifact
         uses: actions/upload-artifact@v2
         with:
-          name: dist
-          path: |
-            dist/*.tar.gz
-            dist/*.zip
-            dist/*checksums.txt
+          name: Linux_32bit
+          path: dist/*Linux_32bit.tar.gz
+
+      - name: Upload Linux 64 bit artifact
+        uses: actions/upload-artifact@v2
+        with:
+          name: Linux_64bit
+          path: dist/*Linux_64bit.tar.gz
+
+      - name: Upload Windows 32 bit artifact
+        uses: actions/upload-artifact@v2
+        with:
+          name: Windows_32bit
+          path: dist/*Windows_32bit.zip
+
+      - name: Upload Windows 64 bit artifact
+        uses: actions/upload-artifact@v2
+        with:
+          name: Windows_64bit
+          path: dist/*Windows_64bit.zip
+
+      - name: Upload Linux ARMv6 artifact
+        uses: actions/upload-artifact@v2
+        with:
+          name: Linux_ARMv6
+          path: dist/*Linux_ARMv6.tar.gz
+
+      - name: Upload Linux ARMv7 artifact
+        uses: actions/upload-artifact@v2
+        with:
+          name: Linux_ARMv7
+          path: dist/*Linux_ARMv7.tar.gz
+
+      - name: Upload Linux ARM64 artifact
+        uses: actions/upload-artifact@v2
+        with:
+          name: Linux_ARM64
+          path: dist/*Linux_ARM64.tar.gz
+
+      - name: Upload Linux ARM64 bit artifact
+        uses: actions/upload-artifact@v2
+        with:
+          name: Linux_ARM64
+          path: dist/*Linux_ARM64.tar.gz
+
+      - name: Upload MacOS 64 bit artifact
+        uses: actions/upload-artifact@v2
+        with:
+          name: macOS_64bit
+          path: dist/*macOS_64bit.tar.gz
+
+      - name: Upload checksums
+        uses: actions/upload-artifact@v2
+        with:
+          name: checksums
+          path: dist/*checksums.txt