Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Workflow release #15

Merged
merged 6 commits into from
Jul 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
82 changes: 82 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
name: Release Workflow

on:
push:
tags:
- 'v*'
workflow_dispatch:

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}

jobs:
release:
name: Release
runs-on: [ self-hosted ]

permissions:
contents: read
packages: write
attestations: write
id-token: write

steps:
- uses: actions/checkout@v3

- name: Log in to the Container registry
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: set version
run: echo "version=${GITHUB_REF_NAME#v}" >> $GITHUB_OUTPUT
id: version

- name: docker build
run: VERSION=${{ steps.version.outputs.version }} make docker-build
- name: docker-push
run: VERSION=${{ steps.version.outputs.version }} make docker-push

- name: prepare release artifacts
run: VERSION=${{ steps.version.outputs.version }} make release
- name: Github release
uses: actions/create-release@v1
id: gh_release
with:
draft: false
prerelease: false
release_name: ${{ github.ref_name }}
tag_name: ${{ github.ref_name }}
body_path: RELEASE.md
env:
GITHUB_TOKEN: ${{ github.token }}
- name: upload cfapi crd
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.gh_release.outputs.upload_url }}
asset_path: ./release-${{ steps.version.outputs.version }}/cfapi-crd.yaml
asset_name: cfapi-crd.yaml
asset_content_type: yaml
- name: upload release default CR yaml
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.gh_release.outputs.upload_url }}
asset_path: ./release-${{ steps.version.outputs.version }}/cfapi-default-cr.yaml
asset_name: cfapi-default-cr.yaml
asset_content_type: yaml
- name: upload release controller yaml
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.gh_release.outputs.upload_url }}
asset_path: ./release-${{ steps.version.outputs.version }}/cfapi-manager.yaml
asset_name: cfapi-manager.yaml
asset_content_type: yaml
9 changes: 5 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
VERSION ?= 0.0.0
#IMG ?= trinity.common.repositories.cloud.sap/kyma-module/cfapi-controller-$(VERSION)
REGISTRY = ghcr.io
IMG ?= kyma-project/cfapi/cfapi-controller-$(VERSION)
IMG ?= kyma-project/cfapi/cfapi-controller

# ENVTEST_K8S_VERSION refers to the version of kubebuilder assets to be downloaded by envtest binary.
ENVTEST_K8S_VERSION = 1.24.1
Expand Down Expand Up @@ -83,13 +83,14 @@ run: manifests generate fmt vet ## Run a controller from your host.
.PHONY: docker-build
docker-build: ## Build docker image with the manager.
docker build -t ${REGISTRY}/${IMG} --build-arg TARGETARCH=amd64 .
docker tag ${REGISTRY}/${IMG} ${VERSION}

.PHONY: docker-push
docker-push: ## Push docker image with the manager.
ifneq (,$(GCR_DOCKER_PASSWORD))
docker login $(IMG_REGISTRY) -u oauth2accesstoken --password $(GCR_DOCKER_PASSWORD)
endif
docker push ${REGISTRY}/${IMG}
docker push --all-tags ${REGISTRY}/${IMG}

##@ Release
.PHONY: release
Expand All @@ -98,7 +99,7 @@ release: manifests kustomize
mkdir -p release-$(VERSION)
cp default-cr.yaml release-$(VERSION)/cfapi-default-cr.yaml
$(KUSTOMIZE) build config/crd > release-$(VERSION)/cfapi-crd.yaml
pushd config/manager && $(KUSTOMIZE) edit set image controller=${REGISRRY}/${IMG} && popd
pushd config/manager && $(KUSTOMIZE) edit set image controller=${REGISTRY}/${IMG} && popd
$(KUSTOMIZE) build config/default > release-$(VERSION)/cfapi-manager.yaml

##@ Deployment
Expand Down Expand Up @@ -139,7 +140,7 @@ system-namespace:

.PHONY: deploy
deploy: manifests kustomize ## Deploy controller to the K8s cluster specified in ~/.kube/config.
cd config/manager && $(KUSTOMIZE) edit set image controller=${IMG}
cd config/manager && $(KUSTOMIZE) edit set image controller=${REGISTRY}/${IMG}
$(KUSTOMIZE) build config/default | kubectl apply -f -

.PHONY: deploy-cr
Expand Down
Binary file removed module-data/korifi/korifi-helm-0.11.0.tar.gz
Binary file not shown.
Binary file added module-data/korifi/korifi-helm-0.11.2.tar.gz
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,21 @@ api:
authProxy:
caCert: ""
host: ""
image: trinity.common.repositories.cloud.sap/trinity/korifi-api-0.11.0@sha256:10c2b580b32155892ddbdf0b6de093a82fea60be2de4a7b0b3c9e7ac05d4523b
image: ghcr.io/kyma-project/cfapi/korifi-api-0.0.0@sha256:34311f2f3685fe7ef06c2f35d6e9801635f00f8dab2971fc519e75e1125ab2e7
include: true
infoConfig:
custom: {}
description: Korifi Cloud Foundry Environment
minCLIVersion: ""
name: korifi
recommendedCLIVersion: ""
supportAddress: https://www.cloudfoundry.org/technology/korifi/
lifecycle:
stack: cflinuxfs3
type: buildpack
logcache:
url: ""
nodeSelector: {}
replicas: 1
resources:
limits:
Expand All @@ -28,17 +36,19 @@ api:
requests:
cpu: 50m
memory: 100Mi
tolerations: []
uaaURL: ""
userCertificateExpirationWarningDuration: 168h
containerRegistryCACertSecret: null
containerRegistrySecrets:
- image-registry-credentials
- image-registry-credentials
controllers:
extraVCAPApplicationValues: {}
image: trinity.common.repositories.cloud.sap/trinity/korifi-controllers-0.11.0@sha256:e5d932ee0d447abc28a1fc9b220e2714d9c4e610f71d54f401fe1317de015b78
image: ghcr.io/kyma-project/cfapi/korifi-controllers-0.0.0@sha256:ce7c511ccbce675f5954d1ecd99bc960a710dd8f79fc9f3ff5bc40804523c0b1
maxRetainedBuildsPerApp: 5
maxRetainedPackagesPerApp: 5
namespaceLabels: {}
nodeSelector: {}
processDefaults:
diskQuotaMB: 1024
memoryMB: 1024
Expand All @@ -51,6 +61,7 @@ controllers:
cpu: 50m
memory: 100Mi
taskTTL: 30d
tolerations: []
workloadsTLSSecret: korifi-workloads-ingress-cert
debug: false
defaultAppDomainName: null
Expand Down
Loading