Drop 'latest' tag as a way of finding the newest tag

This commit is contained in:
Juno Takano 2026-03-11 02:02:46 -03:00
commit 1d5a7bad80
4 changed files with 37 additions and 31 deletions

View file

@ -1,14 +1,27 @@
FROM alpine:latest
MAINTAINER Juno Takano juno@jutty.dev
ENV DEBUG=debug
ENV TAG=${TAG:-latest}
# Setup tooling
RUN apk add curl clang git file
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
# Install
RUN git clone -b "$TAG" --single-branch https://codeberg.org/jutty/en /build
RUN <<EOF
REPO_URL=https://codeberg.org/jutty/en
LAST_TAG=$(
git ls-remote --tags "$REPO_URL" \
| grep refs/tags \
| sed 's/.*refs\/tags\///' \
| sort -V \
| tail -n 1
)
git config --global advice.detachedHead false
echo "Selected tag: $LAST_TAG"
git clone --verbose -b "$LAST_TAG" \
--depth 1 --single-branch --no-tags \
"$REPO_URL" /build
EOF
RUN <<EOF
cd /build && /root/.cargo/bin/cargo build --locked --release
mv /build/target/release/en /usr/local/bin/en

View file

@ -1,7 +1,6 @@
FROM debian:stable-slim
MAINTAINER Juno Takano juno@jutty.dev
ENV DEBUG=debug
ENV TAG=${TAG:-latest}
# Setup tooling
RUN apt-get -y --update install --no-install-recommends \
@ -9,7 +8,21 @@ RUN apt-get -y --update install --no-install-recommends \
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
# Install
RUN git clone -b "$TAG" --single-branch https://codeberg.org/jutty/en /build
RUN <<EOF
REPO_URL=https://codeberg.org/jutty/en
LAST_TAG=$(
git ls-remote --tags "$REPO_URL" \
| grep refs/tags \
| sed 's/.*refs\/tags\///' \
| sort -V \
| tail -n 1
)
git config --global advice.detachedHead false
echo "Selected tag: $LAST_TAG"
git clone --verbose -b "$LAST_TAG" \
--depth 1 --single-branch --no-tags \
"$REPO_URL" /build
EOF
RUN <<EOF
cd /build && /root/.cargo/bin/cargo build --locked --release
mv /build/target/release/en /usr/local/bin/en