Skip to content
This repository has been archived by the owner on Dec 17, 2022. It is now read-only.

feat: musl libc support #10

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 22 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ jobs:

outputs:
LINUX_ZIP_CHECKSUM: ${{steps.linux_pre_release.outputs.ZIP_CHECKSUM}}
LINUX_MUSL_ZIP_CHECKSUM: ${{steps.linux_musl_pre_release.outputs.ZIP_CHECKSUM}}
MAC_ZIP_CHECKSUM: ${{steps.mac_pre_release.outputs.ZIP_CHECKSUM}}
WINDOWS_ZIP_CHECKSUM: ${{steps.windows_pre_release.outputs.ZIP_CHECKSUM}}

Expand Down Expand Up @@ -56,6 +57,13 @@ jobs:
if: matrix.config.kind == 'test_release'
run: cargo test --release

- name: Build release(musl)
if: matrix.config.kind == 'test_release'
run: |
sudo apt install musl musl-dev musl-tools
rustup target add x86_64-unknown-linux-musl
cargo build --release --target x86_64-unknown-linux-musl

# Release
- name: Pre-release (Linux)
id: linux_pre_release
Expand All @@ -64,6 +72,14 @@ jobs:
cd target/release
zip -r dprint-plugin-rustfmt-x86_64-unknown-linux-gnu.zip dprint-plugin-rustfmt dprint-plugin-rustfmt
echo "::set-output name=ZIP_CHECKSUM::$(shasum -a 256 dprint-plugin-rustfmt-x86_64-unknown-linux-gnu.zip | awk '{print $1}')"
- name: Pre-release (Linux-musl)
id: linux_musl_pre_release
if: startsWith(matrix.config.os, 'ubuntu') && matrix.config.kind == 'test_release' && startsWith(github.ref, 'refs/tags/')
run: |
cd target/x86_64-unknown-linux-musl/release
zip -r dprint-plugin-rustfmt-x86_64-unknown-linux-musl.zip dprint-plugin-rustfmt dprint-plugin-rustfmt
echo "::set-output name=ZIP_CHECKSUM::$(shasum -a 256 dprint-plugin-rustfmt-x86_64-unknown-linux-musl.zip | awk '{print $1}')"
mv dprint-plugin-rustfmt-x86_64-unknown-linux-musl.zip ../../release
- name: Pre-release (Mac)
id: mac_pre_release
if: startsWith(matrix.config.os, 'macOS') && matrix.config.kind == 'test_release' && startsWith(github.ref, 'refs/tags/')
Expand All @@ -85,7 +101,9 @@ jobs:
if: startsWith(matrix.config.os, 'ubuntu') && matrix.config.kind == 'test_release' && startsWith(github.ref, 'refs/tags/')
with:
name: linux-artifacts
path: target/release/dprint-plugin-rustfmt-x86_64-unknown-linux-gnu.zip
path: |
target/release/dprint-plugin-rustfmt-x86_64-unknown-linux-gnu.zip
target/release/dprint-plugin-rustfmt-x86_64-unknown-linux-musl.zip
- name: Upload Artifacts (Mac)
uses: actions/upload-artifact@v2
if: startsWith(matrix.config.os, 'macOS') && matrix.config.kind == 'test_release' && startsWith(github.ref, 'refs/tags/')
Expand Down Expand Up @@ -115,12 +133,14 @@ jobs:
- name: Move downloaded artifacts
run: |
mv linux-artifacts/dprint-plugin-rustfmt-x86_64-unknown-linux-gnu.zip .
mv linux-artifacts/dprint-plugin-rustfmt-x86_64-unknown-linux-musl.zip .
mv mac-artifacts/dprint-plugin-rustfmt-x86_64-apple-darwin.zip .
mv windows-artifacts/dprint-plugin-rustfmt-x86_64-pc-windows-msvc.zip .

- name: Output checksums
run: |
echo "Linux zip: ${{needs.build.outputs.LINUX_ZIP_CHECKSUM}}"
echo "Linux-musl zip: ${{needs.build.outputs.LINUX_MUSL_ZIP_CHECKSUM}}"
echo "Mac zip: ${{needs.build.outputs.MAC_ZIP_CHECKSUM}}"
echo "Windows zip: ${{needs.build.outputs.WINDOWS_ZIP_CHECKSUM}}"

Expand All @@ -143,6 +163,7 @@ jobs:
files: |
dprint-plugin-rustfmt-x86_64-apple-darwin.zip
dprint-plugin-rustfmt-x86_64-unknown-linux-gnu.zip
dprint-plugin-rustfmt-x86_64-unknown-linux-musl.zip
dprint-plugin-rustfmt-x86_64-pc-windows-msvc.zip
plugin.json
body: |
Expand Down
1 change: 1 addition & 0 deletions scripts/create_plugin_file.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ await processPlugin.createDprintOrgProcessPlugin({
platforms: [
"darwin-x86_64",
"linux-x86_64",
"linux-x86_64-musl",
"windows-x86_64",
],
isTest: Deno.args.some(a => a == "--test"),
Expand Down