diff --git a/.github/workflows/.nightly.yml b/.github/workflows/.nightly.yml new file mode 100644 index 0000000000..5ec853e71b --- /dev/null +++ b/.github/workflows/.nightly.yml @@ -0,0 +1,111 @@ +# 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|static*|cross*) + echo "worker=ubuntu-20.04" >> $GITHUB_OUTPUT + ;; + arm64|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 + + if [ "${{ inputs.target }}" == static ]; then + export DOCKER_BUILD_PKGS="${{ inputs.arch }}" + else + export ARCH=${{ inputs.arch }} + fi + + make ${{ inputs.target }} + + - + name: Verify + if: ${{ inputs.image != '' }} + run: | + export IMAGE=${{ inputs.image }} + export ARCH=${{ inputs.arch }} + + if [ "$ARCH" == "armhf" ]; then + export VERIFY_PLATFORM="--platform linux/arm/v7" + fi + + make verify + + - + name: Artifact deb + uses: actions/upload-artifact@v4 + with: + name: nightly-${{ inputs.target }}-${{ inputs.arch }} + path: | + deb/debbuild/${{ inputs.target }} + rpm/rpmbuild/${{ inputs.target }} + static/build + retention-days: 1 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml deleted file mode 100644 index 9ef7e269cb..0000000000 --- a/.github/workflows/ci.yml +++ /dev/null @@ -1,35 +0,0 @@ -name: ci - -on: - workflow_dispatch: - push: - branches: - - 'master' - - '[0-9]+.[0-9]{2}' - tags: - - 'v*' - pull_request: - -jobs: - build: - runs-on: ubuntu-20.04 - strategy: - fail-fast: false - matrix: - target: - - debian-bullseye - - debian-bookworm - - ubuntu-focal - - ubuntu-jammy - - ubuntu-noble - steps: - - - name: Checkout - uses: actions/checkout@v3 - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v1 - - - name: Build - run: | - make ${{ matrix.target }} diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml new file mode 100644 index 0000000000..f557f2e307 --- /dev/null +++ b/.github/workflows/nightly.yml @@ -0,0 +1,54 @@ +name: nightly + +on: + workflow_dispatch: + pull_request: + +jobs: + packages: + strategy: + fail-fast: false + matrix: + 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: static-linux + dist: {target: "static", image: ""} + - arch: cross-mac + dist: {target: "static", image: ""} + - arch: cross-win + dist: {target: "static", image: ""} + - arch: armhf + dist: {target: "debian-bookworm", image: "debian:bookworm"} + #- arch: armhf + # dist: {target: "debian-bullseye", image: "debian:bullseye"} + #- 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 }} + diff --git a/Makefile b/Makefile index 39bfa7276f..6bd0c0db60 100644 --- a/Makefile +++ b/Makefile @@ -83,7 +83,7 @@ debian-% raspbian-% ubuntu-%: checkout ## build deb packages for the specified d $(MAKE) -C deb VERSION=$(VERSION) GO_VERSION=$(GO_VERSION) $@ .PHONY: static -static: DOCKER_BUILD_PKGS:=static-linux cross-mac cross-win cross-arm +static: DOCKER_BUILD_PKGS:=static-linux cross-mac cross-win static: checkout ## build static-compiled packages for p in $(DOCKER_BUILD_PKGS); do \ $(MAKE) -C $@ VERSION=$(VERSION) GO_VERSION=$(GO_VERSION) TARGETPLATFORM=$(TARGETPLATFORM) CONTAINERD_VERSION=$(CONTAINERD_VERSION) RUNC_VERSION=$(RUNC_VERSION) $${p}; \ diff --git a/common.mk b/common.mk index 62824446c6..148887507e 100644 --- a/common.mk +++ b/common.mk @@ -1,4 +1,4 @@ -ARCH=$(shell uname -m) +ARCH?=$(shell uname -m) # These are the architecture formats as used in release-packaging Jenkinsfile # This is an ugly chimera, nobody uses this combination of dpkg and uname formats @@ -45,6 +45,9 @@ DOCKER_COMPOSE_REF ?= v2.29.2 # but can be a valid git reference in DOCKER_BUILDX_REPO. DOCKER_BUILDX_REF ?= v0.16.2 +DOCKER_BUILDX_VERSION ?= $(DOCKER_BUILDX_REF) +DOCKER_COMPOSE_VERSION ?= $(DOCKER_COMPOSE_REF) + # Use "stage" to install dependencies from download-stage.docker.com during the # verify step. Leave empty or use any other value to install from download.docker.com VERIFY_PACKAGE_REPO ?= prod diff --git a/deb/Makefile b/deb/Makefile index d65bd11e08..79709191eb 100644 --- a/deb/Makefile +++ b/deb/Makefile @@ -5,8 +5,8 @@ GO_BASE_IMAGE=golang GO_IMAGE?=$(GO_BASE_IMAGE):$(GO_VERSION)-bookworm EPOCH?=5 GEN_DEB_VER=$(shell ./gen-deb-ver $(realpath $(CURDIR)/../src/github.com/docker/cli) "$(VERSION)") -GEN_BUILDX_DEB_VER=$(shell ./gen-deb-ver $(realpath $(CURDIR)/../src/github.com/docker/buildx) "$(DOCKER_BUILDX_REF)") -GEN_COMPOSE_DEB_VER=$(shell ./gen-deb-ver $(realpath $(CURDIR)/../src/github.com/docker/compose) "$(DOCKER_COMPOSE_REF)") +GEN_BUILDX_DEB_VER=$(shell ./gen-deb-ver $(realpath $(CURDIR)/../src/github.com/docker/buildx) "$(DOCKER_BUILDX_VERSION)") +GEN_COMPOSE_DEB_VER=$(shell ./gen-deb-ver $(realpath $(CURDIR)/../src/github.com/docker/compose) "$(DOCKER_COMPOSE_VERSION)") CLI_GITCOMMIT?=$(shell cd $(realpath $(CURDIR)/../src/github.com/docker/cli) && git rev-parse --short HEAD) ENGINE_GITCOMMIT?=$(shell cd $(realpath $(CURDIR)/../src/github.com/docker/docker) && git rev-parse --short HEAD) BUILDX_GITCOMMIT?=$(shell cd $(realpath $(CURDIR)/../src/github.com/docker/buildx) && git rev-parse --short HEAD) diff --git a/rpm/Makefile b/rpm/Makefile index da37c205c8..d51eef97bd 100644 --- a/rpm/Makefile +++ b/rpm/Makefile @@ -4,8 +4,8 @@ PLUGINS_DIR=$(realpath $(CURDIR)/../plugins) GO_BASE_IMAGE=golang GO_IMAGE?=$(GO_BASE_IMAGE):$(GO_VERSION)-bookworm GEN_RPM_VER=$(shell ./gen-rpm-ver $(realpath $(CURDIR)/../src/github.com/docker/cli) "$(VERSION)") -GEN_BUILDX_RPM_VER=$(shell ./gen-rpm-ver $(realpath $(CURDIR)/../src/github.com/docker/buildx) "$(DOCKER_BUILDX_REF)") -GEN_COMPOSE_RPM_VER=$(shell ./gen-rpm-ver $(realpath $(CURDIR)/../src/github.com/docker/compose) "$(DOCKER_COMPOSE_REF)") +GEN_BUILDX_RPM_VER=$(shell ./gen-rpm-ver $(realpath $(CURDIR)/../src/github.com/docker/buildx) "$(DOCKER_BUILDX_VERSION)") +GEN_COMPOSE_RPM_VER=$(shell ./gen-rpm-ver $(realpath $(CURDIR)/../src/github.com/docker/compose) "$(DOCKER_COMPOSE_VERSION)") CLI_GITCOMMIT?=$(shell cd $(realpath $(CURDIR)/../src/github.com/docker/cli) && git rev-parse --short HEAD) ENGINE_GITCOMMIT?=$(shell cd $(realpath $(CURDIR)/../src/github.com/docker/docker) && git rev-parse --short HEAD) BUILDX_GITCOMMIT?=$(shell cd $(realpath $(CURDIR)/../src/github.com/docker/buildx) && git rev-parse --short HEAD)