Skip to content

Commit

Permalink
chore: use makefile to build melange packages
Browse files Browse the repository at this point in the history
  • Loading branch information
sgalsaleh committed Nov 15, 2024
1 parent 6587d58 commit c82e09f
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 35 deletions.
16 changes: 0 additions & 16 deletions .github/actions/build-custom-melange-package/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,22 +56,6 @@ runs:
sudo apt install -y make
make melange
# TODO: the bubblewrap package available from "apt install"
# is outdated and missing newer features such as --clearenv flag,
# so instead we download the wolfi .apk and use the binary in there
- name: 'Install dependencies (bubblewrap)'
shell: bash
run: |
sudo apt install -y libcap-dev meson ninja-build
git clone https://github.com/containers/bubblewrap
pushd bubblewrap
meson --prefix=/usr -Drequire_userns=true . output
cd output
ninja
sudo ninja install
popd
rm -rf bubblewrap
- name: build melange package
shell: bash
run: |
Expand Down
19 changes: 0 additions & 19 deletions common.mk
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
SHELL := /bin/bash

ARCH ?= $(shell go env GOARCH)
CURRENT_USER := $(if $(GITHUB_USER),$(GITHUB_USER),$(shell id -u -n))

## Location to install dependencies to
LOCALBIN ?= $(shell pwd)/bin
Expand All @@ -12,22 +11,13 @@ $(LOCALBIN):
MELANGE ?= $(LOCALBIN)/melange
APKO ?= $(LOCALBIN)/apko

## Version to use for building
VERSION ?= $(shell git describe --tags --match='[0-9]*.[0-9]*.[0-9]*')

# Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set)
ifeq (,$(shell go env GOBIN))
GOBIN=$(shell go env GOPATH)/bin
else
GOBIN=$(shell go env GOBIN)
endif

image-tag = $(shell echo "$1" | sed 's/+/-/')

.PHONY: print-%
print-%:
@echo -n $($*)

.PHONY: check-env-%
check-env-%:
@ if [ "${${*}}" = "" ]; then \
Expand Down Expand Up @@ -82,15 +72,6 @@ apko-login:
login -u "${USERNAME}" \
--password "${PASSWORD}" "${REGISTRY}"

.PHONY: apko-print-pkg-version
apko-print-pkg-version: ARCHS ?= $(ARCH)
apko-print-pkg-version: apko-template check-env-PACKAGE_NAME
cd build && \
${APKO_CMD} show-packages apko.yaml --arch=${ARCHS} | \
grep ${PACKAGE_NAME} | \
cut -s -d" " -f2 | \
head -n1

.PHONY: apko-output-image
apko-output-image: check-env-IMAGE
@digest=$$(cut -s -d'@' -f2 build/digest); \
Expand Down

0 comments on commit c82e09f

Please sign in to comment.