From 83ca09c530e9ab4666d0046106c04e62e455336d Mon Sep 17 00:00:00 2001 From: Nargonath Date: Thu, 22 Feb 2024 21:27:48 +0100 Subject: [PATCH 1/3] chore(codeowners): change owners --- .github/CODEOWNERS | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 36e0dd7..c73604a 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -6,4 +6,4 @@ # - https://blog.github.com/2017-07-06-introducing-code-owners/ # The default owner -* @KeisukeYamashita +* @Nargonath @adanylenko From 9b54ea299d1df2ee6fe2f5e337e446532fe0fc5e Mon Sep 17 00:00:00 2001 From: Nargonath Date: Thu, 22 Feb 2024 21:32:25 +0100 Subject: [PATCH 2/3] ci(release): rename go release ci file --- .github/workflows/{release.yml => release-go.yml} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename .github/workflows/{release.yml => release-go.yml} (98%) diff --git a/.github/workflows/release.yml b/.github/workflows/release-go.yml similarity index 98% rename from .github/workflows/release.yml rename to .github/workflows/release-go.yml index 02f16c3..dfae0dd 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release-go.yml @@ -10,7 +10,7 @@ # You will need to pass the `--batch` flag to `gpg` in your signing step # in `goreleaser` to indicate this is being used in a non-interactive mode. # -name: Release +name: Release Go artefacts on: push: tags: From 3222448919eaa68ae44361a3520a2851638005e9 Mon Sep 17 00:00:00 2001 From: Nargonath Date: Thu, 22 Feb 2024 22:07:09 +0100 Subject: [PATCH 3/3] build(semantic-release): setup --- .github/workflows/semver-release.yml | 39 ++++++++++++++++++++++++++++ .releaserc.json | 10 +++++++ README.md | 12 +++++++++ commitlint.config.js | 7 +++++ 4 files changed, 68 insertions(+) create mode 100644 .github/workflows/semver-release.yml create mode 100644 .releaserc.json create mode 100644 commitlint.config.js diff --git a/.github/workflows/semver-release.yml b/.github/workflows/semver-release.yml new file mode 100644 index 0000000..8ca566d --- /dev/null +++ b/.github/workflows/semver-release.yml @@ -0,0 +1,39 @@ +name: SemVer Release +on: + push: + branches: + - main + - beta + +permissions: + contents: read # for checkout + +jobs: + release: + name: Release + runs-on: ubuntu-latest + permissions: + contents: write # to be able to publish a GitHub release + issues: write # to be able to comment on released issues + pull-requests: write # to be able to comment on released pull requests + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + fetch-depth: 0 + - name: Setup Node.js + uses: actions/setup-node@v3 + with: + node-version: "20.x" + cache: "npm" + # TODO: Run Go/Terraform tests to make sure we publish a working version + # - name: Test + # run: + - name: Install dependencies + run: npm i -D @semantic-release/git @semantic-release/changelog @commitlint/{cli,config-conventional} commitlint + - name: Check commit format + run: npx commitlint --from HEAD~1 --to HEAD --verbose + - name: Release + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: npx semantic-release --dry-run diff --git a/.releaserc.json b/.releaserc.json new file mode 100644 index 0000000..fbd687d --- /dev/null +++ b/.releaserc.json @@ -0,0 +1,10 @@ +{ + "branches": ["main", { "name": "beta", "prerelease": true }], + "plugins": [ + "@semantic-release/commit-analyzer", + "@semantic-release/release-notes-generator", + "@semantic-release/changelog", + "@semantic-release/github", + "@semantic-release/git" + ] +} diff --git a/README.md b/README.md index 1911344..3137733 100644 --- a/README.md +++ b/README.md @@ -25,3 +25,15 @@ Enter the provider directory and build the provider $ cd $GOPATH/src/github.com/ronati/terraform-provider-typesense $ make build ``` + +# Contribute + +**All contributions are welcome!** + +## Commit format + +This project is setup with automatic semver versioning based on your commit semantic. It uses [`commitizen`](https://commitizen.github.io/cz-cli/) to enforce the format and help contributors format their commit message. We follow the [conventional commit format](https://www.conventionalcommits.org/en/v1.0.0/). Once you want to commit your work, you need to: + +## Notes for project's maintainers + +When you merge a PR from `beta` into `main` and it successfully published a new version on the `latest` channel, **don't forget to create a PR from `main` to `beta`**. **This is mandatory** for `semantic-release` to take it into account for next `beta` version. diff --git a/commitlint.config.js b/commitlint.config.js new file mode 100644 index 0000000..c6d3f91 --- /dev/null +++ b/commitlint.config.js @@ -0,0 +1,7 @@ +module.exports = { + extends: ["@commitlint/config-conventional"], + ignores: [(commit) => commit.startsWith("chore(release)")], + rules: { + "body-max-line-length": [0], + }, +};