Skip to content

Commit

Permalink
feat: add missing pushing components on release (#522)
Browse files Browse the repository at this point in the history
## Description

<!-- 
Please do not leave this blank 
This PR [adds/removes/fixes/replaces] the [feature/bug/etc]. 
-->

Please include a summary of the changes and the related issue. Please
also include relevant motivation and context. List any dependencies that
are required for this change.


## What type of PR is this? (check all applicable)

- [ ] 🍕 Feature
- [ ] 🐛 Bug Fix
- [ ] 📝 Documentation Update
- [ ] 🎨 Style
- [ ] 🧑‍💻 Code Refactor
- [ ] 🔥 Performance Improvements
- [ ] ✅ Test
- [ ] 🤖 Build
- [ ] 🔁 CI
- [ ] 📦 Chore (Release)
- [ ] ⏩ Revert

## Related Tickets & Documents

<!-- 
Please use this format link issue numbers: Fixes #123

https://docs.github.com/en/free-pro-team@latest/github/managing-your-work-on-github/linking-a-pull-request-to-an-issue#linking-a-pull-request-to-an-issue-using-a-keyword
-->
- Related Issue # (issue)
- Closes # (issue)
- Fixes # (issue)
> Remove if not applicable

## Screenshots

<!-- Visual changes require screenshots -->


## Added tests?

- [ ] 👍 yes
- [ ] 🙅 no, because they aren't needed
- [ ] 🙋 no, because I need help
- [ ] Separate ticket for tests # (issue/pr)

Please describe the tests that you ran to verify your changes. Provide
instructions so we can reproduce. Please also list any relevant details
for your test configuration


## Added to documentation?

- [ ] 📜 README.md
- [ ] 🙅 no documentation needed

## Checklist:

- [ ] My code follows the style guidelines of this project
- [ ] I have performed a self-review of my code
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes to the documentation
- [ ] My changes generate no new warnings
- [ ] I have added tests that prove my fix is effective or that my
feature works
- [ ] New and existing unit tests pass locally with my changes
- [ ] Any dependent changes have been merged and published in downstream
modules
  • Loading branch information
Skarlso authored Oct 3, 2024
1 parent 750e6ab commit 4b72cdc
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 1 deletion.
11 changes: 11 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@ jobs:
permissions:
contents: read
pull-requests: 'read'
components:
name: Component CTF Builds
uses: ./.github/workflows/components.yaml
permissions:
contents: read
pull-requests: read
release:
needs: tests
name: Trigger release build
Expand Down Expand Up @@ -114,3 +120,8 @@ jobs:
helm registry login ghcr.io -u open-component-model -p ${{ secrets.GITHUB_TOKEN }}
helm package --version ${{ env.RELEASE_VERSION }} --app-version ${{ env.RELEASE_VERSION }} ./deploy
helm push ${{ github.event.repository.name }}-${{ env.RELEASE_VERSION }}.tgz oci://ghcr.io/open-component-model/helm
- name: Push OCM Components
env:
GITHUBORG: ${{ github.repository_owner }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: make plain-push
24 changes: 23 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,13 @@
IMG ?= ghcr.io/open-component-model/ocm-controller
TAG ?= v0.11.0
# ENVTEST_K8S_VERSION refers to the version of kubebuilder assets to be downloaded by envtest binary.
GITHUBORG ?= open-component-model
OCMREPO ?= ghcr.io/$(GITHUBORG)/ocm-controller
ENVTEST_K8S_VERSION = 1.24.1

OCM_CLI_VERSION ?= 0.15.0
REPO_ROOT := $(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
PLATFORM_OS := $(shell go env GOOS)
PLATFORM_ARCH := $(shell go env GOARCH)
GOTESTSUM ?= $(LOCALBIN)/gotestsum
MKCERT ?= $(LOCALBIN)/mkcert
UNAME ?= $(shell uname|tr '[:upper:]' '[:lower:]')
Expand Down Expand Up @@ -35,6 +40,14 @@ GO_WASM_BUILD = tinygo build -target=wasi -panic=trap -scheduler=none -no-debug
.PHONY: all
all: build

CREDS ?=
OCM ?= $(LOCALBIN)/ocm $(CREDS)

.PHONY: ocm
ocm: $(OCM)
$(OCM): $(LOCALBIN)
curl -L "https://github.com/open-component-model/ocm/releases/download/v$(OCM_CLI_VERSION)/ocm-$(OCM_CLI_VERSION)-$(PLATFORM_OS)-$(PLATFORM_ARCH).tar.gz" | tar -xz -C $(LOCALBIN)

##@ General

# The help target prints out all targets with their descriptions organized
Expand Down Expand Up @@ -148,6 +161,15 @@ dev-deploy: kustomize ## Deploy controller dev image in the configured Kubernete
undeploy: ## Undeploy controller from the K8s cluster specified in ~/.kube/config. Call with ignore-not-found=true to ignore resource not found errors during deletion.
$(KUSTOMIZE) build config/default | kubectl delete --ignore-not-found=$(ignore-not-found) -f -


##@ Component

GEN ?= $(REPO_ROOT)/gen

.PHONY: plain-push
plain-push: ocm $(GEN)
$(OCM) transfer ctf -f $(GEN)/component/ctf $(OCMREPO)

##@ Documentation

api-docs: gen-crd-api-reference-docs ## Generate API reference documentation
Expand Down

0 comments on commit 4b72cdc

Please sign in to comment.