Skip to content

Commit b4e034d

Browse files
author
Michael Lechner
committed
chore: update Makefile for Upbound registry support and remove unused icon and documentation files
1 parent a232f52 commit b4e034d

9 files changed

Lines changed: 74 additions & 50 deletions

File tree

.github/workflows/ci.yml

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,14 @@ jobs:
262262
version: ${{ env.DOCKER_BUILDX_VERSION }}
263263
install: true
264264

265+
- name: Login to Upbound
266+
uses: docker/login-action@5e57cd118135c172c3672efd75eb46360885c0ef # v3
267+
if: env.UPBOUND_MARKETPLACE_PUSH_ROBOT_USR != ''
268+
with:
269+
registry: xpkg.upbound.io
270+
username: ${{ secrets.UPBOUND_MARKETPLACE_PUSH_ROBOT_USER }}
271+
password: ${{ secrets.UPBOUND_MARKETPLACE_PUSH_ROBOT_PWD }}
272+
265273
- name: Checkout
266274
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
267275
with:
@@ -309,16 +317,6 @@ jobs:
309317
name: output
310318
path: _output/**
311319

312-
- name: Login to GitHub Container Registry
313-
if: github.ref == 'refs/heads/main'
314-
uses: docker/login-action@v3
315-
with:
316-
registry: ghcr.io
317-
username: ${{ github.actor }}
318-
password: ${{ secrets.GITHUB_TOKEN }}
319-
320-
- name: Publish to GitHub Container Registry
321-
if: github.ref == 'refs/heads/main'
322-
run: make publish.artifacts
323-
env:
324-
XPKG_REG_ORGS: ghcr.io/${{ github.repository_owner }}
320+
- name: Publish Artifacts
321+
if: env.UPBOUND_MARKETPLACE_PUSH_ROBOT_USER != ''
322+
run: make publish BRANCH_NAME=${GITHUB_REF##*/}

Makefile

Lines changed: 62 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,11 +80,71 @@ IMAGES = $(PROJECT_NAME)
8080
# ====================================================================================
8181
# Setup XPKG
8282

83-
XPKG_REG_ORGS ?= ghcr.io/onzack
84-
XPKG_REG_ORGS_NO_PROMOTE ?= ghcr.io/onzack
83+
XPKG_REG_ORGS ?= xpkg.upbound.io/onzack
84+
XPKG_REG_ORGS_NO_PROMOTE ?= xpkg.upbound.io/onzack
8585
XPKGS = $(PROJECT_NAME)
86+
87+
# Upbound authentication configuration
88+
# For robot accounts, set either:
89+
# - UP_ROBOT_USER and UP_ROBOT_PASSWORD for username/password auth
90+
# - UP_ROBOT_TOKEN for token-based auth
91+
UP_ROBOT_USER ?=
92+
UP_ROBOT_PASSWORD ?=
93+
UP_ROBOT_TOKEN ?=
94+
95+
# Map GitHub Actions secrets to UP credentials for compatibility
96+
ifdef UPBOUND_MARKETPLACE_PUSH_ROBOT_USER
97+
export UP_ROBOT_USER = $(UPBOUND_MARKETPLACE_PUSH_ROBOT_USER)
98+
endif
99+
ifdef UPBOUND_MARKETPLACE_PUSH_ROBOT_PWD
100+
export UP_ROBOT_PASSWORD = $(UPBOUND_MARKETPLACE_PUSH_ROBOT_PWD)
101+
endif
102+
ifdef UPBOUND_MARKETPLACE_PUSH_ROBOT_TOKEN
103+
export UP_ROBOT_TOKEN = $(UPBOUND_MARKETPLACE_PUSH_ROBOT_TOKEN)
104+
endif
105+
86106
-include build/makelib/xpkg.mk
87107

108+
# ====================================================================================
109+
# Upbound Publishing Overrides
110+
# Override xpkg publishing to use 'up' CLI for Upbound registries (macOS compatibility)
111+
112+
# Upbound login target
113+
.PHONY: up.login
114+
up.login:
115+
@if [ -n "$(UP_ROBOT_TOKEN)" ]; then \
116+
$(INFO) Logging in to Upbound with robot token; \
117+
echo "$(UP_ROBOT_TOKEN)" | up login --token - || $(FAIL); \
118+
$(OK) Logged in to Upbound with robot token; \
119+
elif [ -n "$(UP_ROBOT_USER)" ] && [ -n "$(UP_ROBOT_PASSWORD)" ]; then \
120+
$(INFO) Logging in to Upbound as robot user $(UP_ROBOT_USER); \
121+
echo "$(UP_ROBOT_PASSWORD)" | up login --username "$(UP_ROBOT_USER)" --password - || $(FAIL); \
122+
$(OK) Logged in to Upbound as robot user $(UP_ROBOT_USER); \
123+
elif ! up profile current > /dev/null 2>&1; then \
124+
$(ERR) Not logged in to Upbound. Please run 'up login' or set UP_ROBOT_TOKEN or UP_ROBOT_USER/UP_ROBOT_PASSWORD environment variables; \
125+
exit 1; \
126+
else \
127+
$(INFO) Already logged in to Upbound; \
128+
fi
129+
130+
# Override xpkg publish for Upbound registries to use 'up' CLI
131+
define UP_XPKG_PUBLISH
132+
xpkg.release.publish.$(1).$(2): up.login
133+
@$$(INFO) Pushing package $(1)/$(2):$$(VERSION)
134+
@for platform in $$(XPKG_LINUX_PLATFORMS); do \
135+
up xpkg push -f $$(XPKG_OUTPUT_DIR)/$$$$platform/$(2)-$$(VERSION).xpkg $(1)/$(2):$$(VERSION) 2>&1 | tee /tmp/up-push.log; \
136+
if grep -q "repository does not exist" /tmp/up-push.log; then \
137+
up xpkg push --create -f $$(XPKG_OUTPUT_DIR)/$$$$platform/$(2)-$$(VERSION).xpkg $(1)/$(2):$$(VERSION) || $$(FAIL); \
138+
elif ! grep -q "xpkg pushed" /tmp/up-push.log; then \
139+
$$(FAIL); \
140+
fi; \
141+
done
142+
@$$(OK) Pushed package $(1)/$(2):$$(VERSION)
143+
endef
144+
145+
# Apply the override for Upbound registries
146+
$(foreach r,$(filter xpkg.upbound.io%,$(XPKG_REG_ORGS)), $(foreach x,$(XPKGS),$(eval $(call UP_XPKG_PUBLISH,$(r),$(x)))))
147+
88148
# ====================================================================================
89149
# Fallthrough
90150

extensions/icons/USAGE.md

Lines changed: 0 additions & 9 deletions
This file was deleted.

extensions/icons/icon.svg

Whitespace-only changes.

extensions/readme/USAGE.md

Lines changed: 0 additions & 10 deletions
This file was deleted.

extensions/readme/readme.md

Whitespace-only changes.

extensions/release-notes/USAGE.md

Lines changed: 0 additions & 8 deletions
This file was deleted.

extensions/release-notes/release_notes.md

Whitespace-only changes.

package/crossplane.yaml

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,4 @@ metadata:
99
meta.crossplane.io/description: |
1010
Crossplane provider for cloudscale.ch infrastructure
1111
meta.crossplane.io/readme: |
12-
This provider enables provisioning of cloudscale.ch resources via Crossplane.
13-
14-
Resources include: servers, volumes, networks, subnets, load balancers, floating IPs, and more.
15-
spec:
16-
controller:
17-
image: ghcr.io/onzack/provider-cloudscale
18-
crossplane:
19-
version: ">=v2.0.0"
12+
This provider enables provisioning of cloudscale.ch resources via Crossplane. https://www.cloudscale.ch/en/api/v1

0 commit comments

Comments
 (0)