Skip to content

Commit e7a80aa

Browse files
jdpleinessenriquegh
authored andcommitted
feat(rel): add steps to update main with latest versions (#600)
Add a step to our build process that creates a PR with the latest release version to merge back into `main`. Also updates broken Github action Python dependency in CI. ### Checklist - [NA] Follow the [manual testing process](https://github.com/sourcegraph/deploy-sourcegraph-helm/blob/main/TEST.md) - [NA] Update [changelog](https://github.com/sourcegraph/deploy-sourcegraph-helm/blob/main/charts/sourcegraph/CHANGELOG.md) - [NA] Update [Kubernetes update doc](https://docs.sourcegraph.com/admin/updates/kubernetes) ### Test plan Part of CI steps during release process.
1 parent d3a969b commit e7a80aa

File tree

2 files changed

+113
-2
lines changed

2 files changed

+113
-2
lines changed

.github/workflows/helm_lint_test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ jobs:
1818
uses: azure/setup-helm@v3
1919
with:
2020
version: v3.9.1
21-
- uses: actions/setup-python@v2
21+
- uses: actions/setup-python@v5
2222
with:
23-
python-version: 3.7
23+
python-version: '3.13'
2424
- uses: azure/[email protected]
2525
id: install
2626
- name: Set up chart-testing

release.yaml

Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -559,3 +559,114 @@ promoteToPublic:
559559
echo "Build created, see:"
560560
echo $body | jq .web_url
561561
fi
562+
563+
- name: "update main with latest version"
564+
cmd: |
565+
set -eu
566+
branch="promote/release-{{version}}-update-main"
567+
echo "Checking out origin/main"
568+
git fetch origin main
569+
git switch main
570+
echo "Creating branch origin/${branch}"
571+
git switch -c "${branch}"
572+
573+
- name: sg ops:sourcegraph
574+
cmd: |
575+
set -eu
576+
registry=index.docker.io/sourcegraph
577+
sg ops update-images \
578+
-t {{inputs.server.tag}} \
579+
-k helm \
580+
--registry "${registry}" \
581+
--docker-username $DOCKER_USERNAME \
582+
--docker-password $DOCKER_PASSWORD \
583+
charts/sourcegraph/
584+
585+
- name: sg ops:dind
586+
cmd: |
587+
set -eu
588+
registry=index.docker.io/sourcegraph
589+
sg ops update-images \
590+
-t {{inputs.server.tag}} \
591+
-k helm \
592+
--registry "${registry}" \
593+
--docker-username $DOCKER_USERNAME \
594+
--docker-password $DOCKER_PASSWORD \
595+
charts/sourcegraph-executor/dind/
596+
597+
- name: sg ops:k8s
598+
cmd: |
599+
set -eu
600+
registry=index.docker.io/sourcegraph
601+
sg ops update-images \
602+
-t {{inputs.server.tag}} \
603+
-k helm \
604+
--registry "${registry}" \
605+
--docker-username $DOCKER_USERNAME \
606+
--docker-password $DOCKER_PASSWORD \
607+
charts/sourcegraph-executor/k8s/
608+
609+
- name: sg ops:migrator
610+
cmd: |
611+
set -eu
612+
registry=index.docker.io/sourcegraph
613+
sg ops update-images \
614+
-t {{inputs.server.tag}} \
615+
-k helm \
616+
--registry "${registry}" \
617+
--docker-username $DOCKER_USERNAME \
618+
--docker-password $DOCKER_PASSWORD \
619+
charts/sourcegraph-migrator/
620+
621+
- name: sg ops:appliance
622+
cmd: |
623+
set -eu
624+
registry=index.docker.io/sourcegraph
625+
sg ops update-images \
626+
-t {{inputs.server.tag}} \
627+
-k helm \
628+
--registry "${registry}" \
629+
--docker-username $DOCKER_USERNAME \
630+
--docker-password $DOCKER_PASSWORD \
631+
charts/sourcegraph-appliance/
632+
633+
- name: "chart:version"
634+
cmd: |
635+
comby -matcher ".generic" -in-place "version: \":[~\d+\.\d+\.\d+]\"" 'version: "{{inputs.server.tag}}"' -f charts/sourcegraph/Chart.yaml
636+
comby -matcher ".generic" -in-place "version: \":[~\d+\.\d+\.\d+]\"" 'version: "{{inputs.server.tag}}"' -f charts/sourcegraph/examples/subchart/Chart.yaml
637+
comby -matcher ".generic" -in-place "version: \":[~\d+\.\d+\.\d+]\"" 'version: "{{inputs.server.tag}}"' -f charts/sourcegraph-executor/dind/Chart.yaml
638+
comby -matcher ".generic" -in-place "version: \":[~\d+\.\d+\.\d+]\"" 'version: "{{inputs.server.tag}}"' -f charts/sourcegraph-executor/k8s/Chart.yaml
639+
comby -matcher ".generic" -in-place "version: \":[~\d+\.\d+\.\d+]\"" 'version: "{{inputs.server.tag}}"' -f charts/sourcegraph-migrator/Chart.yaml
640+
comby -matcher ".generic" -in-place "version: \":[~\d+\.\d+\.\d+]\"" 'version: "{{inputs.server.tag}}"' -f charts/sourcegraph-appliance/Chart.yaml
641+
642+
- name: "chart:appVersion"
643+
cmd: |
644+
comby -matcher ".generic" -in-place "appVersion: \":[~\d+\.\d+\.\d+]\"" 'appVersion: "{{inputs.server.tag}}"' -f charts/sourcegraph/Chart.yaml
645+
comby -matcher ".generic" -in-place "appVersion: \":[~\d+\.\d+\.\d+]\"" 'appVersion: "{{inputs.server.tag}}"' -f charts/sourcegraph-executor/dind/Chart.yaml
646+
comby -matcher ".generic" -in-place "appVersion: \":[~\d+\.\d+\.\d+]\"" 'appVersion: "{{inputs.server.tag}}"' -f charts/sourcegraph-executor/k8s/Chart.yaml
647+
comby -matcher ".generic" -in-place "appVersion: \":[~\d+\.\d+\.\d+]\"" 'appVersion: "{{inputs.server.tag}}"' -f charts/sourcegraph-migrator/Chart.yaml
648+
comby -matcher ".generic" -in-place "appVersion: \":[~\d+\.\d+\.\d+]\"" 'appVersion: "{{inputs.server.tag}}"' -f charts/sourcegraph-appliance/Chart.yaml
649+
650+
- name: "update helm docs"
651+
cmd: ./scripts/helm-docs.sh
652+
653+
- name: "git:commit"
654+
cmd: |
655+
set -eu
656+
branch="promote/release-{{version}}-update-main"
657+
658+
git commit -am "prep update main: {{version}}" -m 'update main with latest release'
659+
git push origin "${branch}"
660+
661+
- name: "github:pr"
662+
cmd: |
663+
set -eu
664+
internal_branch="promote/release-{{version}}-update-main"
665+
gh pr create \
666+
--fill \
667+
--draft \
668+
--base "$internal_branch" \
669+
--title "Update main: build {{version}}" \
670+
--body "Test plan: automated release PR, CI will perform additional checks"
671+
echo "🚢 Please check the associated CI build to ensure the process completed".
672+

0 commit comments

Comments
 (0)