diff --git a/.github/workflows/pre-release.yml b/.github/workflows/pre-release.yml index b9618aa4..0386a194 100644 --- a/.github/workflows/pre-release.yml +++ b/.github/workflows/pre-release.yml @@ -15,7 +15,9 @@ jobs: steps: - name: checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v4 + with: + fetch-depth: 0 # ensure the full history is fetched so we can compare changes - uses: azure/setup-helm@v4 with: @@ -34,21 +36,41 @@ jobs: echo "Labels: $LABELS" if echo "$LABELS" | grep -q "release-apply"; then echo "Label 'release-apply' found." - echo "release_apply=true" >>$GITHUB_OUTPUT + # PRs with label "release-label" are created at the end of this workflow and we don't want infinite loops + echo "The pull request is merged and has the 'release-apply' label. Nothing to do. Exiting with success" + echo "continue=false" >>$GITHUB_OUTPUT + exit 0 else echo "Label 'release-apply' not found." - echo "release_apply=false" >>$GITHUB_OUTPUT + echo "continue=true" >>$GITHUB_OUTPUT fi env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: early exit if release-apply is not present - if: steps.check_label.outputs.release_apply == 'true' + - name: check for changes in helm-chart directory + id: check_changes run: | - echo "The pull request is merged and has the 'release-apply' label. Exiting with success" - exit 0 + # fetch all + git fetch -all + + # get the base commit (before the merge) + BASE_COMMIT=$(git merge-base HEAD origin/main) + + # get the list of files changed in the pull request + CHANGED_FILES=$(git diff --name-only $BASE_COMMIT HEAD) + + # check if any files in the helm-chart/ directory have changed + if echo "$CHANGED_FILES" | grep -q "^helm-chart/"; then + echo "Changes detected in the helm-chart/ directory." + echo "continue=true" >> $GITHUB_OUTPUT + else + echo "No changes detected in the helm-chart/ directory. Exiting." + echo "continue=false" >> $GITHUB_OUTPUT + exit 0 + fi - name: determine version increment + if: steps.check_label.outputs.continue == 'true' && steps.check_changes.outputs.continue == 'true' id: determine-version run: | PR_TITLE=$(echo "${{ github.event.pull_request.title }}" | tr '[:upper:]' '[:lower:]') @@ -128,10 +150,10 @@ jobs: uses: peter-evans/create-pull-request@v6 with: token: ${{ secrets.GITHUB_TOKEN }} - commit-message: 'release eoapi chart to ${{ env.new_version }}' - title: 'release for ${{ github.ref }}@${{ github.sha }}' + commit-message: 'release eoapi chart to v${{ env.new_version }}' + title: 'release v${{ env.new_version }} for ${{ github.ref }}@${{ github.sha }}' body: | - this PR contains the version bumps for the eoapi chart ${{ env.new_version }} + this PR contains the version bumps for the eoapi chart v${{ env.new_version }} base: main branch: apply-${{ github.head_ref }} labels: release-apply diff --git a/docs/release.md b/docs/release.md new file mode 100644 index 00000000..35bef850 --- /dev/null +++ b/docs/release.md @@ -0,0 +1,36 @@ +### Release Workflow + +1. PRs that include changes in the `helm-chart/` directory with a base of `main` should also choose a PR +title that decides if the chart's version bumps will be major, minor or patch according to semantic versioning. +All they need to do is prefix `major: `, `minor: ` or `patch: ` to the PR title + + +2. All PRs merged against the base `main` will kick off a "pre-release" workflow that does the following: + + 1. detect if there are changes in the `helm-chart/` directory and if not the "pre-release.yaml" workflow exits gracefully + + 2. sniff the PR title to determine major, minor or patch bumps + + 3. increment the helm chart's `version` and `appVersion` accordingly + + 4. create a new PR with these changes with a title called + `'release ${{ env.new_version }} for ${{ github.ref }}@${{ github.sha }}'` and body listing the new chart version + + +4. The releaser should find this PR, review and merge accordingly + + +5. Then the releaser should go to the Github release UI/UX and kick off a new release by doing the following: + + 1. click "Draft New Release" + + 2. create a new tag for the branch `main` with the chart version listed in the previous PR's body and title + + 3. click the "Generate release notes" + + 4. review the release notes and clean up + + 5. click the "Publish release" + +6. This last step then kicks off another workflow called "release.yaml" which publishes the helm chart to the +`gh-pages` branch diff --git a/helm-chart/eoapi/CHANGELOG.md b/helm-chart/eoapi/CHANGELOG.md deleted file mode 100644 index 03e8e537..00000000 --- a/helm-chart/eoapi/CHANGELOG.md +++ /dev/null @@ -1,79 +0,0 @@ -version numbers below correspond to helm chart `appVersion`: see `./helm-chart/eoapi/Chart.yaml` ---- -### 0.3.5 (2024-07-09) - -* tweaks for getting NFS working with a static NFS EFS mount - -### 0.3.4 (2024-07-05) - -* add back in a hidden non-pgo option for EOEPCA+ - -### 0.3.3 (2024-06-26) - -* add k3 integration tests -* break out GCP integreation tests and force them to use TLS -* clean it up - -### 0.3.2 (2024-06-16) - -* backward breaking change: remove in-memory postgres database and secret management for crunchydata postgresql cluster - -### 0.3.1 (2024-01-19) - -* removed support for having anything but `ingresss.className=='nginx'` - -### 0.2.11 (2024-01-18) - -* added `ingress.annotations` key to pass through to the nginx ingress -- thanks @ghelobytes -* upgraded titiler/pgstac/tipg images and integration tests -- thanks @vincentsarago -* added autoscaling permissions and docs to the AWS walkthrough -- thanks @Rub21 - -### 0.2.10 (2023-11-22) - -* give `ingress.className == "nginx"` the ability pass hosts and tls information -* more tests to give user feedback about the above functionality if the wrong `ingress.className` was given - -### 0.2.9 (2023-10-25) - -* removed `providerContext` and any support for minikube from the templates so this is a breaking change -* added autoscaling rules and docs based on request rate using prometheus + ingress nginx controller + prometheus-adapter - -### 0.1.8 (2023-10-02) - -* adjust cpu limits so if autoscaling is enabled it doesn't immediately scaleup - -### 0.1.7 (2023-10-02) - -* adds `autoscaling` options to each service for HPA - -### 0.1.6 (2023-09-27) - -* adds `docServer.enable` flag to the `values.yaml` and service templates - -### 0.1.5 (2023-09-16) - -* adds a cpu and memory limits/requests to the `db` config block - -### 0.1.4 (2023-09-09) - -* adds a `testing: false` value to `values.yaml` -* plumb through `{{ $.Release.Name }}` into all the right templates so our CI can `helm install` into a single namespace and run tests in parallel - -### 0.1.3 (2023-09-05) - -* test on GKE and add documentation where needed for [GKE template changes](https://github.com/developmentseed/eoapi-k8s/issues/29) -* CI/CD should run on GKE so we debug less test failures on minikube for [move CI/CD away from minikube](https://github.com/developmentseed/eoapi-k8s/issues/36) -* documentation about default configuration and additional options for [documentation](https://github.com/developmentseed/eoapi-k8s/issues/19) - -### 0.1.2 (2023-08-31) - -* move `command` blocks out to `values.yml` for [generalizing ticket](https://github.com/developmentseed/eoapi-k8s/issues/31) -* add `livenessProbe` for all deployments for [livenessProbe bug](https://github.com/developmentseed/eoapi-k8s/issues/26) - -### 0.1.1 (2023-07-21) - -* For the shared-nginx ingress option [add root path with docs](https://github.com/developmentseed/eoapi-k8s/issues/18) pointing to path rewrites - -### 0.1.0 (2023-07-01) - -* Adds basic AWS EKS services with ALB and NLB options