|
|
|
name: build
|
|
|
|
|
|
|
|
on:
|
|
|
|
workflow_dispatch:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- 'master'
|
|
|
|
- 'v[0-9]*'
|
|
|
|
tags:
|
|
|
|
- 'v*'
|
|
|
|
pull_request:
|
|
|
|
branches:
|
|
|
|
- 'master'
|
|
|
|
- 'v[0-9]*'
|
|
|
|
|
|
|
|
env:
|
|
|
|
REPO_SLUG: "docker/buildx-bin"
|
|
|
|
RELEASE_OUT: "./release-out"
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
-
|
|
|
|
name: Checkout
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
-
|
|
|
|
name: Set up QEMU
|
|
|
|
uses: docker/setup-qemu-action@v1
|
|
|
|
-
|
|
|
|
name: Set up Docker Buildx
|
|
|
|
uses: docker/setup-buildx-action@v1
|
|
|
|
with:
|
|
|
|
version: latest
|
|
|
|
-
|
|
|
|
name: Test
|
|
|
|
run: |
|
|
|
|
make test
|
|
|
|
-
|
|
|
|
name: Send to Codecov
|
|
|
|
uses: codecov/codecov-action@v2
|
|
|
|
with:
|
|
|
|
file: ./coverage/coverage.txt
|
|
|
|
-
|
|
|
|
name: Build binaries
|
|
|
|
run: |
|
|
|
|
make release
|
|
|
|
-
|
|
|
|
name: Upload artifacts
|
|
|
|
uses: actions/upload-artifact@v2
|
|
|
|
with:
|
|
|
|
name: buildx
|
|
|
|
path: ${{ env.RELEASE_OUT }}/*
|
|
|
|
if-no-files-found: error
|
|
|
|
-
|
|
|
|
name: Docker meta
|
|
|
|
id: meta
|
|
|
|
uses: docker/metadata-action@v3
|
|
|
|
with:
|
|
|
|
images: |
|
|
|
|
${{ env.REPO_SLUG }}
|
|
|
|
tags: |
|
|
|
|
type=ref,event=branch
|
|
|
|
type=ref,event=pr
|
|
|
|
type=semver,pattern={{version}}
|
|
|
|
bake-target: meta-helper
|
|
|
|
-
|
|
|
|
name: Login to DockerHub
|
|
|
|
if: github.event_name != 'pull_request'
|
|
|
|
uses: docker/login-action@v1
|
|
|
|
with:
|
|
|
|
username: ${{ secrets.DOCKERHUB_USERNAME }}
|
|
|
|
password: ${{ secrets.DOCKERHUB_TOKEN }}
|
|
|
|
-
|
|
|
|
name: Build and push image
|
|
|
|
uses: docker/bake-action@v1
|
|
|
|
with:
|
|
|
|
files: |
|
|
|
|
./docker-bake.hcl
|
|
|
|
${{ steps.meta.outputs.bake-file }}
|
|
|
|
targets: image-cross
|
|
|
|
push: ${{ github.event_name != 'pull_request' }}
|
|
|
|
-
|
|
|
|
name: GitHub Release
|
|
|
|
if: startsWith(github.ref, 'refs/tags/v')
|
|
|
|
uses: softprops/action-gh-release@v1
|
|
|
|
env:
|
|
|
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
|
|
with:
|
|
|
|
draft: true
|
|
|
|
files: ${{ env.RELEASE_OUT }}/*
|
|
|
|
|
|
|
|
buildkit-edge:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
continue-on-error: true
|
|
|
|
steps:
|
|
|
|
-
|
|
|
|
name: Checkout
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
-
|
|
|
|
name: Set up QEMU
|
|
|
|
uses: docker/setup-qemu-action@v1
|
|
|
|
-
|
|
|
|
name: Set up Docker Buildx
|
|
|
|
uses: docker/setup-buildx-action@v1
|
|
|
|
with:
|
|
|
|
version: latest
|
|
|
|
driver-opts: image=moby/buildkit:master
|
|
|
|
buildkitd-flags: --debug
|
|
|
|
-
|
|
|
|
# Just run a bake target to check eveything runs fine
|
|
|
|
name: Build
|
|
|
|
uses: docker/bake-action@v1
|
|
|
|
with:
|
|
|
|
targets: binaries-cross
|