Browse Source

add musl support

Jonathan Kelley 5 days ago
parent
commit
dbadba2e73
2 changed files with 24 additions and 8 deletions
  1. 19 7
      .github/install.sh
  2. 5 1
      .github/workflows/publish.yml

+ 19 - 7
.github/install.sh

@@ -52,14 +52,26 @@ if [[ $# -gt 1 ]]; then
 fi
 
 if [ "$OS" = "Windows_NT" ]; then
-	target="x86_64-pc-windows-msvc"
+    target="x86_64-pc-windows-msvc"
 else
-	case $(uname -sm) in
-	"Darwin x86_64") target="x86_64-apple-darwin" ;;
-	"Darwin arm64") target="aarch64-apple-darwin" ;;
-	"Linux aarch64") target="aarch64-unknown-linux-gnu" ;;
-	*) target="x86_64-unknown-linux-gnu" ;;
-	esac
+    case $(uname -sm) in
+    "Darwin x86_64") target="x86_64-apple-darwin" ;;
+    "Darwin arm64") target="aarch64-apple-darwin" ;;
+    "Linux aarch64")
+        if [ -f /etc/alpine-release ]; then
+            target="aarch64-unknown-linux-musl"
+        else
+            target="aarch64-unknown-linux-gnu"
+        fi
+        ;;
+    *)
+        if [ -f /etc/alpine-release ]; then
+            target="x86_64-unknown-linux-musl"
+        else
+            target="x86_64-unknown-linux-gnu"
+        fi
+        ;;
+    esac
 fi
 
 GITHUB=${GITHUB-"https://github.com"}

+ 5 - 1
.github/workflows/publish.yml

@@ -61,6 +61,10 @@ jobs:
             os: ubuntu-24.04
           - target: aarch64-unknown-linux-gnu
             os: ubuntu-24.04-arm
+          - target: x86_64-unknown-linux-musl
+            os: ubuntu-24.04
+          - target: aarch64-unknown-linux-musl
+            os: ubuntu-24.04-arm
     steps:
       - name: Checkout
         uses: actions/checkout@v4
@@ -80,7 +84,7 @@ jobs:
       - uses: awalsh128/cache-apt-pkgs-action@latest
         if: ${{ matrix.platform.os == 'ubuntu-24.04' || matrix.platform.os == 'ubuntu-24.04-arm' }}
         with:
-          packages: libwebkit2gtk-4.1-dev libgtk-3-dev libayatana-appindicator3-dev libxdo-dev libglib2.0-dev
+          packages: libwebkit2gtk-4.1-dev libgtk-3-dev libayatana-appindicator3-dev libxdo-dev libglib2.0-dev musl-tools
           version: 1.0
 
       - name: Install stable