Skip to content

Commit

Permalink
Merge pull request #136 from jacobweinstock/build-arm64
Browse files Browse the repository at this point in the history
Update release to handle arm64 and amd64:

## Description

<!--- Please describe what this PR is going to change -->
This gets both arch images push to quay.io

## Why is this needed

<!--- Link to issue you have raised -->

Fixes: #

## How Has This Been Tested?
<!--- Please describe in detail how you tested your changes. -->
<!--- Include details of your testing environment, and the tests you ran to -->
<!--- see how your change affects other areas of the code, etc. -->


## How are existing users impacted? What migration steps/scripts do we need?

<!--- Fixes a bug, unblocks installation, removes a component of the stack etc -->
<!--- Requires a DB migration script, etc. -->


## Checklist:

I have:

- [ ] updated the documentation and/or roadmap (if required)
- [ ] added unit or e2e tests
- [ ] provided instructions on how to upgrade
  • Loading branch information
jacobweinstock authored Aug 20, 2024
2 parents c5bde80 + f384c1e commit 010f549
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 9 deletions.
32 changes: 23 additions & 9 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,35 @@ on:
branches:
- "main"
workflow_dispatch: {}

env:
REGISTRY: quay.io

jobs:
build:
name: Build
runs-on: ubuntu-latest
strategy:
matrix:
platform: [amd64]
steps:
- uses: actions/checkout@v4

- name: Build linux/${{ matrix.platform }}
run: make images -j $(nproc) GOOS=linux GOARCH=${{ matrix.platform }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to Quay.io
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ secrets.QUAY_USERNAME }}
password: ${{ secrets.QUAY_PASSWORD }}

- name: Prepare Release
run: make prepare-release

- name: Login to quay.io
run: docker login -u ${{ secrets.QUAY_USERNAME }} -p ${{ secrets.QUAY_PASSWORD }} quay.io
- name: Run Release
run: make release -j $(nprox)

- name: Push linux/${{ matrix.platform }}
run: make push -j $(nprox)
- name: Clean up Release
run: make clean-release
15 changes: 15 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,19 @@ formatters: $(toolBins)
git ls-files '*.go' | xargs -I% sh -c 'sed -i "/^import (/,/^)/ { /^\s*$$/ d }" % && bin/gofumpt -w %'
git ls-files '*.go' | xargs -I% bin/goimports -w %

prepare-release:
docker buildx create --name tinkerbell-multiarch --use --driver docker-container || true

clean-release:
docker buildx rm tinkerbell-multiarch || true

.PHONY: release
release: ## Push all action images.
release: $(addprefix release-,$(ACTIONS))

.PHONY: release-%
release-%: ## Release an actions. x86_64 and arm64.
IMAGE_NAME=$(CONTAINER_REPOSITORY)/$*
docker buildx build --platform linux/amd64,linux/arm64 --push -t $$IMAGE_NAME:$(GIT_COMMIT) -t $$IMAGE_NAME:latest -f ./$*/Dockerfile .

include Lint.mk

0 comments on commit 010f549

Please sign in to comment.