Compare commits
10 Commits
3cf75ea666
...
89a88cdf58
Author | SHA1 | Date |
---|---|---|
pull[bot] | 89a88cdf58 | |
Brenden Matthews | a03f0bc562 | |
Brenden Matthews | 89e8fe580e | |
Brenden Matthews | 2578be2447 | |
Brenden Matthews | a5cc142bba | |
Brenden Matthews | 6a248a94d2 | |
Brenden Matthews | 9dfc7318f9 | |
Brenden Matthews | 8ba6cf625c | |
Brenden Matthews | 35d72314d2 | |
Brenden Matthews | a533bcb8e4 |
|
@ -0,0 +1,45 @@
|
|||
#!/usr/bin/env bash
|
||||
set -ex
|
||||
|
||||
DOCKERHUB_IMAGE_ID=$DOCKERHUB_ACCOUNT/$IMAGE_NAME
|
||||
|
||||
# Change all uppercase to lowercase
|
||||
DOCKERHUB_IMAGE_ID=$(echo $DOCKERHUB_IMAGE_ID | tr '[A-Z]' '[a-z]')
|
||||
|
||||
image_tags=()
|
||||
|
||||
# Strip git ref prefix from version
|
||||
VERSION_TAG=$(echo $GITHUB_REF | sed -e 's,.*/\(.*\),\1,')
|
||||
|
||||
# Strip "v" prefix from tag name
|
||||
if [[ "$GITHUB_REF" == refs/tags/* ]]; then
|
||||
VERSION_TAG=$(echo $VERSION_TAG | sed -e 's/^v//')
|
||||
fi
|
||||
|
||||
image_tags+=("--tag" "$DOCKERHUB_IMAGE_ID:$VERSION_TAG")
|
||||
|
||||
# tag as latest on releases
|
||||
if [[ "$RELEASE" == ON ]]; then
|
||||
image_tags+=("--tag" "$DOCKERHUB_IMAGE_ID:latest")
|
||||
fi
|
||||
|
||||
# Only build amd64 on PRs, build all platforms on main. The arm builds
|
||||
# take far too long.
|
||||
image_platforms="--platform linux/amd64"
|
||||
push_image=""
|
||||
cache_tag="pr-cache"
|
||||
|
||||
# Only push on main
|
||||
if [[ "$GITHUB_REF" == refs/heads/main ]]; then
|
||||
push_image="--push"
|
||||
image_platforms="--platform linux/arm/v7,linux/arm64/v8,linux/amd64"
|
||||
cache_tag="main-cache"
|
||||
fi
|
||||
|
||||
docker buildx build \
|
||||
${push_image} \
|
||||
${image_platforms} \
|
||||
--cache-from=type=registry,ref=$DOCKERHUB_ACCOUNT/$IMAGE_NAME:$cache_tag \
|
||||
--cache-to=type=registry,ref=$DOCKERHUB_ACCOUNT/$IMAGE_NAME:$cache_tag,mode=max \
|
||||
"${image_tags[@]}" \
|
||||
.
|
|
@ -2,7 +2,13 @@ name: Docker
|
|||
|
||||
on:
|
||||
push:
|
||||
# Publish `main` as Docker `latest` image.
|
||||
branches:
|
||||
- main
|
||||
paths-ignore:
|
||||
- web/**
|
||||
- doc/**
|
||||
|
||||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
paths-ignore:
|
||||
|
@ -23,7 +29,7 @@ env:
|
|||
DOCKER_BUILDKIT: 1
|
||||
|
||||
jobs:
|
||||
buildx:
|
||||
docker-buildx:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
|
@ -35,26 +41,8 @@ jobs:
|
|||
uses: docker/setup-buildx-action@v3
|
||||
- name: Log into Dockerhub registry
|
||||
run: echo "${{ secrets.DOCKERHUB_TOKEN }}" | docker login -u $DOCKERHUB_ACCOUNT --password-stdin
|
||||
- name: Build
|
||||
run: |
|
||||
DOCKERHUB_IMAGE_ID=$DOCKERHUB_ACCOUNT/$IMAGE_NAME
|
||||
|
||||
# Change all uppercase to lowercase
|
||||
DOCKERHUB_IMAGE_ID=$(echo $DOCKERHUB_IMAGE_ID | tr '[A-Z]' '[a-z]')
|
||||
|
||||
# Strip git ref prefix from version
|
||||
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
|
||||
|
||||
# Strip "v" prefix from tag name
|
||||
[[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//')
|
||||
|
||||
# Use Docker `latest` tag convention
|
||||
[ "$VERSION" == "main" ] && VERSION=latest
|
||||
|
||||
docker buildx build \
|
||||
--push \
|
||||
--platform linux/arm/v7,linux/arm64/v8,linux/amd64 \
|
||||
--cache-from=type=registry,ref=$DOCKERHUB_ACCOUNT/$IMAGE_NAME:buildcache \
|
||||
--cache-to=type=registry,ref=$DOCKERHUB_ACCOUNT/$IMAGE_NAME:buildcache,mode=max \
|
||||
--tag $DOCKERHUB_IMAGE_ID:$VERSION \
|
||||
.
|
||||
- name: Build and push Docker image
|
||||
env:
|
||||
RELEASE: "${{ startsWith(github.ref, 'refs/tags/') && 'ON' || 'OFF' }}"
|
||||
GITHUB_REF: ${{ github.ref }}
|
||||
run: ./.github/scripts/docker-build.bash
|
||||
|
|
30
Dockerfile
30
Dockerfile
|
@ -1,4 +1,4 @@
|
|||
FROM ubuntu:jammy AS builder
|
||||
FROM ubuntu:noble AS builder
|
||||
|
||||
RUN apt-get update \
|
||||
&& DEBIAN_FRONTEND=noninteractive \
|
||||
|
@ -6,6 +6,7 @@ RUN apt-get update \
|
|||
audacious-dev \
|
||||
ca-certificates \
|
||||
clang \
|
||||
cmake \
|
||||
curl \
|
||||
gfortran \
|
||||
git \
|
||||
|
@ -39,25 +40,11 @@ RUN apt-get update \
|
|||
libxml2-dev \
|
||||
libxmmsclient-dev \
|
||||
libxnvctrl-dev \
|
||||
make \
|
||||
ninja-build \
|
||||
patch \
|
||||
&& apt-get clean \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Compile CMake, we need the latest because the bug here (for armv7 builds):
|
||||
# https://gitlab.kitware.com/cmake/cmake/-/issues/20568
|
||||
WORKDIR /cmake
|
||||
ENV CMAKE_VERSION 3.25.1
|
||||
RUN curl -Lq https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/cmake-${CMAKE_VERSION}.tar.gz -o cmake-${CMAKE_VERSION}.tar.gz \
|
||||
&& tar xf cmake-${CMAKE_VERSION}.tar.gz \
|
||||
&& cd cmake-${CMAKE_VERSION} \
|
||||
&& CC=clang CXX=clang++ CFLAGS="-D_FILE_OFFSET_BITS=64" CXXFLAGS="-D_FILE_OFFSET_BITS=64" ./bootstrap --system-libs --parallel=5 \
|
||||
&& make -j5 \
|
||||
&& make -j5 install \
|
||||
&& cd \
|
||||
&& rm -rf /cmake
|
||||
|
||||
COPY . /conky
|
||||
WORKDIR /conky/build
|
||||
|
||||
|
@ -112,7 +99,7 @@ RUN sh -c 'if [ "$X11" = "yes" ] ; then \
|
|||
&& cmake --build . \
|
||||
&& cmake --install .
|
||||
|
||||
FROM ubuntu:jammy
|
||||
FROM ubuntu:noble
|
||||
|
||||
RUN apt-get update \
|
||||
&& DEBIAN_FRONTEND=noninteractive \
|
||||
|
@ -121,14 +108,14 @@ RUN apt-get update \
|
|||
libc++1 \
|
||||
libc++abi1 \
|
||||
libcairo2 \
|
||||
libcurl4 \
|
||||
libcurl4t64 \
|
||||
libdbus-glib-1-2 \
|
||||
libical3 \
|
||||
libimlib2 \
|
||||
libical3t64 \
|
||||
libimlib2t64 \
|
||||
libircclient1 \
|
||||
libiw30 \
|
||||
libiw30t64 \
|
||||
liblua5.3-0 \
|
||||
libmicrohttpd12 \
|
||||
libmicrohttpd12t64 \
|
||||
libmysqlclient21 \
|
||||
libncurses6 \
|
||||
libpulse0 \
|
||||
|
@ -140,6 +127,7 @@ RUN apt-get update \
|
|||
libxext6 \
|
||||
libxfixes3 \
|
||||
libxft2 \
|
||||
libxi6 \
|
||||
libxinerama1 \
|
||||
libxml2 \
|
||||
libxmmsclient6 \
|
||||
|
|
|
@ -132,8 +132,8 @@ endif(OS_HAIKU)
|
|||
|
||||
# Do version stuff
|
||||
set(VERSION_MAJOR "1")
|
||||
set(VERSION_MINOR "20")
|
||||
set(VERSION_PATCH "3")
|
||||
set(VERSION_MINOR "21")
|
||||
set(VERSION_PATCH "0")
|
||||
|
||||
find_program(APP_AWK awk)
|
||||
|
||||
|
|
Loading…
Reference in New Issue