From 54fe5b7fc223677f4525886c58b1ae9767da8231 Mon Sep 17 00:00:00 2001
From: Spencer Sharkey <spencer@up.lol>
Date: Thu, 8 Sep 2022 22:29:08 -0700
Subject: [PATCH 1/5] use ubuntu 18.04 container for release

---
 .github/workflows/release.yaml | 18 +++++++++++++-----
 1 file changed, 13 insertions(+), 5 deletions(-)

diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml
index 303a10615bb..785eb6fc31c 100644
--- a/.github/workflows/release.yaml
+++ b/.github/workflows/release.yaml
@@ -34,6 +34,7 @@ jobs:
           - os: ubuntu-20.04
             target: x86_64-unknown-linux-gnu
             code-target: linux-x64
+            container: ubuntu:18.04
           - os: ubuntu-20.04
             target: aarch64-unknown-linux-gnu
             code-target: linux-arm64
@@ -49,6 +50,7 @@ jobs:
 
     name: dist (${{ matrix.target }})
     runs-on: ${{ matrix.os }}
+    container: ${{ matrix.container }}
 
     env:
       RA_TARGET: ${{ matrix.target }}
@@ -59,11 +61,17 @@ jobs:
         with:
           fetch-depth: ${{ env.FETCH_DEPTH }}
 
+      - name: Install toolchain dependencies
+        if: matrix.container == 'ubuntu:18.04'
+        run: apt-get update && apt-get install -y build-essential curl
+
       - name: Install Rust toolchain
-        run: |
-          rustup update --no-self-update stable
-          rustup target add ${{ matrix.target }}
-          rustup component add rust-src
+        uses: actions-rs/toolchain@v1
+        with:
+          toolchain: stable
+          target: ${{ matrix.target }}
+          components: rust-src
+          override: true
 
       - name: Install Node.js
         uses: actions/setup-node@v1
@@ -71,7 +79,7 @@ jobs:
           node-version: 16.x
 
       - name: Update apt repositories
-        if: matrix.target == 'aarch64-unknown-linux-gnu' || matrix.target == 'arm-unknown-linux-gnueabihf'
+        if: "!matrix.container && (matrix.target == 'aarch64-unknown-linux-gnu' || matrix.target == 'arm-unknown-linux-gnueabihf')"
         run: sudo apt-get update
 
       - name: Install AArch64 target toolchain

From b843b8801d5cfe0a17e6d7fcc43f4fd98c613596 Mon Sep 17 00:00:00 2001
From: Spencer <spencer@sf-n.com>
Date: Sat, 10 Sep 2022 18:10:56 -0700
Subject: [PATCH 2/5] revert conditional logic for apt update step

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

diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml
index 785eb6fc31c..312ea066ff3 100644
--- a/.github/workflows/release.yaml
+++ b/.github/workflows/release.yaml
@@ -79,7 +79,7 @@ jobs:
           node-version: 16.x
 
       - name: Update apt repositories
-        if: "!matrix.container && (matrix.target == 'aarch64-unknown-linux-gnu' || matrix.target == 'arm-unknown-linux-gnueabihf')"
+        if: matrix.target == 'aarch64-unknown-linux-gnu' || matrix.target == 'arm-unknown-linux-gnueabihf'
         run: sudo apt-get update
 
       - name: Install AArch64 target toolchain

From dd65588c51947111af1b62011023d7a16e9e01ca Mon Sep 17 00:00:00 2001
From: Spencer <spencer@sf-n.com>
Date: Sat, 10 Sep 2022 23:25:30 -0700
Subject: [PATCH 3/5] install rustup directly

---
 .github/workflows/release.yaml | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml
index 312ea066ff3..216a3028460 100644
--- a/.github/workflows/release.yaml
+++ b/.github/workflows/release.yaml
@@ -63,15 +63,16 @@ jobs:
 
       - name: Install toolchain dependencies
         if: matrix.container == 'ubuntu:18.04'
-        run: apt-get update && apt-get install -y build-essential curl
+        shell: bash
+        run: |
+          apt-get update && apt-get install -y build-essential curl
+          curl --proto '=https' --tlsv1.2 "https://sh.rustup.rs" | sh -s -- --default-toolchain none -y
 
       - name: Install Rust toolchain
-        uses: actions-rs/toolchain@v1
-        with:
-          toolchain: stable
-          target: ${{ matrix.target }}
-          components: rust-src
-          override: true
+        run: |
+          rustup update --no-self-update stable
+          rustup target add ${{ matrix.target }}
+          rustup component add rust-src
 
       - name: Install Node.js
         uses: actions/setup-node@v1

From ae57150d0d2e3171ee1954f2739956ee1621737f Mon Sep 17 00:00:00 2001
From: Spencer <spencer@sf-n.com>
Date: Sat, 10 Sep 2022 23:29:15 -0700
Subject: [PATCH 4/5] add rustup bin to path

---
 .github/workflows/release.yaml | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml
index 216a3028460..e71b692e7f8 100644
--- a/.github/workflows/release.yaml
+++ b/.github/workflows/release.yaml
@@ -67,6 +67,7 @@ jobs:
         run: |
           apt-get update && apt-get install -y build-essential curl
           curl --proto '=https' --tlsv1.2 "https://sh.rustup.rs" | sh -s -- --default-toolchain none -y
+          echo "${CARGO_HOME:-$HOME/.cargo}/bin" >> $GITHUB_PATH
 
       - name: Install Rust toolchain
         run: |

From 73d759955f7f0e9a104346ac89174e15467c67bb Mon Sep 17 00:00:00 2001
From: Spencer <spencer@sf-n.com>
Date: Sat, 10 Sep 2022 23:43:33 -0700
Subject: [PATCH 5/5] use rustup minimal profile and add curl retries

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

diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml
index e71b692e7f8..f4d472e3d5c 100644
--- a/.github/workflows/release.yaml
+++ b/.github/workflows/release.yaml
@@ -66,7 +66,7 @@ jobs:
         shell: bash
         run: |
           apt-get update && apt-get install -y build-essential curl
-          curl --proto '=https' --tlsv1.2 "https://sh.rustup.rs" | sh -s -- --default-toolchain none -y
+          curl --proto '=https' --tlsv1.2 --retry 10 --retry-connrefused -fsSL "https://sh.rustup.rs" | sh -s -- --profile minimal --default-toolchain none -y
           echo "${CARGO_HOME:-$HOME/.cargo}/bin" >> $GITHUB_PATH
 
       - name: Install Rust toolchain