Skip to content

fix default bake target #56

fix default bake target

fix default bake target #56

Workflow file for this run

name: ld
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
on:
workflow_dispatch:
push:
branches:
- 'master'
tags:
- 'v*'
paths:
- '.github/workflows/ld.yml'
- 'src/ld/**'
- 'docker-bake.hcl'
pull_request:
paths:
- '.github/workflows/ld.yml'
- 'src/ld/**'
- 'docker-bake.hcl'
env:
# needs latest for output platform-split support
BUILDKIT_IMAGE: "moby/buildkit:latest"
jobs:
binutils-targets:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.targets.outputs.matrix }}
steps:
-
name: Checkout
uses: actions/checkout@v3
-
name: Create targets matrix
id: targets
run: |
matrix=$(docker buildx bake binutils --print | jq -cr '.group.binutils.targets')
echo "matrix=${matrix}" >> ${GITHUB_OUTPUT}
-
name: Show matrix
run: |
echo ${{ steps.targets.outputs.matrix }}
binutils:
runs-on: ubuntu-latest
needs:
- binutils-targets
strategy:
fail-fast: false
matrix:
target: ${{ fromJson(needs.binutils-targets.outputs.matrix) }}
steps:
-
name: Checkout
uses: actions/checkout@v3
-
name: Set up QEMU
uses: docker/setup-qemu-action@v2
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
-
name: Build
uses: docker/bake-action@v2
with:
targets: ${{ matrix.target }}
set: |
*.cache-from=type=gha,scope=${{ matrix.target }}
*.cache-to=type=gha,scope=${{ matrix.target }}
ld64-targets:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.targets.outputs.matrix }}
steps:
-
name: Checkout
uses: actions/checkout@v3
-
name: Create targets matrix
id: targets
run: |
matrix=$(docker buildx bake ld64-static-tgz --print | jq -cr '.group."ld64-static-tgz".targets')
echo "matrix=${matrix}" >> ${GITHUB_OUTPUT}
-
name: Show matrix
run: |
echo ${{ steps.targets.outputs.matrix }}
ld64:
runs-on: ubuntu-latest
needs:
- ld64-targets
strategy:
fail-fast: false
matrix:
target: ${{ fromJson(needs.ld64-targets.outputs.matrix) }}
steps:
-
name: Checkout
uses: actions/checkout@v3
-
name: Set up QEMU
uses: docker/setup-qemu-action@v2
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
with:
driver-opts: image=${{ env.BUILDKIT_IMAGE }}
-
name: Build
uses: docker/bake-action@v2
with:
targets: ${{ matrix.target }}
set: |
*.cache-from=type=gha,scope=${{ matrix.target }}
*.cache-to=type=gha,scope=${{ matrix.target }}
*.output=type=local,dest=./dist,platform-split=false
-
name: List artifacts
run: |
tree -nh ./dist
ld-targets:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.targets.outputs.matrix }}
steps:
-
name: Checkout
uses: actions/checkout@v3
-
name: Create targets matrix
id: targets
run: |
matrix=$(docker buildx bake ld-static-tgz --print | jq -cr '.group."ld-static-tgz".targets')
echo "matrix=${matrix}" >> ${GITHUB_OUTPUT}
-
name: Show matrix
run: |
echo ${{ steps.targets.outputs.matrix }}
ld:
runs-on: ubuntu-latest
needs:
- ld-targets
strategy:
fail-fast: false
matrix:
target: ${{ fromJson(needs.ld-targets.outputs.matrix) }}
steps:
-
name: Checkout
uses: actions/checkout@v3
-
name: Set up QEMU
uses: docker/setup-qemu-action@v2
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
with:
driver-opts: image=${{ env.BUILDKIT_IMAGE }}
-
name: Build
uses: docker/bake-action@v2
with:
targets: ${{ matrix.target }}
set: |
*.cache-from=type=gha,scope=${{ matrix.target }}
*.cache-to=type=gha,scope=${{ matrix.target }}
*.output=type=local,dest=./dist,platform-split=false
-
name: List artifacts
run: |
tree -nh ./dist