Skip to content

Commit 00e08e6

Browse files
authored
chore: use pre-built binaries (#12)
1 parent 540b2b2 commit 00e08e6

File tree

2 files changed

+15
-20
lines changed

2 files changed

+15
-20
lines changed

.github/workflows/build-images.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,15 +55,20 @@ jobs:
5555
uses: docker/build-push-action@v6
5656
with:
5757
push: ${{ github.event_name != 'pull_request' }}
58+
load: ${{ github.event_name == 'pull_request' }}
5859
provenance: false
5960
platforms: linux/arm64
6061
tags: ghcr.io/biomejs/biome:${{ matrix.versions.patch }}-arm64
6162
file: Dockerfile
6263
cache-from: type=gha,scope=${{ matrix.versions.patch}}-arm64
6364
cache-to: type=gha,mode=max,scope=${{ matrix.versions.patch}}-arm64
6465
build-args: |
66+
ARCH=arm64
6567
BIOME_VERSION=${{ matrix.versions.patch }}
6668
BIOME_TAG_START=${{ matrix.versions.major == '2' && '@biomejs/biome@' || 'cli/v' }}
69+
- name: Verify image
70+
run: |
71+
docker run --pull=never --rm ghcr.io/biomejs/biome:${{ matrix.versions.patch }}-arm64 --version
6772
6873
build-images-amd64:
6974
name: ${{ matrix.versions.patch }} (amd64)
@@ -90,15 +95,20 @@ jobs:
9095
uses: docker/build-push-action@v6
9196
with:
9297
push: ${{ github.event_name != 'pull_request' }}
98+
load: ${{ github.event_name == 'pull_request' }}
9399
provenance: false
94100
platforms: linux/amd64
95101
tags: ghcr.io/biomejs/biome:${{ matrix.versions.patch }}-amd64
96102
file: Dockerfile
97103
cache-from: type=gha,scope=${{ matrix.versions.patch}}-amd64
98104
cache-to: type=gha,mode=max,scope=${{ matrix.versions.patch}}-amd64
99105
build-args: |
106+
ARCH=x64
100107
BIOME_VERSION=${{ matrix.versions.patch }}
101108
BIOME_TAG_START=${{ matrix.versions.major == '2' && '@biomejs/biome@' || 'cli/v' }}
109+
- name: Verify image
110+
run: |
111+
docker run --pull=never --rm ghcr.io/biomejs/biome:${{ matrix.versions.patch }}-amd64 --version
102112
103113
stitch-images:
104114
name: Stitch images (${{ matrix.versions.patch }})

Dockerfile

Lines changed: 5 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,18 @@
11
ARG ALPINE_VERSION=3.22
22

3-
FROM rust:1.90.0-alpine${ALPINE_VERSION} AS builder
3+
FROM alpine:${ALPINE_VERSION} AS biome
44

5+
ARG ARCH="x64"
56
ARG BIOME_VERSION=2.2.6
6-
ARG BIOME_TAG_START="cli/v"
7+
ARG BIOME_TAG_START="@biomejs/biome@"
78

89
ENV BIOME_VERSION=${BIOME_VERSION}
910
ENV BIOME_TAG_START=${BIOME_TAG_START}
1011

11-
WORKDIR /usr/src/biome
12-
13-
# Install build dependencies
14-
RUN apk add --no-cache musl-dev make
15-
16-
# Downloads the tarball for the version of Biome we want to build from GitHub Releases
17-
ADD https://github.com/biomejs/biome/archive/refs/tags/${BIOME_TAG_START}${BIOME_VERSION}.tar.gz /tmp/biome.tar.gz
18-
19-
# Extract the tarball into the working directory
20-
RUN tar -xzvf /tmp/biome.tar.gz -C /usr/src/biome/ --strip-components=1
21-
22-
# Build the biome binary
23-
ENV RUSTFLAGS="-C strip=symbols"
24-
RUN cargo build -p biome_cli --release
25-
26-
FROM alpine:${ALPINE_VERSION} AS biome
27-
28-
COPY --from=builder /usr/src/biome/target/release/biome /usr/local/bin/biome
12+
ADD https://github.com/biomejs/biome/releases/download/${BIOME_TAG_START}${BIOME_VERSION}/biome-linux-${ARCH}-musl /usr/local/bin/biome
2913

3014
# Install git and flag to repo safe
15+
RUN chmod +x /usr/local/bin/biome
3116
RUN apk add --no-cache git
3217
RUN git config --global --add safe.directory /code
3318

0 commit comments

Comments
 (0)