Skip to content

Commit

Permalink
Add a workflow to automate config connector release bundle creation
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaoweim committed Feb 4, 2025
1 parent 2456040 commit f35a1c0
Show file tree
Hide file tree
Showing 4 changed files with 110 additions and 2 deletions.
37 changes: 37 additions & 0 deletions .github/workflows/release-automation.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Config Connector Release Automation

on:
pull_request:
types: [opened, synchronize, reopened]
paths-ignore:
- "**.md"
- "experiments/**"
push:
branches: ["master"]
paths-ignore:
- "**.md"
- "experiments/**"
# push:
# tags:
# - 'v*'

jobs:
run-example:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

# - name: Authenticate to Google Cloud
# uses: google-github-actions/auth@v2
# with:
# workload_identity_provider: 'projects/758705872360/locations/global/workloadIdentityPools/YOUR_POOL_ID/providers/YOUR_PROVIDER_ID'
# service_account: '[email protected]'

- name: Set up Cloud SDK
uses: google-github-actions/setup-gcloud@v1

- name: Run the create-relese-bundle script
run: |
chmod +x ./scripts/github-actions/create-release-bundle.sh
./scripts/github-actions/create-release-bundle.sh
3 changes: 1 addition & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -346,9 +346,8 @@ build-rbac-manifests:

.PHONY: build-operator-manifests
build-operator-manifests:
go run sigs.k8s.io/controller-tools/cmd/[email protected] crd paths="./operator/pkg/apis/..." output:crd:artifacts:config=operator/config/crd/bases
make -C operator docker-build
kustomize build operator/config/autopilot-manager -o config/installbundle/release-manifests/autopilot/manager.yaml
kustomize build operator/config/manager -o config/installbundle/release-manifests/standard/manager.yaml

.PHONY: push-operator-manifest
push-operator-manifest:
Expand Down
46 changes: 46 additions & 0 deletions dev/tasks/deploy-release-manifest
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
#!/usr/bin/env bash
# Copyright 2022 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

set -o errexit
set -o nounset
set -o pipefail

# runs the config-connector build across all desired systems and architectures and creates a release tarball
REPO_ROOT="$(git rev-parse --show-toplevel)"
cd ${REPO_ROOT}


BUILD_DIR="${REPO_ROOT}/.build"
mkdir -p "${BUILD_DIR}"


MANUAL_DIR="${BUILD_DIR}/manual-release"
mkdir -p "${MANUAL_DIR}/operator-system"

# build the operator manifest first
make build-operator-manifests
echo "finish build operator manifest"

kustomize build config/installbundle/release-manifests/standard -o ${MANUAL_DIR}/operator-system/configconnector-operator.yaml
echo "Added standard release manifest to ${MANUAL_DIR}/operator-system/configconnector-operator.yaml"

kustomize build config/installbundle/release-manifests/autopilot -o ${MANUAL_DIR}/operator-system/autopilot-configconnector-operator.yaml
echo "Added autopilot release manifest to ${MANUAL_DIR}/operator-system/autopilot-configconnector-operator.yaml"

# cp -rf operator/config/samples ${MANUAL_DIR}/

# tar -czvf ${BUILD_DIR}/release-bundle.tar.gz -C ${MANUAL_DIR}/ .

# echo "Generated ${BUILD_DIR}/release-bundle.tar.gz for manual installation "
26 changes: 26 additions & 0 deletions scripts/github-actions/create-release-bundle.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/bin/bash
# Copyright 2024 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

set -o errexit
set -o nounset
set -o pipefail

echo "Start creating the release bundle"

REPO_ROOT="$(git rev-parse --show-toplevel)"

# build release manifest
source ${REPO_ROOT}/dev/tasks/deploy-release-manifest

0 comments on commit f35a1c0

Please sign in to comment.