feat: Add platform arg to force building a specific architecture

This commit is contained in:
Gerald Pinder 2024-09-29 17:00:37 -04:00
parent 20d1950530
commit 75eae89e4a
22 changed files with 408 additions and 71 deletions

View file

@ -258,6 +258,58 @@ jobs:
grep -q 'ARG IMAGE_REGISTRY=ghcr.io/blue-build' Containerfile || exit 1
bluebuild build --retry-push -B docker -I docker -S sigstore --push -vv recipes/recipe.yml recipes/recipe-39.yml
arm64-build:
timeout-minutes: 60
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
id-token: write
needs:
- build
if: needs.build.outputs.push == 'true'
steps:
- name: Maximize build space
uses: ublue-os/remove-unwanted-software@v6
- uses: sigstore/cosign-installer@v3.3.0
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
install: true
- uses: actions-rust-lang/setup-rust-toolchain@v1
- uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{github.event.pull_request.head.ref}}
repository: ${{github.event.pull_request.head.repo.full_name}}
- name: Install bluebuild
run: |
cargo install --path . --debug --all-features
- name: Expose GitHub Runtime
uses: crazy-max/ghaction-github-runtime@v3
- name: Run Build
env:
GH_TOKEN: ${{ github.token }}
GH_PR_EVENT_NUMBER: ${{ github.event.number }}
COSIGN_PRIVATE_KEY: ${{ secrets.TEST_SIGNING_SECRET }}
BB_BUILDKIT_CACHE_GHA: true
run: |
cd integration-tests/test-repo
bluebuild build \
--retry-push \
--platform linux/arm64 \
--push \
-vv \
recipes/recipe-arm64.yml
docker-build-external-login:
timeout-minutes: 60
runs-on: ubuntu-latest

View file

@ -256,6 +256,58 @@ jobs:
grep -q 'ARG IMAGE_REGISTRY=ghcr.io/blue-build' Containerfile || exit 1
bluebuild build --retry-push -B docker -I docker -S sigstore --push -vv recipes/recipe.yml recipes/recipe-39.yml
arm64-build:
timeout-minutes: 60
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
id-token: write
if: github.repository == 'blue-build/cli'
needs:
- build
steps:
- name: Maximize build space
uses: ublue-os/remove-unwanted-software@v6
- uses: sigstore/cosign-installer@v3.3.0
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
install: true
- uses: actions-rust-lang/setup-rust-toolchain@v1
- uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{github.event.pull_request.head.ref}}
repository: ${{github.event.pull_request.head.repo.full_name}}
- name: Install bluebuild
run: |
cargo install --path . --debug --all-features
- name: Expose GitHub Runtime
uses: crazy-max/ghaction-github-runtime@v3
- name: Run Build
env:
GH_TOKEN: ${{ github.token }}
GH_PR_EVENT_NUMBER: ${{ github.event.number }}
COSIGN_PRIVATE_KEY: ${{ secrets.TEST_SIGNING_SECRET }}
BB_BUILDKIT_CACHE_GHA: true
run: |
cd integration-tests/test-repo
bluebuild build \
--retry-push \
--platform linux/arm64 \
--push \
-vv \
recipes/recipe-arm64.yml
docker-build-external-login:
timeout-minutes: 60
runs-on: ubuntu-latest