Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: musl libc support #40

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 @@ -25,6 +25,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 All @@ -51,6 +52,13 @@ jobs:
- name: Test release
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)
Expand All @@ -60,6 +68,14 @@ jobs:
cd target/release
zip -r dprint-plugin-prettier-x86_64-unknown-linux-gnu.zip dprint-plugin-prettier dprint-plugin-prettier
echo "::set-output name=ZIP_CHECKSUM::$(shasum -a 256 dprint-plugin-prettier-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-prettier-x86_64-unknown-linux-musl.zip dprint-plugin-prettier dprint-plugin-prettier
echo "::set-output name=ZIP_CHECKSUM::$(shasum -a 256 dprint-plugin-prettier-x86_64-unknown-linux-musl.zip | awk '{print $1}')"
mv dprint-plugin-prettier-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 @@ -81,7 +97,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-prettier-x86_64-unknown-linux-gnu.zip
path: |
target/release/dprint-plugin-prettier-x86_64-unknown-linux-gnu.zip
target/release/dprint-plugin-prettier-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 @@ -111,12 +129,14 @@ jobs:
- name: Move downloaded artifacts
run: |
mv linux-artifacts/dprint-plugin-prettier-x86_64-unknown-linux-gnu.zip .
mv linux-artifacts/dprint-plugin-prettier-x86_64-unknown-linux-musl.zip .
mv mac-artifacts/dprint-plugin-prettier-x86_64-apple-darwin.zip .
mv windows-artifacts/dprint-plugin-prettier-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 @@ -139,6 +159,7 @@ jobs:
files: |
dprint-plugin-prettier-x86_64-apple-darwin.zip
dprint-plugin-prettier-x86_64-unknown-linux-gnu.zip
dprint-plugin-prettier-x86_64-unknown-linux-musl.zip
dprint-plugin-prettier-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