Repository: axodotdev/cargo-dist
Pull request #491 (2023-10-18 18:52:43)

feat: build a musl binary


Patch:
diff --git a/Cargo.toml b/Cargo.toml
index 4760f707..f2d3f2d1 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -23,7 +23,7 @@ tap = "axodotdev/homebrew-tap"
 # Publish jobs to run in CI
 publish-jobs = ["homebrew"]
 # Target platforms to build apps for (Rust target-triple syntax)
-targets = ["x86_64-unknown-linux-gnu", "aarch64-apple-darwin", "x86_64-apple-darwin", "x86_64-pc-windows-msvc"]
+targets = ["x86_64-unknown-linux-gnu", "aarch64-apple-darwin", "x86_64-apple-darwin", "x86_64-unknown-linux-musl", "x86_64-pc-windows-msvc"]
 # Publish jobs to run in CI
 pr-run-mode = "plan"
 


Test patch:
diff --git a/cargo-dist/tests/snapshots/manifest.snap b/cargo-dist/tests/snapshots/manifest.snap
index cf928383..b6e82f99 100644
--- a/cargo-dist/tests/snapshots/manifest.snap
+++ b/cargo-dist/tests/snapshots/manifest.snap
@@ -28,7 +28,9 @@ stdout:
         "cargo-dist-x86_64-pc-windows-msvc.zip",
         "cargo-dist-x86_64-pc-windows-msvc.zip.sha256",
         "cargo-dist-x86_64-unknown-linux-gnu.tar.xz",
-        "cargo-dist-x86_64-unknown-linux-gnu.tar.xz.sha256"
+        "cargo-dist-x86_64-unknown-linux-gnu.tar.xz.sha256",
+        "cargo-dist-x86_64-unknown-linux-musl.tar.xz",
+        "cargo-dist-x86_64-unknown-linux-musl.tar.xz.sha256"
       ]
     }
   ],
@@ -90,7 +92,8 @@ stdout:
       "target_triples": [
         "aarch64-apple-darwin",
         "x86_64-apple-darwin",
-        "x86_64-unknown-linux-gnu"
+        "x86_64-unknown-linux-gnu",
+        "x86_64-unknown-linux-musl"
       ],
       "install_hint": "curl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/cargo-dist/releases/download/v1.0.0-FAKEVERSION/cargo-dist-installer.sh | sh",
       "description": "Install prebuilt binaries via shell script"
@@ -221,12 +224,55 @@ stdout:
         "x86_64-unknown-linux-gnu"
       ]
     },
+    "cargo-dist-x86_64-unknown-linux-musl.tar.xz": {
+      "name": "cargo-dist-x86_64-unknown-linux-musl.tar.xz",
+      "kind": "executable-zip",
+      "target_triples": [
+        "x86_64-unknown-linux-musl"
+      ],
+      "assets": [
+        {
+          "name": "CHANGELOG.md",
+          "path": "CHANGELOG.md",
+          "kind": "changelog"
+        },
+        {
+          "name": "LICENSE-APACHE",
+          "path": "LICENSE-APACHE",
+          "kind": "license"
+        },
+        {
+          "name": "LICENSE-MIT",
+          "path": "LICENSE-MIT",
+          "kind": "license"
+        },
+        {
+          "name": "README.md",
+          "path": "README.md",
+          "kind": "readme"
+        },
+        {
+          "name": "cargo-dist",
+          "path": "cargo-dist",
+          "kind": "executable"
+        }
+      ],
+      "checksum": "cargo-dist-x86_64-unknown-linux-musl.tar.xz.sha256"
+    },
+    "cargo-dist-x86_64-unknown-linux-musl.tar.xz.sha256": {
+      "name": "cargo-dist-x86_64-unknown-linux-musl.tar.xz.sha256",
+      "kind": "checksum",
+      "target_triples": [
+        "x86_64-unknown-linux-musl"
+      ]
+    },
     "cargo-dist.rb": {
       "name": "cargo-dist.rb",
       "kind": "installer",
       "target_triples": [
         "aarch64-apple-darwin",
-        "x86_64-apple-darwin"
+        "x86_64-apple-darwin",
+        "x86_64-unknown-linux-musl"
       ],
       "install_hint": "brew install axodotdev/homebrew-tap/cargo-dist",
       "description": "Install prebuilt binaries via Homebrew"
@@ -268,6 +314,15 @@ stdout:
             "runner": "ubuntu-20.04",
             "install_dist": "curl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/cargo-dist/releases/download/v1.0.0-FAKEVERSION/cargo-dist-installer.sh | sh",
             "dist_args": "--artifacts=local --target=x86_64-unknown-linux-gnu"
+          },
+          {
+            "targets": [
+              "x86_64-unknown-linux-musl"
+            ],
+            "runner": "ubuntu-20.04",
+            "install_dist": "curl --proto '=https' --tlsv1.2 -LsSf https://github.com/axodotdev/cargo-dist/releases/download/v1.0.0-FAKEVERSION/cargo-dist-installer.sh | sh",
+            "dist_args": "--artifacts=local --target=x86_64-unknown-linux-musl",
+            "packages_install": "sudo apt-get install musl-tools"
           }
         ]
       },