Skip to content

Commit

Permalink
Include Alpine in target platforms (#387)
Browse files Browse the repository at this point in the history
## Summary

This PR ensures that we publish VS Code extensions for the `alpine-x86`
and `alpine-arm64` target platforms.

See
https://code.visualstudio.com/api/working-with-extensions/publishing-extension#platformspecific-extensions
for details:

> The currently available platforms are: win32-x64, win32-arm64,
linux-x64, linux-arm64, linux-armhf, alpine-x64, alpine-arm64,
darwin-x64, darwin-arm64 and web.

## Test Plan

Performed a dry run, and verified that Ruff selected the correct musl
wheel for x86:

![Screenshot 2024-01-15 at 2 43
04 PM](https://github.com/astral-sh/ruff-vscode/assets/1309177/6ff5a1d1-0eda-4b05-ad3e-5a36a9aac821)

And again for arm:

![Screenshot 2024-01-15 at 2 42
56 PM](https://github.com/astral-sh/ruff-vscode/assets/1309177/9f42b62c-72af-4278-afbb-9326ae088335)
  • Loading branch information
charliermarsh committed Jan 15, 2024
1 parent 7048f34 commit f1c0eb7
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 f1c0eb7

Please sign in to comment.