Skip to content

Commit ddda1df

Browse files
committed
update workflows
1 parent 4cae1de commit ddda1df

File tree

2 files changed

+60
-2
lines changed

2 files changed

+60
-2
lines changed

.github/workflows/build.yaml

+11-2
Original file line numberDiff line numberDiff line change
@@ -181,9 +181,18 @@ jobs:
181181
182182
- name: Install Helm chart and deploy sample component
183183
run: |
184+
if [ -f examples/setup.yaml ]; then
185+
# TODO: move this to an extra step
186+
kubectl apply --server-side --field-manager integration-test --force-conflicts -f examples/setup.yaml
187+
sleep 5
188+
fi
189+
if [ -f $CHART_DIRECTORY/.setup.yaml ]; then
190+
kubectl apply --server-side --field-manager integration-test --force-conflicts-f $CHART_DIRECTORY/.setup.yaml
191+
sleep 5
192+
fi
184193
release_name=$(yq .name $CHART_DIRECTORY/Chart.yaml)
185-
kubectl create ns cop-system
186-
helm -n cop-system upgrade -i $release_name --wait --timeout 5m \
194+
kubectl create ns component-operator-system
195+
helm -n component-operator-system upgrade -i $release_name --wait --timeout 5m \
187196
--set image.repository=${{ needs.build-docker.outputs.image-repository }} \
188197
--set image.tag=${{ needs.build-docker.outputs.image-tag }} \
189198
$CHART_DIRECTORY

.github/workflows/publish.yaml

+49
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ on:
77
concurrency: release-${{ github.event.release.tag_name }}
88

99
env:
10+
HELM_VERSION: v3.11.3
1011
REGCTL_VERSION: v0.4.8
1112
REGISTRY: ghcr.io
1213
CHART_DIRECTORY: chart
@@ -16,6 +17,21 @@ defaults:
1617
shell: bash
1718

1819
jobs:
20+
publish-go-module:
21+
name: Publish go module
22+
runs-on: ubuntu-24.04
23+
24+
steps:
25+
- name: Trigger registration on sum.golang.org
26+
run: |
27+
repository=${{ github.repository }}
28+
tag=${{ github.event.release.tag_name }}
29+
curl -sSf \
30+
--max-time 30 \
31+
--retry 5 \
32+
--retry-max-time 300 \
33+
https://sum.golang.org/lookup/github.com/${repository,,}@${tag}
34+
1935
validate:
2036
name: Run validations
2137
runs-on: ubuntu-24.04
@@ -138,3 +154,36 @@ jobs:
138154
repository=$REGISTRY/${{ github.repository }}/crds
139155
tar cvz * | regctl artifact put -m application/gzip ${repository,,}:${{ github.event.release.tag_name }}
140156
157+
publish-chart:
158+
name: Publish chart to github packages
159+
runs-on: ubuntu-24.04
160+
needs: validate
161+
permissions:
162+
contents: read
163+
packages: write
164+
165+
steps:
166+
- name: Checkout repository
167+
uses: actions/checkout@v4
168+
169+
- uses: azure/setup-helm@v4
170+
with:
171+
version: ${{ env.HELM_VERSION }}
172+
173+
- name: Create package
174+
run: |
175+
chart_version=$(yq .version $CHART_DIRECTORY/Chart.yaml)
176+
helm package --version $chart_version $CHART_DIRECTORY
177+
178+
- name: Login to the OCI registry
179+
run: |
180+
helm --registry-config $RUNNER_TEMP/helm-config.json registry login $REGISTRY -u ${{ github.actor }} --password-stdin <<< ${{ github.token }}
181+
182+
- name: Upload package
183+
run: |
184+
chart_name=$(yq .name $CHART_DIRECTORY/Chart.yaml)
185+
chart_version=$(yq .version $CHART_DIRECTORY/Chart.yaml)
186+
file=$chart_name-$chart_version.tgz
187+
repository=$REGISTRY/${{ github.repository }}/charts
188+
helm --registry-config $RUNNER_TEMP/helm-config.json push $file oci://${repository,,}
189+

0 commit comments

Comments
 (0)