Skip to content

Commit

Permalink
Merge pull request #3 from regolith-linux/additional-packages
Browse files Browse the repository at this point in the history
feat: split packages into common and additional per distro
  • Loading branch information
khos2ow authored Jan 7, 2025
2 parents 1e04ef5 + cd24c8d commit 3b0ee38
Show file tree
Hide file tree
Showing 5 changed files with 93 additions and 33 deletions.
14 changes: 13 additions & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ on:
branches:
- main

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
matrix-builder:
runs-on: ubuntu-24.04
Expand Down Expand Up @@ -49,12 +53,20 @@ jobs:
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Generate Packages List
run: |
packages="$(cat common-packages | tr '\n' ' ')"
packages+=" $(cat "${{ matrix.distro }}/${{ matrix.codename }}/additional-packages" | tr '\n' ' ')"
echo "packages=$packages" >> $GITHUB_ENV
- name: Build & Push ci-${{ matrix.distro }}:${{ matrix.codename }}-${{ matrix.arch }} Image
uses: docker/build-push-action@v6.10.0
with:
context: .
platforms: "linux/${{ matrix.arch }}"
push: true
build-args: "REFERENCE=${{ matrix.distro }}:${{ matrix.codename }}"
build-args: |
"REFERENCE=${{ matrix.distro }}:${{ matrix.codename }}"
"PACKAGES=${{ env.packages }}"
file: ${{ matrix.distro }}/Dockerfile
tags: ghcr.io/${{ github.repository_owner }}/ci-${{ matrix.distro }}:${{ matrix.codename }}-${{ matrix.arch }}
59 changes: 59 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Test Docker Images

on:
pull_request:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
matrix-builder:
runs-on: ubuntu-24.04
outputs:
includes: ${{ steps.builder.outputs.includes }}
steps:
- name: Build Matrix
id: builder
uses: regolith-linux/actions/build-matrix@main
with:
type: "platform"
stage: "unstable"
arch: "amd64"

build:
runs-on: ubuntu-24.04
needs: matrix-builder

strategy:
fail-fast: false
matrix:
include: ${{ fromJSON(needs.matrix-builder.outputs.includes) }}

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Generate Packages List
run: |
packages="$(cat common-packages | tr '\n' ' ')"
packages+=" $(cat "${{ matrix.distro }}/${{ matrix.codename }}/additional-packages" | tr '\n' ' ')"
echo "packages=$packages" >> $GITHUB_ENV
- name: Build ci-${{ matrix.distro }}:${{ matrix.codename }}-${{ matrix.arch }} Image
uses: docker/build-push-action@v6.10.0
with:
context: .
platforms: "linux/${{ matrix.arch }}"
push: false
build-args: |
"REFERENCE=${{ matrix.distro }}:${{ matrix.codename }}"
"PACKAGES=${{ env.packages }}"
file: ${{ matrix.distro }}/Dockerfile
tags: ci-${{ matrix.distro }}:${{ matrix.codename }}-${{ matrix.arch }}
13 changes: 13 additions & 0 deletions common-packages
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
sudo
git
ca-certificates
wget
curl
jq
gpg
gpg-agent
devscripts
dput
diffutils
packaging-dev
git-buildpackage
20 changes: 4 additions & 16 deletions debian/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,8 @@ ARG REFERENCE=${REFERENCE:-debian:latest}
FROM $REFERENCE

ENV DEBIAN_FRONTEND="noninteractive"
WORKDIR /build

RUN apt update -qq && \
apt install --no-install-recommends -y \
sudo \
git \
ca-certificates \
wget \
curl \
jq \
gpg \
gpg-agent \
devscripts \
dput \
diffutils \
packaging-dev \
git-buildpackage
ARG PACKAGES=${PACKAGES:-sudo}
RUN apt update -qq && apt install --no-install-recommends -y $PACKAGES

WORKDIR /build
20 changes: 4 additions & 16 deletions ubuntu/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,8 @@ ARG REFERENCE=${REFERENCE:-ubuntu:latest}
FROM $REFERENCE

ENV DEBIAN_FRONTEND="noninteractive"
WORKDIR /build

RUN apt update -qq && \
apt install --no-install-recommends -y \
sudo \
git \
ca-certificates \
wget \
curl \
jq \
gpg \
gpg-agent \
devscripts \
dput \
diffutils \
packaging-dev \
git-buildpackage
ARG PACKAGES=${PACKAGES:-sudo}
RUN apt update -qq && apt install --no-install-recommends -y $PACKAGES

WORKDIR /build

0 comments on commit 3b0ee38

Please sign in to comment.