Skip to content

Commit

Permalink
Build an Alpine extension
Browse files Browse the repository at this point in the history
  • Loading branch information
charliermarsh committed Jan 15, 2024
1 parent 7048f34 commit afbd9ef
Showing 1 changed file with 31 additions and 2 deletions.
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

0 comments on commit afbd9ef

Please sign in to comment.