Skip to content

Commit

Permalink
update workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
cbarbian-sap committed Dec 30, 2024
1 parent f7d4a5d commit c837d2a
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 2 deletions.
13 changes: 11 additions & 2 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -181,9 +181,18 @@ jobs:
- name: Install Helm chart and deploy sample component
run: |
if [ -f examples/setup.yaml ]; then
# TODO: move this to an extra step
kubectl apply --server-side --field-manager integration-test --force-conflicts -f examples/setup.yaml
sleep 5
fi
if [ -f $CHART_DIRECTORY/.setup.yaml ]; then
kubectl apply --server-side --field-manager integration-test --force-conflicts-f $CHART_DIRECTORY/.setup.yaml
sleep 5
fi
release_name=$(yq .name $CHART_DIRECTORY/Chart.yaml)
kubectl create ns cop-system
helm -n cop-system upgrade -i $release_name --wait --timeout 5m \
kubectl create ns component-operator-system
helm -n component-operator-system upgrade -i $release_name --wait --timeout 5m \
--set image.repository=${{ needs.build-docker.outputs.image-repository }} \
--set image.tag=${{ needs.build-docker.outputs.image-tag }} \
$CHART_DIRECTORY
Expand Down
49 changes: 49 additions & 0 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ on:
concurrency: release-${{ github.event.release.tag_name }}

env:
HELM_VERSION: v3.11.3
REGCTL_VERSION: v0.4.8
REGISTRY: ghcr.io
CHART_DIRECTORY: chart
Expand All @@ -16,6 +17,21 @@ defaults:
shell: bash

jobs:
publish-go-module:
name: Publish go module
runs-on: ubuntu-24.04

steps:
- name: Trigger registration on sum.golang.org
run: |
repository=${{ github.repository }}
tag=${{ github.event.release.tag_name }}
curl -sSf \
--max-time 30 \
--retry 5 \
--retry-max-time 300 \
https://sum.golang.org/lookup/github.com/${repository,,}@${tag}
validate:
name: Run validations
runs-on: ubuntu-24.04
Expand Down Expand Up @@ -138,3 +154,36 @@ jobs:
repository=$REGISTRY/${{ github.repository }}/crds
tar cvz * | regctl artifact put -m application/gzip ${repository,,}:${{ github.event.release.tag_name }}
publish-chart:
name: Publish chart to github packages
runs-on: ubuntu-24.04
needs: validate
permissions:
contents: read
packages: write

steps:
- name: Checkout repository
uses: actions/checkout@v4

- uses: azure/setup-helm@v4
with:
version: ${{ env.HELM_VERSION }}

- name: Create package
run: |
chart_version=$(yq .version $CHART_DIRECTORY/Chart.yaml)
helm package --version $chart_version $CHART_DIRECTORY
- name: Login to the OCI registry
run: |
helm --registry-config $RUNNER_TEMP/helm-config.json registry login $REGISTRY -u ${{ github.actor }} --password-stdin <<< ${{ github.token }}
- name: Upload package
run: |
chart_name=$(yq .name $CHART_DIRECTORY/Chart.yaml)
chart_version=$(yq .version $CHART_DIRECTORY/Chart.yaml)
file=$chart_name-$chart_version.tgz
repository=$REGISTRY/${{ github.repository }}/charts
helm --registry-config $RUNNER_TEMP/helm-config.json push $file oci://${repository,,}

0 comments on commit c837d2a

Please sign in to comment.