Skip to content

Commit

Permalink
Merge pull request #24 from vshn/fix/release
Browse files Browse the repository at this point in the history
Fixes for make targets concerning the release flow
  • Loading branch information
Kidswiss authored Sep 8, 2023
2 parents d7b41bd + c77c26d commit 0d641c7
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ jobs:
${{ runner.os }}-go-
- name: Run build
run: make build
run: make build -e IMG_TAG=${GITHUB_REF##*/}
13 changes: 7 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,13 @@ jobs:
restore-keys: |
${{ runner.os }}-go-
- name: Login to Upbound
uses: docker/login-action@v2
with:
registry: xpkg.upbound.io
username: ${{ secrets.UPBOUND_MARKETPLACE_PUSH_ROBOT_USR }}
password: ${{ secrets.UPBOUND_MARKETPLACE_PUSH_ROBOT_PSW }}
# We currently don't have upbound credentials for this repo
# - name: Login to Upbound
# uses: docker/login-action@v2
# with:
# registry: xpkg.upbound.io
# username: ${{ secrets.UPBOUND_MARKETPLACE_PUSH_ROBOT_USR }}
# password: ${{ secrets.UPBOUND_MARKETPLACE_PUSH_ROBOT_PSW }}

- name: Login to ghcr.io
uses: docker/login-action@v2
Expand Down
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ build-bin: fmt vet ## Build binary

.PHONY: build-docker
build-docker: build-bin ## Build docker image
env CGO_ENABLED=0 GOOS=linux GOARCH=amd64 \
go build -o ${BIN_FILENAME}
$(DOCKER_CMD) build -t $(CONTAINER_IMG) .

.PHONY: test
Expand Down
3 changes: 2 additions & 1 deletion Makefile.vars.mk
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ DOCKER_CMD ?= docker
CONTAINER_REGISTRY ?= ghcr.io
UPBOUND_CONTAINER_REGISTRY ?= xpkg.upbound.io

IMG_TAG ?= latest
GIT_TAG = $(shell git symbolic-ref -q --short HEAD || git describe --tags --exact-match)
IMG_TAG = $(subst /,_,$(GIT_TAG))
# Image URL to use all building/pushing image targets
CONTAINER_IMG ?= $(CONTAINER_REGISTRY)/$(PROJECT_OWNER)/$(PROJECT_NAME)/controller:$(IMG_TAG)
LOCAL_PACKAGE_IMG = localhost:5000/$(PROJECT_OWNER)/$(PROJECT_NAME)/package:$(IMG_TAG)
Expand Down
2 changes: 1 addition & 1 deletion package/package.mk
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ package-provider-local: $(crossplane_bin) generate ## Build Crossplane package f

.PHONY: package-provider
package-provider: export CONTROLLER_IMG = $(CONTAINER_IMG)
package-provider: $(up_bin) generate-go build-docker ## Build Crossplane package for Upbound Marketplace
package-provider: $(up_bin) generate build-docker ## Build Crossplane package for Upbound Marketplace
@rm -rf package/*.xpkg
@yq e 'del(.spec)' $(package_dir)/crossplane.yaml.template > $(package_dir)/crossplane.yaml
$(up_bin) xpkg build -f $(package_dir) -o $(package_dir)/provider-minio.xpkg --controller=$(CONTROLLER_IMG)
Expand Down

0 comments on commit 0d641c7

Please sign in to comment.