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

Include Alpine in target platforms #387

Merged
merged 1 commit into from
Jan 15, 2024
Merged
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
33 changes: 31 additions & 2 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,14 @@ jobs:
- os: macos-latest-xlarge
target: aarch64-apple-darwin
code-target: darwin-arm64
- os: ubuntu-20.04
target: x86_64-unknown-linux-musl
code-target: alpine-x64
arch: x86_64
- os: ubuntu-20.04
target: aarch64-unknown-linux-musl
code-target: alpine-arm64
arch: aarch64

name: Build (${{ matrix.target }})
needs: ["build-id"]
Expand Down Expand Up @@ -95,7 +103,7 @@ jobs:

# ARM builds on Ubuntu, which should select Ruff's ARM binary.
- uses: uraimo/run-on-arch-action@v2
if: ${{ startsWith(matrix.os, 'ubuntu') && !startsWith(matrix.target, 'x86_64') }}
if: ${{ startsWith(matrix.os, 'ubuntu') && !startsWith(matrix.target, 'x86_64') && !endsWith(matrix.target, 'musl') }}
with:
arch: ${{ matrix.arch }}
distro: ubuntu20.04
Expand All @@ -106,9 +114,22 @@ jobs:
run: |
python3 -m pip install -t ./bundled/libs --implementation py --no-deps --upgrade -r ./requirements.txt

# Alpine builds, which should select Ruff's musl binaries.
- uses: jirutka/setup-alpine@v1
if: ${{ startsWith(matrix.os, 'ubuntu') && endsWith(matrix.target, 'musl') }}
with:
arch: ${{ matrix.arch }}
- shell: alpine.sh --root {0}
if: ${{ startsWith(matrix.os, 'ubuntu') && endsWith(matrix.target, 'musl') }}
run: |
apk add --no-cache python3 py3-pip
python3 -m pip install -t ./bundled/libs --implementation py --no-deps --upgrade -r ./requirements.txt

# Every other architecture, which should defer to `pip` without any special treatment.
- run: python -m pip install -t ./bundled/libs --implementation py --no-deps --upgrade -r ./requirements.txt
if: ${{ !startsWith(matrix.os, 'macos') && (!startsWith(matrix.os, 'ubuntu') || startsWith(matrix.target, 'x86_64')) }}
if: ${{ !startsWith(matrix.os, 'macos')
&& !(startsWith(matrix.os, 'ubuntu') && !startsWith(matrix.target, 'x86_64') && !endsWith(matrix.target, 'musl'))
&& !(startsWith(matrix.os, 'ubuntu') && endsWith(matrix.target, 'musl')) }}

# Install Node.
- name: Install Node.js
Expand Down Expand Up @@ -189,6 +210,14 @@ jobs:
with:
name: dist-aarch64-pc-windows-msvc
path: dist
- uses: actions/download-artifact@v3
with:
name: dist-x86_64-unknown-linux-musl
path: dist
- uses: actions/download-artifact@v3
with:
name: dist-aarch64-unknown-linux-musl
path: dist
- run: ls -al ./dist

# Install Node dependencies.
Expand Down