Skip to content

Bump docker/setup-buildx-action from 4.0.0 to 4.1.0 #244

Bump docker/setup-buildx-action from 4.0.0 to 4.1.0

Bump docker/setup-buildx-action from 4.0.0 to 4.1.0 #244

Workflow file for this run

name: Build binaries and create a draft release
on:
push:
pull_request:
workflow_dispatch:
inputs:
TAG:
description: Docker CLI tag to build
required: true
default: v25.0.1
defaults:
run:
shell: bash
permissions:
contents: write # needed to create release
jobs:
build:
strategy:
fail-fast: false
runs-on: ubuntu-latest
defaults:
run:
working-directory: cli
steps:
- name: Set Docker CLI tag from tag
if: startsWith(github.event.ref, 'refs/tags/')
run: |
DOCKER_CLI_REF="${{ github.event.ref }}"
echo "DOCKER_CLI_REF=${DOCKER_CLI_REF#refs/tags/}" >> "${GITHUB_ENV}"
working-directory: .
- name: Set Docker CLI tag from inputs
if: github.event_name == 'workflow_dispatch'
run: echo "DOCKER_CLI_REF=${{ inputs.TAG }}" >> "${GITHUB_ENV}"
working-directory: .
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@d7f5e7f509e45cec5c76c4d5afdd7de93d0b3df5 # v4.1.0
- name: Check out build scripts
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
persist-credentials: false
path: rancher-desktop-docker-cli
- name: Check out docker/cli
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
repository: docker/cli
ref: ${{ env.DOCKER_CLI_REF }}
persist-credentials: false
path: cli
# Override the build version (ignoring commits from our patches).
# The assignment is from https://github.com/docker/cli/blob/e57b5f78/scripts/build/.variables#L7
- name: Override CLI Version
run: |
VERSION=${VERSION:-$(git describe --match 'v[0-9]*' --dirty='.m' --always --tags 2>/dev/null)}
if [ -n "$VERSION" ] ; then
echo "VERSION=${VERSION#v}-rd" >> $GITHUB_ENV
fi
- name: Apply patches
run: |
set -o errexit
for patch in $(ls -1 ${GITHUB_WORKSPACE}/rancher-desktop-docker-cli/patches/*) ; do
git am "${patch}"
done
env:
GIT_AUTHOR_NAME: Rancher Desktop CI Automation
GIT_AUTHOR_EMAIL: nobody@rancherdesktop.io
GIT_COMMITTER_NAME: Rancher Desktop CI Automation
GIT_COMMITTER_EMAIL: nobody@rancherdesktop.io
- name: Build darwin amd64
uses: docker/bake-action@a66e1c87e2eca0503c343edf1d208c716d54b8a8 # v7.1.0
with:
set: binary.platform=darwin/amd64
source: cli
- name: Build darwin arm64
uses: docker/bake-action@a66e1c87e2eca0503c343edf1d208c716d54b8a8 # v7.1.0
with:
set: binary.platform=darwin/arm64
source: cli
- name: Build WSL amd64
uses: docker/bake-action@a66e1c87e2eca0503c343edf1d208c716d54b8a8 # v7.1.0
with:
set: |
binary.platform=linux/amd64
binary.args.GO_LDFLAGS=-X github.com/docker/cli/cli/config/credentials.LinuxCredentialsStoreDefaultOverride=wincred.exe
source: cli
- run: mv ./build/docker-linux-amd64 ./build/docker-wsl-amd64
- name: Build WSL arm64
uses: docker/bake-action@a66e1c87e2eca0503c343edf1d208c716d54b8a8 # v7.1.0
with:
set: |
binary.platform=linux/arm64
binary.args.GO_LDFLAGS=-X github.com/docker/cli/cli/config/credentials.LinuxCredentialsStoreDefaultOverride=wincred.exe
source: cli
- run: mv ./build/docker-linux-arm64 ./build/docker-wsl-arm64
- name: Build linux amd64
uses: docker/bake-action@a66e1c87e2eca0503c343edf1d208c716d54b8a8 # v7.1.0
with:
set: binary.platform=linux/amd64
source: cli
- name: Build linux arm64
uses: docker/bake-action@a66e1c87e2eca0503c343edf1d208c716d54b8a8 # v7.1.0
with:
set: binary.platform=linux/arm64
source: cli
- name: Build windows amd64
uses: docker/bake-action@a66e1c87e2eca0503c343edf1d208c716d54b8a8 # v7.1.0
with:
set: binary.platform=windows/amd64
source: cli
- name: Build windows arm64
uses: docker/bake-action@a66e1c87e2eca0503c343edf1d208c716d54b8a8 # v7.1.0
with:
set: binary.platform=windows/arm64
source: cli
- name: Calculate Checksums
working-directory: cli/build
run: sha256sum docker-* | tee sha256sum.txt
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
name: Upload Darwin amd64 artifact
with:
name: docker-darwin-amd64
path: cli/build/docker-darwin-amd64
if-no-files-found: error
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
name: Upload Darwin arm64 artifact
with:
name: docker-darwin-arm64
path: cli/build/docker-darwin-arm64
if-no-files-found: error
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
name: Upload Linux amd64 artifact
with:
name: docker-linux-amd64
path: cli/build/docker-linux-amd64
if-no-files-found: error
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
name: Upload Linux arm64 artifact
with:
name: docker-linux-arm64
path: cli/build/docker-linux-arm64
if-no-files-found: error
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
name: Upload Windows amd64 artifact
with:
name: docker-windows-amd64
path: cli/build/docker-windows-amd64.exe
if-no-files-found: error
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
name: Upload WSL amd64 artifact
with:
name: docker-wsl-amd64
path: cli/build/docker-wsl-amd64
if-no-files-found: error
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
name: Upload Windows arm64 artifact
with:
name: docker-windows-arm64
path: cli/build/docker-windows-arm64.exe
if-no-files-found: error
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
name: Upload WSL arm64 artifact
with:
name: docker-wsl-arm64
path: cli/build/docker-wsl-arm64
if-no-files-found: error
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
name: Upload checksums
with:
name: sha256sum.txt
path: cli/build/sha256sum.txt
if-no-files-found: error
- name: Create draft release
if: github.event_name != 'pull_request' && startsWith(github.event.ref, 'refs/tags/')
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: >-
gh release create
"${DOCKER_CLI_REF}"
./build/docker-*
./build/sha256sum.txt
--draft
--title "Docker CLI builds for docker ${{ github.ref_name }}"
--notes "Docker CLI builds for docker ${{ github.ref_name }}"
--repo "${{ github.repository }}"