From c45846535c141b6b99cac396d6655a94b2b333dc Mon Sep 17 00:00:00 2001 From: Noste <83548733+Noooste@users.noreply.github.com> Date: Fri, 15 May 2026 18:14:15 +0200 Subject: [PATCH] ci: add automated release workflow and changelog management (#47) Signed-off-by: Noste <83548733+Noooste@users.noreply.github.com> --- .github/workflows/build.yml | 3 +- .../{release.yml => chart-release.yml} | 18 +++--- .github/workflows/pr-title.yml | 38 ++++++++++++ .github/workflows/release-please.yml | 20 +++++++ .release-please-manifest.json | 4 ++ CHANGELOG.md | 5 ++ CONTRIBUTING.md | 58 +++++++++++++++++++ helm/garage-ui/CHANGELOG.md | 5 ++ release-please-config.json | 29 ++++++++++ 9 files changed, 170 insertions(+), 10 deletions(-) rename .github/workflows/{release.yml => chart-release.yml} (73%) create mode 100644 .github/workflows/pr-title.yml create mode 100644 .github/workflows/release-please.yml create mode 100644 .release-please-manifest.json create mode 100644 CHANGELOG.md create mode 100644 helm/garage-ui/CHANGELOG.md create mode 100644 release-please-config.json diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 7ff472f..6df976c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -3,7 +3,8 @@ name: build on: push: tags: - - 'v*' + - 'v[0-9]+.[0-9]+.[0-9]+' + - 'v[0-9]+.[0-9]+.[0-9]+-*' jobs: build: diff --git a/.github/workflows/release.yml b/.github/workflows/chart-release.yml similarity index 73% rename from .github/workflows/release.yml rename to .github/workflows/chart-release.yml index 1a2946d..e6c4c96 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/chart-release.yml @@ -1,17 +1,16 @@ -name: release +name: chart-release on: push: - branches: - - main - paths: - - 'helm/garage-ui/**' - - '!helm/garage-ui/README.md' + tags: + - 'garage-ui-chart-v*' + +permissions: + contents: write + pages: write jobs: release: - permissions: - contents: write runs-on: ubuntu-latest steps: - name: Checkout Code @@ -33,5 +32,6 @@ jobs: uses: helm/chart-releaser-action@v1.7.0 with: charts_dir: helm + skip_existing: true env: - CR_TOKEN: "${{ secrets.HELM_RELEASE_TOKEN }}" \ No newline at end of file + CR_TOKEN: ${{ secrets.HELM_RELEASE_TOKEN }} diff --git a/.github/workflows/pr-title.yml b/.github/workflows/pr-title.yml new file mode 100644 index 0000000..d51fe93 --- /dev/null +++ b/.github/workflows/pr-title.yml @@ -0,0 +1,38 @@ +name: pr-title + +on: + pull_request: + types: [opened, edited, synchronize, reopened] + +permissions: + pull-requests: read + +jobs: + lint: + runs-on: ubuntu-latest + steps: + - uses: amannn/action-semantic-pull-request@v5 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + types: | + feat + fix + docs + chore + refactor + test + ci + build + perf + scopes: | + backend + frontend + helm + ci + deps + requireScope: false + subjectPattern: ^[A-Za-z].+[^.]$ + subjectPatternError: | + PR title subject must start with a letter and not end with a period. + Example: "feat(helm): add support for extraEnvs" diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml new file mode 100644 index 0000000..4dedb8f --- /dev/null +++ b/.github/workflows/release-please.yml @@ -0,0 +1,20 @@ +name: release-please + +on: + push: + branches: + - main + +permissions: + contents: write + pull-requests: write + +jobs: + release-please: + runs-on: ubuntu-latest + steps: + - uses: googleapis/release-please-action@v4 + with: + config-file: release-please-config.json + manifest-file: .release-please-manifest.json + token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.release-please-manifest.json b/.release-please-manifest.json new file mode 100644 index 0000000..14f6650 --- /dev/null +++ b/.release-please-manifest.json @@ -0,0 +1,4 @@ +{ + ".": "0.5.0", + "helm/garage-ui": "0.3.0" +} diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..abc10bc --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,5 @@ +# Changelog + +All notable changes to the Garage UI backend are documented in this file. + +This file is automatically maintained by [release-please](https://github.com/googleapis/release-please) based on [Conventional Commits](https://www.conventionalcommits.org/). diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 0324e25..4636eb4 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -130,3 +130,61 @@ Enhancement suggestions are tracked as [GitHub issues](https://github.com/Nooost - **Describe the current behavior** and **explain which behavior you expected to see instead** and why. At this point you can also tell which alternatives do not work for you. - You may want to **include screenshots or screen recordings** which help you demonstrate the steps or point out the part which the suggestion is related to. You can use [LICEcap](https://www.cockos.com/licecap/) to record GIFs on macOS and Windows, and the built-in [screen recorder in GNOME](https://help.gnome.org/users/gnome-help/stable/screen-shot-record.html.en) or [SimpleScreenRecorder](https://github.com/MaartenBaert/ssr) on Linux. - **Explain why this enhancement would be useful** to most Garage UI users. You may also want to point out the other projects that solved it better and which could serve as inspiration. + + +## Commit Messages + +This repo uses [Conventional Commits](https://www.conventionalcommits.org/) on +PR titles to drive automated releases and changelogs via +[release-please](https://github.com/googleapis/release-please). + +PRs are squash-merged, so **only the PR title needs to follow the format**. +Branch commits can be anything. + +### Format + +``` +(): +``` + +### Allowed types + +| Type | Use when… | Triggers release? | +|------------|------------------------------------------|-------------------| +| `feat` | adding new user-facing functionality | minor bump | +| `fix` | fixing a bug | patch bump | +| `feat!` | breaking change (pre-1.0: still minor) | minor bump | +| `perf` | performance improvement | patch bump | +| `docs` | documentation only | no | +| `refactor` | code change that's not feat/fix | no | +| `chore` | tooling, deps, build | no | +| `test` | adding/fixing tests | no | +| `ci` | CI workflow changes | no | +| `build` | build system changes | no | + +Pre-1.0 SemVer: while the project is `<1.0`, breaking changes (`feat!`) bump +the **minor** version, not the major. Once the project declares `1.0.0`, +`feat!` will bump major as per standard SemVer. + +### Allowed scopes + +- `backend` — Go API server +- `frontend` — React app +- `helm` — Helm chart +- `ci` — CI workflows +- `deps` — dependency updates + +Scope is optional. Use it when the change is clearly scoped to one component +(it routes the version bump to that component only). + +### Examples + +``` +feat(backend): add bucket quota enforcement +fix(frontend): correct theme toggle in Safari +feat(helm): support extraEnvs in deployment template +chore(deps): bump axios from 1.15.0 to 1.15.2 +docs: clarify OIDC setup in README +``` + +The PR title is automatically validated by the `pr-title` GitHub Action. diff --git a/helm/garage-ui/CHANGELOG.md b/helm/garage-ui/CHANGELOG.md new file mode 100644 index 0000000..fd68934 --- /dev/null +++ b/helm/garage-ui/CHANGELOG.md @@ -0,0 +1,5 @@ +# Changelog + +All notable changes to the `garage-ui` Helm chart are documented in this file. + +This file is automatically maintained by [release-please](https://github.com/googleapis/release-please) based on [Conventional Commits](https://www.conventionalcommits.org/). diff --git a/release-please-config.json b/release-please-config.json new file mode 100644 index 0000000..0dd7b4b --- /dev/null +++ b/release-please-config.json @@ -0,0 +1,29 @@ +{ + "$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json", + "bump-minor-pre-major": true, + "bump-patch-for-minor-pre-major": false, + "separate-pull-requests": false, + "packages": { + ".": { + "release-type": "go", + "component": "garage-ui", + "include-component-in-tag": false, + "changelog-path": "CHANGELOG.md" + }, + "helm/garage-ui": { + "release-type": "helm", + "component": "garage-ui-chart", + "package-name": "garage-ui", + "include-component-in-tag": true, + "changelog-path": "CHANGELOG.md", + "extra-files": [ + { + "type": "yaml", + "path": "Chart.yaml", + "jsonpath": "$.appVersion", + "glob": false + } + ] + } + } +}