Skip to content

Commit 3b11998

Browse files
Configure automatic version updates with Bump (#284)
1 parent 4b397e5 commit 3b11998

File tree

6 files changed

+51
-7
lines changed

6 files changed

+51
-7
lines changed

.dockerignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,5 @@ LICENSE
1414
Dockerfile
1515
*.dockerfile
1616
qodana.baseline.json
17+
Bumpfile
18+
hashupdate

.github/workflows/bump.yaml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: Bump CI
2+
3+
on:
4+
workflow_dispatch:
5+
schedule:
6+
- cron: '0 10 * * *'
7+
8+
jobs:
9+
bump:
10+
name: Search for dependency updates
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout code changes
14+
uses: actions/checkout@v4
15+
16+
- name: Update dependencies
17+
uses: wader/bump/action@master
18+
env:
19+
GITHUB_TOKEN: ${{ secrets.BUMP_TOKEN }}

.github/workflows/unit-test.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ jobs:
2626
- name: Setup FFmpeg
2727
uses: FedericoCarboni/setup-ffmpeg@v3
2828
with:
29+
# bump: ffmpeg-ci /ffmpeg-version: '([\d.]+)'/ docker:mwader/static-ffmpeg|~7.0
2930
ffmpeg-version: '7.0.2'
3031

3132
- name: Setup project and upload dependency graph

Bumpfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
.github/workflows/unit-test.yml
2+
Dockerfile

Dockerfile

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,15 @@
11
FROM eclipse-temurin AS builder
2-
ARG LIBWEBP=libwebp-1.4.0-linux-x86-64
3-
RUN curl -s -L https://storage.googleapis.com/downloads.webmproject.org/releases/webp/${LIBWEBP}.tar.gz | \
4-
tar -xvzf - -C /tmp --one-top-level=libwebp --strip-components=1
2+
3+
# bump: libwebp /LIBWEBP_VERSION=([\d.]+)/ git:https://chromium.googlesource.com/webm/libwebp.git|*
4+
# bump: libwebp after ./hashupdate Dockerfile LIBWEBP $LATEST
5+
ARG LIBWEBP_VERSION=1.4.0
6+
ARG LIBWEBP_URL="https://storage.googleapis.com/downloads.webmproject.org/releases/webp/libwebp-$LIBWEBP_VERSION-linux-x86-64.tar.gz"
7+
ARG LIBWEBP_SHA256=94ac053be5f8cb47a493d7a56b2b1b7328bab9cff24ecb89fa642284330d8dff
8+
59
WORKDIR /app
10+
RUN curl "$LIBWEBP_URL" -o libwebp.tar.gz && \
11+
echo "$LIBWEBP_SHA256 libwebp.tar.gz" | sha256sum -c - && \
12+
tar -xzf libwebp.tar.gz --one-top-level=libwebp --strip-components=1
613
COPY settings.gradle build.gradle gradlew ./
714
COPY gradle ./gradle
815
RUN --mount=type=cache,target=/home/gradle/.gradle/caches \
@@ -11,10 +18,14 @@ COPY . .
1118
RUN ./gradlew runtime --no-daemon
1219

1320
FROM gcr.io/distroless/base-nossl:nonroot AS bot
14-
COPY --from=builder /app/build/jre ./jre
15-
COPY --from=builder /app/build/libs/Stickerify-shadow.jar .
16-
COPY --from=builder /tmp/libwebp/bin/cwebp /usr/local/bin/
17-
COPY --from=builder /tmp/libwebp/bin/dwebp /usr/local/bin/
21+
22+
# bump: ffmpeg /static-ffmpeg:([\d.]+)/ docker:mwader/static-ffmpeg|~7.0
1823
COPY --from=mwader/static-ffmpeg:7.0.2 /ffmpeg /usr/local/bin/
1924
ENV FFMPEG_PATH=/usr/local/bin/ffmpeg
25+
26+
COPY --from=builder /app/build/jre ./jre
27+
COPY --from=builder /app/build/libs/Stickerify-shadow.jar .
28+
COPY --from=builder /app/libwebp/bin/cwebp /usr/local/bin/
29+
COPY --from=builder /app/libwebp/bin/dwebp /usr/local/bin/
30+
2031
CMD ["jre/bin/java", "-Dcom.sksamuel.scrimage.webp.binary.dir=/usr/local/bin/", "-jar", "Stickerify-shadow.jar"]

hashupdate

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/bin/sh
2+
set -eu
3+
4+
# from https://github.com/wader/static-ffmpeg/blob/787709ac341e7ef16f8a1768ed1e5a30b492a0b7/hashupdate
5+
# Usage: hashupdate <FILE> <NAME> <VERSION>
6+
URL_TEMPLATE=$(grep "$2_URL=" "$1" | sed -E 's/.*="(.*)"/\1/' | tr -d '\r')
7+
URL=$(echo "$URL_TEMPLATE" | sed "s/\$$2_VERSION/$3/g")
8+
SHA256=$(curl -sL "$URL" | sha256sum | sed -e 's/ -//g')
9+
sed -i -E "s/$2_SHA256=.*/$2_SHA256=$SHA256/" "$1"

0 commit comments

Comments
 (0)