diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index 97a12a83ce9b..a115f13af498 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -70,35 +70,3 @@ jobs: out-file-path: "release-packages" - run: npm run publish:docker - - repo: - runs-on: ubuntu-latest - permissions: - contents: write # To push the branch. - pull-requests: write # To open the PR. - env: - GH_TOKEN: ${{ github.token }} - TAG: ${{ inputs.version || github.ref_name }} - needs: docker - - steps: - - name: Set version to tag without leading v - run: | - echo "VERSION=${TAG#v}" >> $GITHUB_ENV - - - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v6 - - - run: ./ci/build/update-repo.sh - - - name: Open PR - run: | - git config --global user.name "github-actions[bot]" - git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com" - git checkout -b "helm/$VERSION" - git add . - git commit -m "Update Helm chart and changelog with $VERSION" - git push -u origin "$(git branch --show)" - gh pr create \ - --repo "$GITHUB_REPOSITORY" \ - --body-file .cache/checklist \ - --title "Update Helm chart and changelog with $VERSION" diff --git a/ci/build/update-repo.sh b/ci/build/update-repo.sh deleted file mode 100755 index 83eb1614c65e..000000000000 --- a/ci/build/update-repo.sh +++ /dev/null @@ -1,93 +0,0 @@ -#!/usr/bin/env bash - -set -Eeuo pipefail - -# Given versions $1 and $2 figure out the first component that is different -# (major, minor, patch). -function find_version_diff() { - # shellcheck disable=SC2206 - local a=( ${1//./ } ) - # shellcheck disable=SC2206 - local b=( ${2//./ } ) - - if [[ ${a[0]} != "${b[0]}" ]] ; then - echo major - elif [[ ${a[1]} != "${b[1]}" ]] ; then - echo minor - else - echo patch - fi -} - -# Bump $1 by the bump type (major, minor, patch) in $2. -function bump_version() { - # shellcheck disable=SC2206 - local a=( ${1//./ } ) - case $2 in - major) - ((a[0]++)) - a[1]=0 - a[2]=0 - ;; - minor) - ((a[1]++)) - a[2]=0 - ;; - *) - ((a[2]++)) - ;; - esac - echo "${a[0]}.${a[1]}.${a[2]}" -} - -function update_helm() { - local chart_version - chart_version=$(yq .version ci/helm-chart/Chart.yaml) - local app_version - app_version=$(yq .appVersion ci/helm-chart/Chart.yaml) - local image_version - image_version=$(yq .image.tag ci/helm-chart/values.yaml) - - local bump_type - bump_type=$(find_version_diff "$app_version" "$version") - local chart_version_bump - chart_version_bump=$(bump_version "$chart_version" "$bump_type") - - # Use sed to replace because yq will reformat. - echo "Bumping version from $chart_version to $chart_version_bump..." - sed -i.bak "s/^version: $chart_version\$/version: $chart_version_bump/" ci/helm-chart/Chart.yaml - - echo "Bumping app version from $app_version to $version..." - sed -i.bak "s/^appVersion: .\+\$/appVersion: $version/" ci/helm-chart/Chart.yaml - - echo "Bumping image version from $image_version to $version..." - sed -i.bak "s/^ tag: .\+\$/ tag: '$version'/" ci/helm-chart/values.yaml -} - -function update_changelog() { - local date - date=$(printf '%(%Y-%m-%d)T\n' -1) - local link="${GITHUB_SERVER_URL:-https://github.com}/${GITHUB_REPOSITORY:-MotusLabs/code-server}/releases/tag/v$version" - sed -i.bak "s|## Unreleased|## Unreleased\n\n## [$version]($link) - $date|" CHANGELOG.md -} - -function main() { - cd "$(dirname "${0}")/../.." - - source ./ci/lib.sh - - local version=${VERSION:-$(git describe --tags)} - version="${version#v}" - - declare -a steps - - steps+=( - "Update Helm chart" "update_helm" - "Update changelog" "update_changelog" - ) - - # Even if a step failed, still output the last checkmark. - run-steps "${steps[@]}" || true -} - -main "$@" diff --git a/docs/MAINTAINING.md b/docs/MAINTAINING.md index 82643ba71176..2bbfea12bb47 100644 --- a/docs/MAINTAINING.md +++ b/docs/MAINTAINING.md @@ -33,8 +33,10 @@ Most of the work is keeping on top of issues and discussions. to a draft release. 5. Update the resulting draft release with the changelog contents. 6. Publish the draft release after validating it. -7. Update the changelog with the release date and bump the Helm chart version - once the Docker images have published. +7. Once the Docker image has published, update the changelog with the release + date and bump the Helm chart version by hand. Nothing in CI does this; the + chart is not published anywhere, so it only matters if you install from a + checkout of this repository. #### Release Candidates