diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e955f09..845207d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,11 +1,9 @@ name: Release on: - workflow_dispatch: - inputs: - version: - description: "Version to release (e.g. v1.2.3)" - required: true + push: + tags: + - "v*.*.*" permissions: contents: write @@ -18,23 +16,6 @@ jobs: with: fetch-depth: 0 - - name: Validate version format - run: | - if [[ ! "${{ github.event.inputs.version }}" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then - echo "Error: version must match v.. (e.g. v1.2.3)" - exit 1 - fi - - - name: Configure git - run: | - git config user.name "github-actions[bot]" - git config user.email "github-actions[bot]@users.noreply.github.com" - - - name: Create and push tag - run: | - git tag -a "${{ github.event.inputs.version }}" -m "Release ${{ github.event.inputs.version }}" - git push origin "${{ github.event.inputs.version }}" - - uses: jdx/mise-action@v3 with: version: 2026.3.8 diff --git a/.github/workflows/releaser-pleaser.yml b/.github/workflows/releaser-pleaser.yml new file mode 100644 index 0000000..e383c6d --- /dev/null +++ b/.github/workflows/releaser-pleaser.yml @@ -0,0 +1,28 @@ +name: releaser-pleaser + +on: + push: + branches: [main] + pull_request_target: + types: + - edited + - labeled + - unlabeled + +concurrency: + group: releaser-pleaser + cancel-in-progress: true + +jobs: + releaser-pleaser: + runs-on: ubuntu-latest + permissions: + contents: write + pull-requests: write + steps: + - name: releaser-pleaser + uses: apricote/releaser-pleaser@v0.8.0 + with: + token: ${{ secrets.RELEASER_PLEASER_TOKEN }} + extra-files: | + cmd/qcloud/main.go diff --git a/.goreleaser.yaml b/.goreleaser.yaml index bf3b9f4..8215640 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -38,9 +38,4 @@ snapshot: version_template: "{{ .Tag }}-next" changelog: - sort: asc - filters: - exclude: - - "^docs:" - - "^test:" - - "^chore:" + disable: true diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 157bb3a..f17c4a6 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -24,13 +24,26 @@ make test ## Building -The cli binary is build in the `./build` directory, this is mostly for building locally. +The cli binary is built in the `./build` directory, this is mostly for building locally. ```bash make build ``` -For release for multiple platforms, goreleaser is used in CI. +## Releasing + +The project uses [releaser-pleaser](https://apricote.github.io/releaser-pleaser/introduction.html) to automate releases. + +Releases are driven by [conventional commits](https://www.conventionalcommits.org/). Each commit merged to `main` is classified by its prefix: + +- `fix:` patches (e.g. `fix: correct cluster list pagination`) +- `feat:` minor releases (e.g. `feat: add backup commands`) +- `feat!:` or `BREAKING CHANGE:` major releases + +After merging to `main`, releaser-pleaser opens or updates a "release PR" that bumps the version and updates the changelog. Merging that PR tags the commit and triggers GoReleaser to publish the GitHub release and binaries. + +No manual tagging is needed. + ## Conventions diff --git a/cmd/qcloud/main.go b/cmd/qcloud/main.go index 662ef44..65104a2 100644 --- a/cmd/qcloud/main.go +++ b/cmd/qcloud/main.go @@ -9,7 +9,7 @@ import ( "github.com/qdrant/qcloud-cli/internal/state" ) -var version = "dev" +var version = "dev" // x-releaser-pleaser-version func main() { ctx := context.Background()