2021-09-26 12:01:38 -04:00
|
|
|
name: build
|
|
|
|
|
2022-08-18 14:03:28 -04:00
|
|
|
concurrency:
|
|
|
|
group: ${{ github.workflow }}-${{ github.ref }}
|
|
|
|
cancel-in-progress: true
|
|
|
|
|
2021-09-26 12:01:38 -04:00
|
|
|
on:
|
|
|
|
workflow_dispatch:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- 'master'
|
2023-02-09 12:03:11 -05:00
|
|
|
- '[0-9]+.[0-9]+'
|
2021-09-26 12:01:38 -04:00
|
|
|
tags:
|
|
|
|
- 'v*'
|
|
|
|
pull_request:
|
|
|
|
|
|
|
|
jobs:
|
2023-03-27 22:22:16 -04:00
|
|
|
prepare:
|
|
|
|
runs-on: ubuntu-20.04
|
|
|
|
outputs:
|
|
|
|
matrix: ${{ steps.platforms.outputs.matrix }}
|
|
|
|
steps:
|
|
|
|
-
|
|
|
|
name: Checkout
|
|
|
|
uses: actions/checkout@v3
|
|
|
|
-
|
|
|
|
name: Create matrix
|
|
|
|
id: platforms
|
|
|
|
run: |
|
|
|
|
echo "matrix=$(docker buildx bake cross --print | jq -cr '.target."cross".platforms')" >>${GITHUB_OUTPUT}
|
|
|
|
-
|
|
|
|
name: Show matrix
|
|
|
|
run: |
|
|
|
|
echo ${{ steps.platforms.outputs.matrix }}
|
|
|
|
|
2021-09-26 12:01:38 -04:00
|
|
|
build:
|
2022-08-20 09:55:20 -04:00
|
|
|
runs-on: ubuntu-20.04
|
2023-03-27 22:22:16 -04:00
|
|
|
needs:
|
|
|
|
- prepare
|
2021-09-26 12:01:38 -04:00
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
|
|
|
target:
|
2023-03-27 22:22:16 -04:00
|
|
|
- binary
|
|
|
|
- dynbinary
|
|
|
|
platform: ${{ fromJson(needs.prepare.outputs.matrix) }}
|
2021-12-09 10:37:02 -05:00
|
|
|
use_glibc:
|
|
|
|
- ""
|
|
|
|
- glibc
|
2021-09-26 12:01:38 -04:00
|
|
|
steps:
|
|
|
|
-
|
|
|
|
name: Checkout
|
2022-08-20 09:55:20 -04:00
|
|
|
uses: actions/checkout@v3
|
2021-10-11 14:01:46 -04:00
|
|
|
with:
|
|
|
|
fetch-depth: 0
|
2021-09-26 12:01:38 -04:00
|
|
|
-
|
|
|
|
name: Set up Docker Buildx
|
2022-08-20 09:55:20 -04:00
|
|
|
uses: docker/setup-buildx-action@v2
|
2021-09-26 12:01:38 -04:00
|
|
|
-
|
2023-03-27 22:22:16 -04:00
|
|
|
name: Build
|
2023-04-18 05:03:03 -04:00
|
|
|
uses: docker/bake-action@v3
|
2021-09-26 12:01:38 -04:00
|
|
|
with:
|
|
|
|
targets: ${{ matrix.target }}
|
2023-03-27 22:22:16 -04:00
|
|
|
set: |
|
|
|
|
*.platform=${{ matrix.platform }}
|
2021-12-09 10:37:02 -05:00
|
|
|
env:
|
|
|
|
USE_GLIBC: ${{ matrix.use_glibc }}
|
2021-09-26 12:01:38 -04:00
|
|
|
-
|
2023-03-27 22:22:16 -04:00
|
|
|
name: Create tarball
|
2021-09-26 12:01:38 -04:00
|
|
|
working-directory: ./build
|
|
|
|
run: |
|
2023-03-27 22:22:16 -04:00
|
|
|
mkdir /tmp/out
|
|
|
|
platform=${{ matrix.platform }}
|
|
|
|
platformPair=${platform//\//-}
|
|
|
|
tar -cvzf "/tmp/out/docker-${platformPair}.tar.gz" .
|
2021-12-09 10:37:02 -05:00
|
|
|
if [ -z "${{ matrix.use_glibc }}" ]; then
|
2024-05-30 09:53:25 -04:00
|
|
|
echo "ARTIFACT_NAME=${{ matrix.target }}-${platformPair}" >> $GITHUB_ENV
|
2021-12-09 10:37:02 -05:00
|
|
|
else
|
2024-05-30 09:53:25 -04:00
|
|
|
echo "ARTIFACT_NAME=${{ matrix.target }}-${platformPair}-glibc" >> $GITHUB_ENV
|
2021-12-09 10:37:02 -05:00
|
|
|
fi
|
2021-09-26 12:01:38 -04:00
|
|
|
-
|
|
|
|
name: Upload artifacts
|
2024-05-30 09:53:25 -04:00
|
|
|
uses: actions/upload-artifact@v4
|
2021-09-26 12:01:38 -04:00
|
|
|
with:
|
2021-12-09 10:37:02 -05:00
|
|
|
name: ${{ env.ARTIFACT_NAME }}
|
2023-03-27 22:22:16 -04:00
|
|
|
path: /tmp/out/*
|
2021-09-26 12:01:38 -04:00
|
|
|
if-no-files-found: error
|
2021-11-17 11:18:15 -05:00
|
|
|
|
2023-03-27 22:22:16 -04:00
|
|
|
prepare-plugins:
|
|
|
|
runs-on: ubuntu-20.04
|
|
|
|
outputs:
|
|
|
|
matrix: ${{ steps.platforms.outputs.matrix }}
|
|
|
|
steps:
|
|
|
|
-
|
|
|
|
name: Checkout
|
|
|
|
uses: actions/checkout@v3
|
|
|
|
-
|
|
|
|
name: Create matrix
|
|
|
|
id: platforms
|
|
|
|
run: |
|
|
|
|
echo "matrix=$(docker buildx bake plugins-cross --print | jq -cr '.target."plugins-cross".platforms')" >>${GITHUB_OUTPUT}
|
|
|
|
-
|
|
|
|
name: Show matrix
|
|
|
|
run: |
|
|
|
|
echo ${{ steps.platforms.outputs.matrix }}
|
|
|
|
|
2021-11-17 11:18:15 -05:00
|
|
|
plugins:
|
2022-08-20 09:55:20 -04:00
|
|
|
runs-on: ubuntu-20.04
|
2023-03-27 22:22:16 -04:00
|
|
|
needs:
|
|
|
|
- prepare-plugins
|
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
|
|
|
platform: ${{ fromJson(needs.prepare-plugins.outputs.matrix) }}
|
2021-11-17 11:18:15 -05:00
|
|
|
steps:
|
|
|
|
-
|
|
|
|
name: Checkout
|
2022-08-20 09:55:20 -04:00
|
|
|
uses: actions/checkout@v3
|
2021-11-17 11:18:15 -05:00
|
|
|
-
|
|
|
|
name: Set up Docker Buildx
|
2022-08-20 09:55:20 -04:00
|
|
|
uses: docker/setup-buildx-action@v2
|
2021-11-17 11:18:15 -05:00
|
|
|
-
|
2023-03-27 22:22:16 -04:00
|
|
|
name: Build
|
2023-04-18 05:03:03 -04:00
|
|
|
uses: docker/bake-action@v3
|
2021-11-17 11:18:15 -05:00
|
|
|
with:
|
|
|
|
targets: plugins-cross
|
2023-03-27 22:22:16 -04:00
|
|
|
set: |
|
|
|
|
*.platform=${{ matrix.platform }}
|