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'
|
|
|
|
- '[0-9]+.[0-9]{2}'
|
|
|
|
tags:
|
|
|
|
- 'v*'
|
|
|
|
pull_request:
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
2022-08-20 09:55:20 -04:00
|
|
|
runs-on: ubuntu-20.04
|
2021-09-26 12:01:38 -04:00
|
|
|
strategy:
|
|
|
|
fail-fast: false
|
|
|
|
matrix:
|
|
|
|
target:
|
|
|
|
- cross
|
|
|
|
- dynbinary-cross
|
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
|
|
|
-
|
|
|
|
name: Run ${{ matrix.target }}
|
2022-08-20 09:55:20 -04:00
|
|
|
uses: docker/bake-action@v2
|
2021-09-26 12:01:38 -04:00
|
|
|
with:
|
|
|
|
targets: ${{ matrix.target }}
|
2021-12-09 10:37:02 -05:00
|
|
|
env:
|
|
|
|
USE_GLIBC: ${{ matrix.use_glibc }}
|
2021-09-26 12:01:38 -04:00
|
|
|
-
|
|
|
|
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
|
2021-12-09 10:37:02 -05:00
|
|
|
if [ -z "${{ matrix.use_glibc }}" ]; then
|
|
|
|
echo "ARTIFACT_NAME=${{ matrix.target }}" >> $GITHUB_ENV
|
|
|
|
else
|
|
|
|
echo "ARTIFACT_NAME=${{ matrix.target }}-glibc" >> $GITHUB_ENV
|
|
|
|
fi
|
2021-09-26 12:01:38 -04:00
|
|
|
-
|
|
|
|
name: Upload artifacts
|
2022-08-20 09:55:20 -04:00
|
|
|
uses: actions/upload-artifact@v3
|
2021-09-26 12:01:38 -04:00
|
|
|
with:
|
2021-12-09 10:37:02 -05:00
|
|
|
name: ${{ env.ARTIFACT_NAME }}
|
2021-09-26 12:01:38 -04:00
|
|
|
path: ./build/*
|
|
|
|
if-no-files-found: error
|
2021-11-17 11:18:15 -05:00
|
|
|
|
|
|
|
plugins:
|
2022-08-20 09:55:20 -04:00
|
|
|
runs-on: ubuntu-20.04
|
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
|
|
|
-
|
|
|
|
name: Build plugins
|
2022-08-20 09:55:20 -04:00
|
|
|
uses: docker/bake-action@v2
|
2021-11-17 11:18:15 -05:00
|
|
|
with:
|
|
|
|
targets: plugins-cross
|