Skip to content

[WIP] gha: Nightly packages #1061

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 9 commits into
base: master
Choose a base branch
from
Draft
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
nightly: amd64 and arm64
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
  • Loading branch information
vvoland committed Sep 4, 2024
commit d90ca079dd24acb20e773aa20d838382b15bf5d9
109 changes: 109 additions & 0 deletions .github/workflows/.nightly.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
# reusable workflow
name: .build

# TODO: hide reusable workflow from the UI. Tracked in https://github.com/community/community/discussions/12025

# Default to 'contents: read', which grants actions to read commits.
#
# If any permission is set, any permission not included in the list is
# implicitly set to "none".
#
# see https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#permissions
permissions:
contents: read

on:
workflow_call:
inputs:
arch:
required: true
type: string
default: "amd64"
target:
required: true
type: string
image:
required: true
type: string

jobs:
# Transform the arch into a specific worker
# amd64 -> ubuntu-22.04
# arm64 -> ubuntu22_arm64
prepare:
runs-on: ubuntu-22.04
outputs:
worker: ${{ steps.set.outputs.worker }}
version: ${{ steps.set.outputs.version }}
steps:
-
name: Set worker
id: set
run: |
echo "version=$(date +%Y%m%d)" >> $GITHUB_OUTPUT
case ${{ inputs.arch }} in
amd64)
echo "worker=ubuntu-20.04" >> $GITHUB_OUTPUT
;;
arm64)
echo "worker=ubuntu22_arm64" >> $GITHUB_OUTPUT
;;
armhf)
echo "worker=ubuntu22_arm64" >> $GITHUB_OUTPUT
;;
*)
echo "::error::Unsupported arch: ${{ inputs.arch }}"
exit 1
;;
esac

build:
needs: prepare
runs-on: ${{ needs.prepare.outputs.worker }}
steps:
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

-
name: Checkout
uses: actions/checkout@v4

-
name: Build
run: |
export VERSION=${{ needs.prepare.outputs.version }}
export REF=master

export DOCKER_BUILDX_REF=master
export DOCKER_BUILDX_VERSION=$VERSION

export DOCKER_COMPOSE_REF=main
export DOCKER_COMPOSE_VERSION=$VERSION

export ARCH=${{ inputs.arch }}

make ${{ inputs.target }}

-
name: Verify
run: |
export IMAGE=${{ inputs.image }}
export ARCH=${{ inputs.arch }}

make verify

-
name: Artifact deb
uses: actions/upload-artifact@v4
with:
name: nightly-deb-${{ inputs.target }}-${{ inputs.arch }}
path: deb/debbuild/${{ inputs.target }}
retention-days: 1
-
name: Artifact rpm
uses: actions/upload-artifact@v4
with:
name: nightly-rpm-${{ inputs.target }}-${{ inputs.arch }}
path: rpm/rpmbuild/${{ inputs.target }}
retention-days: 1
35 changes: 0 additions & 35 deletions .github/workflows/ci.yml

This file was deleted.

75 changes: 39 additions & 36 deletions .github/workflows/nightly.yml
Original file line number Diff line number Diff line change
@@ -1,45 +1,48 @@
name: nightly

on:
schedule:
- cron: '0 0 * * *'
workflow_dispatch: {}
workflow_dispatch:
pull_request:

jobs:
build:
runs-on: selfhosted
packages:
strategy:
fail-fast: false
matrix:
target:
- debian-bookworm
steps:
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
arch:
- amd64
- arm64
dist:
#- {target: "debian-bullseye", image: "debian:bullseye"}
- {target: "debian-bookworm", image: "debian:bookworm"}
#- {target: "ubuntu-focal", image: "ubuntu:focal"}
- {target: "ubuntu-jammy", image: "ubuntu:jammy"}
- {target: "ubuntu-noble", image: "ubuntu:noble"}

- {target: "centos-9", image: "quay.io/centos/centos:stream9"}
#- {target: "fedora-39", image: "fedora:39"}
- {target: "fedora-40", image: "fedora:40"}
#- {target: "rhel-8", image: "registry.access.redhat.com/ubi8/ubi"}
#- {target: "rhel-9", image: "registry.access.redhat.com/ubi9/ubi"}
include:
#- arch: armhf
# dist: {target: "debian-bullseye", image: "debian:bullseye"}
- arch: armhf
dist: {target: "debian-bookworm", image: "debian:bookworm"}
#- arch: armhf
# dist: {target: "ubuntu-focal", image: "ubuntu:focal"}
#- arch: armhf
# dist: {target: "ubuntu-jammy", image: "ubuntu:jammy"}
- arch: armhf
dist: {target: "ubuntu-noble", image: "ubuntu:noble"}
# TODO
# - arch: armhf
# dist: {target: "raspbian-bullseye", image: "balenalib/rpi-raspbian:bullseye"}
# - arch: armhf
# dist: {target: "raspbian-bookworm", image: "balenalib/rpi-raspbian:bookworm"}
uses: ./.github/workflows/.nightly.yml
with:
arch: ${{ matrix.arch }}
target: ${{ matrix.dist.target }}
image: ${{ matrix.dist.image }}

-
name: Checkout
uses: actions/checkout@v3

-
name: Build
run: |
export VERSION=$(date +%Y%m%d)
export REF=master

export DOCKER_BUILDX_REF=master
export DOCKER_BUILDX_VERSION=$VERSION

export DOCKER_COMPOSE_REF=main
export DOCKER_COMPOSE_VERSION=$VERSION

make ${{ matrix.target }}

-
name: Artifact
uses: actions/upload-artifact@v2
with:
name: nightly-${{ matrix.target }}
path: deb/debbuild/${{ matrix.target }}
retention-days: 3