-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert CI/CD changes for cross-compile effort to allow intermediate r…
…elease. (#148)
- Loading branch information
1 parent
f8732dd
commit f0dabda
Showing
2 changed files
with
22 additions
and
159 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,4 @@ | ||
# ARG to specify Crystal version and base image tag | ||
ARG CRYSTAL_VERSION=1.13.1 | ||
ARG BASE_IMAGE_TAG=ubuntu-22.04 | ||
ARG CRYSTAL_VERSION | ||
FROM crystallang/crystal:${CRYSTAL_VERSION}-alpine | ||
|
||
# Stage 1: Build for x86_64 | ||
FROM 84codes/crystal:${CRYSTAL_VERSION}-${BASE_IMAGE_TAG} AS builder-x86_64 | ||
WORKDIR /app | ||
RUN git clone https://github.com/coverallsapp/coverage-reporter.git . | ||
# Install only the necessary dependencies, skipping ameba and kcov | ||
RUN sed -i '/ameba/d' shard.yml \ | ||
&& sed -i '/crystal-kcov/d' shard.yml \ | ||
&& shards install --ignore-crystal-version \ | ||
&& mkdir -p /app/bin \ | ||
&& crystal build --release src/coverage_reporter.cr -o /app/bin/coveralls | ||
|
||
# Stage 2: Build for aarch64 | ||
FROM 84codes/crystal:${CRYSTAL_VERSION}-${BASE_IMAGE_TAG} AS builder-aarch64 | ||
WORKDIR /app | ||
COPY --from=builder-x86_64 /app /app | ||
|
||
# Install dependencies. Ensure ameba and kcov are not present | ||
RUN sed -i '/ameba/d' shard.yml \ | ||
&& sed -i '/crystal-kcov/d' shard.yml \ | ||
&& rm -rf lib/* \ | ||
&& rm -rf .shards \ | ||
&& shards install --ignore-crystal-version \ | ||
&& mkdir -p /app/bin \ | ||
&& crystal build --release src/coverage_reporter.cr -o /app/bin/coveralls | ||
|
||
# Stage 3a: Export Binary for x86_64 | ||
FROM scratch AS x86_64_binary | ||
COPY --from=builder-x86_64 /app/bin/coveralls /coveralls | ||
|
||
# Stage 3b: Export Binary for aarch64 | ||
FROM scratch AS aarch64_binary | ||
COPY --from=builder-aarch64 /app/bin/coveralls /coveralls | ||
RUN apk add xz-dev xz-static libxml2-dev libxml2-static sqlite-dev sqlite-static |