Repository: jacobdeichert/mask (language: rust)

Issue:
Support for musl
Add support for `musl` linked executable for distributions that use it (ie. Alpine). I would think this would be done by adding another asset on release that would be named 
`mask-vX.XX.X-x86_64-unknown-linux-musl.zip` or something like it.


I have limited knowledge of rust, but seems like this could be achieved by adding another release job in `.github/workflows/release.yml` that could make use of an Alpine to build and target. I believe `cargo` needs use the target `x86_64-unknown-linux-musl`.


Discussion / hints:
@jacobdeichert If you don't mind I would like to attempt the suggestion above.

I believe I should be able to test this out on a fork of this repo without affecting this one.

I will say this will be my first foray into github actions, so any advice would be welcome.
@8Mobius8 that would be great!

Yes, modifying [release.yml](https://github.com/jacobdeichert/mask/blob/master/.github/workflows/release.yml) is all you need to do I think. 

I'd copy/paste the `release-linux` block, name the new one `release-linux-musl` and then figure out how to tell cargo to target musl. My memory is a bit fuzzy on compiling for musl, but I think you can probably still use `runs-on: ubuntu-latest` and it should let you cross-compile to musl. Or, GitHub might support alpine runners, so up to you if that's easier to get cargo to target musl with.

Fix patch:
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
index 20081fe..da554e7 100644
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -28,6 +28,32 @@ jobs:
           GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
         with:
           assets: ./*.zip
+  
+  release-linux-musl:
+    runs-on: ubuntu-latest
+    steps:
+      - uses: actions/checkout@v2
+      - name: Fetch dependencies
+        run: cargo fetch
+      - name: Build in release mode
+        run: |
+          rustup target add x86_64-unknown-linux-musl
+          cargo build --release --frozen --target x86_64-unknown-linux-musl
+      - name: Add the version tag to the binary name
+        run: |
+          VERSION_TAG=$(jq --raw-output '.release.tag_name' "$GITHUB_EVENT_PATH")
+          TARGET=x86_64-unknown-linux-musl
+          NAME=mask-$VERSION_TAG-$TARGET
+          mkdir $NAME
+          mv ./target/$TARGET/release/mask ./$NAME/mask
+          chmod +x ./$NAME/mask
+          zip -r $NAME.zip $NAME
+      - name: Attach the binary to the release
+        uses: ./.github/actions/attach-release-assets
+        env:
+          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+        with:
+          assets: ./*.zip
 
   release-macos-aarch64:
     runs-on: macos-latest


Test patch: