Skip to content

Commit

Permalink
ci: publish to ghcr
Browse files Browse the repository at this point in the history
  • Loading branch information
Duologic committed Dec 2, 2024
1 parent fe6b3b1 commit c3c628c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
18 changes: 11 additions & 7 deletions .github/workflows/push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,16 @@ on:
default: current

env:
UPBOUND_MARKETPLACE_PUSH_ROBOT_USR: ${{ secrets.UPBOUND_MARKETPLACE_PUSH_ROBOT_USR }}
REGISTRY: ghcr.io

jobs:
build:
runs-on: ubuntu-22.04

permissions:
contents: read
packages: write

steps:
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -32,13 +37,12 @@ jobs:
version: ${{ github.event.inputs.version }}
command: -h

- name: Login to Upbound
uses: docker/login-action@v3
if: env.UPBOUND_MARKETPLACE_PUSH_ROBOT_USR != ''
- name: Log in to the GitHub Container registry
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
with:
registry: xpkg.upbound.io
username: ${{ secrets.UPBOUND_MARKETPLACE_PUSH_ROBOT_USR }}
password: ${{ secrets.UPBOUND_MARKETPLACE_PUSH_ROBOT_PSW }}
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Push xpkg
run: make push
Expand Down
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ LIBRARY_VERSION:=0.0.5
PROVIDER_VERSION:=0.21.0
JSONNET_BIN:=jrsonnet
CROSSPLANE?=crank
REGISTRY?=ghcr.io

VENDOR_DEPTHS:=$(shell find generator/vendor -type f)

Expand Down Expand Up @@ -35,7 +36,7 @@ packages=$(wildcard packages/*)
push_packages: packages $(packages)
rm -rf output && mkdir -p output/
$(foreach pkg,$(packages),$(CROSSPLANE) xpkg build --package-root=$(pkg) --package-file=output/$(patsubst packages/%,%,$(pkg)).xpkg;)
$(foreach pkg,$(packages),$(CROSSPLANE) xpkg push -f output/$(patsubst packages/%,%,$(pkg)).xpkg registry.upbound.io/grafana/$(patsubst packages/%,%,$(pkg)):$(LIBRARY_VERSION)-$(PROVIDER_VERSION);)
$(foreach pkg,$(packages),$(CROSSPLANE) xpkg push -f output/$(patsubst packages/%,%,$(pkg)).xpkg $(REGISTRY)/grafana/crossplane/$(patsubst packages/%,%,$(pkg)):$(LIBRARY_VERSION)-$(PROVIDER_VERSION);)

docs: $(shell find grafanaplane/ -type f)
@rm -rf docs/
Expand Down

0 comments on commit c3c628c

Please sign in to comment.