refactor: Update build command to use BuildStrategy (#88)

This commit is contained in:
Gerald Pinder 2024-03-01 12:18:02 -05:00 committed by GitHub
parent 5bf3dd3939
commit 0ba78fab32
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
14 changed files with 818 additions and 482 deletions

View file

@ -45,3 +45,58 @@ jobs:
if: github.repository == 'blue-build/cli'
run: earthly --ci -P ./integration-tests+all
docker-build:
timeout-minutes: 60
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
id-token: write
steps:
- name: Maximize build space
uses: ublue-os/remove-unwanted-software@v6
- uses: sigstore/cosign-installer@v3.3.0
- uses: earthly/actions-setup@v1
with:
version: v0.8.3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
install: true
- name: Earthly login
env:
EARTHLY_SAT_TOKEN: ${{ secrets.EARTHLY_SAT_TOKEN }}
if: env.EARTHLY_SAT_TOKEN != null
run: |
earthly account login --token ${{ secrets.EARTHLY_SAT_TOKEN }} >> /dev/null
earthly org s blue-build
earthly sat s blue-build-integration-tests
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.ref }}
- name: Install bluebuild
env:
BB_BUILDKIT_CACHE_GHA: true
run: |
earthly -a +install/bluebuild --BUILD_TARGET=x86_64-unknown-linux-musl /usr/local/bin/bluebuild
- name: Expose GitHub Runtime
uses: crazy-max/ghaction-github-runtime@v3
- name: Run Build
env:
BB_BUILDKIT_CACHE_GHA: "true"
GH_TOKEN: ${{ github.token }}
GH_PR_EVENT_NUMBER: ${{ github.event.number }}
run: |
cd integration-tests/test-repo
echo -n "\n\n" | cosign generate-key-pair
export COSIGN_PRIVATE_KEY=$(cat cosign.key)
rm cosign.key
bluebuild build --push -vv

View file

@ -58,3 +58,59 @@ jobs:
- name: Run integration tests
if: github.repository == 'blue-build/cli'
run: earthly --ci -P ./integration-tests+all
docker-build:
timeout-minutes: 60
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
id-token: write
steps:
- name: Maximize build space
uses: ublue-os/remove-unwanted-software@v6
- uses: sigstore/cosign-installer@v3.3.0
- uses: earthly/actions-setup@v1
with:
version: v0.8.3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
with:
install: true
- name: Earthly login
env:
EARTHLY_SAT_TOKEN: ${{ secrets.EARTHLY_SAT_TOKEN }}
if: env.EARTHLY_SAT_TOKEN != null
run: |
earthly account login --token ${{ secrets.EARTHLY_SAT_TOKEN }} >> /dev/null
earthly org s blue-build
earthly sat s blue-build-integration-tests
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.ref }}
- name: Install bluebuild
env:
BB_BUILDKIT_CACHE_GHA: true
run: |
earthly -a +install/bluebuild --BUILD_TARGET=x86_64-unknown-linux-musl /usr/local/bin/bluebuild
- name: Expose GitHub Runtime
uses: crazy-max/ghaction-github-runtime@v3
- name: Run Build
env:
BB_BUILDKIT_CACHE_GHA: "true"
GH_TOKEN: ${{ github.token }}
GH_PR_EVENT_NUMBER: ${{ github.event.number }}
run: |
cd integration-tests/test-repo
echo -n "\n\n" | cosign generate-key-pair
export COSIGN_PRIVATE_KEY=$(cat cosign.key)
rm cosign.key
bluebuild build --push -vv