Skip to content

Commit

Permalink
download arm64 binaries on aarch64, not amd64 ones
Browse files Browse the repository at this point in the history
In the arm64 github action, always do a full 'make'.  At least we need
the 'make dep' to fetch zot, as trust depends on that.

Signed-off-by: Serge Hallyn <[email protected]>
  • Loading branch information
hallyn committed Sep 7, 2023
1 parent 4540f84 commit 5ede914
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ jobs:
install: |
apt-get -y update;
apt-get install -q -y git golang-go;
apt-get install -y bats golang make openssl swtpm tpm2-tools \
apt-get install -y bats curl golang make openssl swtpm tpm2-tools \
libcryptsetup-dev libgpgme-dev libcap-dev qemu-kvm \
libdevmapper-dev libacl1-dev libarchive-tools pip python3-yaml \
sbsigntool squashfs-tools wget
Expand All @@ -169,7 +169,7 @@ jobs:
pwd
git describe --always --dirty
go version
make trust
make
make test-trust
- name: Rename Binary
run: |
Expand Down
15 changes: 12 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,15 @@ TOPDIR := $(shell git rev-parse --show-toplevel)
BOOTKIT_VERSION ?= "v0.0.15.230901"
ROOTFS_VERSION = $(BOOTKIT_VERSION)

archout = $(shell arch)
ifeq ("$(archout)", "aarch64")
arch = arm64
else ifeq ("$(archout)", "x86_64")
arch = amd64
else
#error "Unsupported architecture: $(archout)"
endif

MAIN_VERSION ?= $(shell git describe --always --dirty || echo no-git)
ifeq ($(MAIN_VERSION),$(filter $(MAIN_VERSION), "", no-git))
$(error "Bad value for MAIN_VERSION: '$(MAIN_VERSION)'")
Expand All @@ -38,18 +47,18 @@ trust: .made-gofmt $(GO_SRC)

$(ZOT):
mkdir -p $(TOOLSDIR)/bin
curl -Lo $(ZOT) https://github.com/project-zot/zot/releases/download/v$(ZOT_VERSION)/zot-linux-amd64-minimal
curl -Lo $(ZOT) https://github.com/project-zot/zot/releases/download/v$(ZOT_VERSION)/zot-linux-${arch}-minimal
chmod +x $(ZOT)

$(ORAS):
mkdir -p $(TOOLSDIR)/bin
curl -Lo oras.tar.gz https://github.com/oras-project/oras/releases/download/v$(ORAS_VERSION)/oras_$(ORAS_VERSION)_linux_amd64.tar.gz
curl -Lo oras.tar.gz https://github.com/oras-project/oras/releases/download/v$(ORAS_VERSION)/oras_$(ORAS_VERSION)_linux_$(arch).tar.gz
tar xvzf oras.tar.gz -C $(TOOLSDIR)/bin oras
rm oras.tar.gz

$(REGCTL):
mkdir -p $(TOOLSDIR)/bin
curl -Lo $(REGCTL) https://github.com/regclient/regclient/releases/download/v$(REGCTL_VERSION)/regctl-linux-amd64
curl -Lo $(REGCTL) https://github.com/regclient/regclient/releases/download/v$(REGCTL_VERSION)/regctl-linux-$(arch)
chmod +x $(REGCTL)

.PHONY: gofmt
Expand Down

0 comments on commit 5ede914

Please sign in to comment.