Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update release to handle arm64 and amd64: #136

Merged
merged 3 commits into from
Aug 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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