mirror of https://github.com/docker/cli.git
68 lines
1.4 KiB
YAML
68 lines
1.4 KiB
YAML
name: build
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
push:
|
|
branches:
|
|
- 'master'
|
|
- '[0-9]+.[0-9]{2}'
|
|
tags:
|
|
- 'v*'
|
|
pull_request:
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
target:
|
|
- cross
|
|
- dynbinary-cross
|
|
steps:
|
|
-
|
|
name: Checkout
|
|
uses: actions/checkout@v2
|
|
with:
|
|
fetch-depth: 0
|
|
-
|
|
name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v1
|
|
-
|
|
name: Run ${{ matrix.target }}
|
|
uses: docker/bake-action@v1
|
|
with:
|
|
targets: ${{ matrix.target }}
|
|
-
|
|
name: Flatten artifacts
|
|
working-directory: ./build
|
|
run: |
|
|
for dir in */; do
|
|
base=$(basename "$dir")
|
|
echo "Creating ${base}.tar.gz ..."
|
|
tar -cvzf "${base}.tar.gz" "$dir"
|
|
rm -rf "$dir"
|
|
done
|
|
-
|
|
name: Upload artifacts
|
|
uses: actions/upload-artifact@v2
|
|
with:
|
|
name: ${{ matrix.target }}
|
|
path: ./build/*
|
|
if-no-files-found: error
|
|
|
|
plugins:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
-
|
|
name: Checkout
|
|
uses: actions/checkout@v2
|
|
-
|
|
name: Set up Docker Buildx
|
|
uses: docker/setup-buildx-action@v1
|
|
-
|
|
name: Build plugins
|
|
uses: docker/bake-action@v1
|
|
with:
|
|
targets: plugins-cross
|