From 83ca09c530e9ab4666d0046106c04e62e455336d Mon Sep 17 00:00:00 2001 From: Nargonath Date: Thu, 22 Feb 2024 21:27:48 +0100 Subject: [PATCH 01/21] 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 02/21] 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 03/21] 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], + }, +}; From 2edb3ca12f5bdf4111dffc1d33c985773b91f3af Mon Sep 17 00:00:00 2001 From: Nargonath Date: Thu, 22 Feb 2024 22:55:06 +0100 Subject: [PATCH 04/21] ci(release): remove npm cache option --- .github/workflows/semver-release.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/semver-release.yml b/.github/workflows/semver-release.yml index 8ca566d..fa066b1 100644 --- a/.github/workflows/semver-release.yml +++ b/.github/workflows/semver-release.yml @@ -25,7 +25,6 @@ jobs: 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: From dd1644a76081b3aef23f2154e68efcc58e08e95c Mon Sep 17 00:00:00 2001 From: Nargonath Date: Thu, 22 Feb 2024 23:18:06 +0100 Subject: [PATCH 05/21] ci(commitlint): lint from latest tag --- .github/workflows/semver-release.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/semver-release.yml b/.github/workflows/semver-release.yml index fa066b1..3cb004c 100644 --- a/.github/workflows/semver-release.yml +++ b/.github/workflows/semver-release.yml @@ -31,7 +31,8 @@ jobs: - 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 + # Checks commit from latest tag on this branch + run: npx commitlint --from $(git describe --tags) --to HEAD --verbose - name: Release env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 80a0fc1bad2b0f672ad0ee5c28b6f1dae78cc64d Mon Sep 17 00:00:00 2001 From: Nargonath Date: Thu, 22 Feb 2024 23:36:23 +0100 Subject: [PATCH 06/21] build(semantic-release): fix branches config --- .releaserc.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.releaserc.json b/.releaserc.json index fbd687d..db2c959 100644 --- a/.releaserc.json +++ b/.releaserc.json @@ -1,5 +1,5 @@ { - "branches": ["main", { "name": "beta", "prerelease": true }], + "branches": ["master", { "name": "beta", "prerelease": true }], "plugins": [ "@semantic-release/commit-analyzer", "@semantic-release/release-notes-generator", From 9cd847fe9a0c878ea77c8fbc515d49ebb9e11278 Mon Sep 17 00:00:00 2001 From: Nargonath Date: Sun, 25 Feb 2024 20:52:06 +0100 Subject: [PATCH 07/21] ci(commitlint): fix boundaries for linting --- .github/workflows/semver-release.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/semver-release.yml b/.github/workflows/semver-release.yml index 3cb004c..abebf9e 100644 --- a/.github/workflows/semver-release.yml +++ b/.github/workflows/semver-release.yml @@ -32,7 +32,9 @@ jobs: run: npm i -D @semantic-release/git @semantic-release/changelog @commitlint/{cli,config-conventional} commitlint - name: Check commit format # Checks commit from latest tag on this branch - run: npx commitlint --from $(git describe --tags) --to HEAD --verbose + # run: npx commitlint --from $(git describe --tags) --to HEAD --verbose + # TODO: replace this line with the one above once we published our first semver tag + run: npx commitlint --from 3a7bc32 --to HEAD --verbose - name: Release env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 5ad34d5628a993dca63d4e2ad64e1abe10e7b5fe Mon Sep 17 00:00:00 2001 From: Nargonath Date: Sun, 25 Feb 2024 21:05:34 +0100 Subject: [PATCH 08/21] ci(test): enable test action --- .github/workflows/test.yml | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 .github/workflows/test.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..5a70c6d --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,31 @@ +name: Test + +on: [pull_request] + +jobs: + commitlint: + runs-on: ubuntu-22.04 + steps: + - name: Fetch codebase + uses: actions/checkout@v3 + with: + fetch-depth: 0 + - name: Setup node + uses: actions/setup-node@v3 + with: + node-version: "20.x" + - name: Install dependencies + run: npm i -D @semantic-release/git @semantic-release/changelog @commitlint/{cli,config-conventional} commitlint + - name: Validate PR commits with commitlint + run: npx commitlint --from ${{ github.event.pull_request.head.sha }}~${{ github.event.pull_request.commits }} --to ${{ github.event.pull_request.head.sha }} --verbose + + test: + runs-on: ubuntu-22.04 + steps: + - name: Fetch codebase + uses: actions/checkout@v3 + with: + fetch-depth: 0 + # TODO: Run Go tests + # - name: Test + # run: From de2e9e5459c7e785b79364e3eb525ba12fab42be Mon Sep 17 00:00:00 2001 From: Nargonath Date: Sun, 25 Feb 2024 21:19:54 +0100 Subject: [PATCH 09/21] ci(semantic-release): remove dry-run mode --- .github/workflows/semver-release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/semver-release.yml b/.github/workflows/semver-release.yml index abebf9e..d48f0b6 100644 --- a/.github/workflows/semver-release.yml +++ b/.github/workflows/semver-release.yml @@ -38,4 +38,4 @@ jobs: - name: Release env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: npx semantic-release --dry-run + run: npx semantic-release From f97868ab2cd788af46e7a5ce0b012b2d875f8cff Mon Sep 17 00:00:00 2001 From: Nargonath Date: Sun, 25 Feb 2024 21:31:48 +0100 Subject: [PATCH 10/21] ci(commitlint): adjust commits diff for lint --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 5a70c6d..18a1384 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -17,7 +17,7 @@ jobs: - name: Install dependencies run: npm i -D @semantic-release/git @semantic-release/changelog @commitlint/{cli,config-conventional} commitlint - name: Validate PR commits with commitlint - run: npx commitlint --from ${{ github.event.pull_request.head.sha }}~${{ github.event.pull_request.commits }} --to ${{ github.event.pull_request.head.sha }} --verbose + run: npx commitlint --from ${{ github.event.pull_request.head.sha }}~${{ github.event.pull_request.commits - 1 }} --to ${{ github.event.pull_request.head.sha }} --verbose test: runs-on: ubuntu-22.04 From a1103c5f698d6cfcf5f995ff2803d3e1fd297e95 Mon Sep 17 00:00:00 2001 From: Nargonath Date: Sun, 25 Feb 2024 21:37:35 +0100 Subject: [PATCH 11/21] ci(commitlint): try different format for bash calculation --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 18a1384..06796d9 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -17,7 +17,7 @@ jobs: - name: Install dependencies run: npm i -D @semantic-release/git @semantic-release/changelog @commitlint/{cli,config-conventional} commitlint - name: Validate PR commits with commitlint - run: npx commitlint --from ${{ github.event.pull_request.head.sha }}~${{ github.event.pull_request.commits - 1 }} --to ${{ github.event.pull_request.head.sha }} --verbose + run: npx commitlint --from ${{ github.event.pull_request.head.sha }}~$(( ${{ github.event.pull_request.commits }} - 1 )) --to ${{ github.event.pull_request.head.sha }} --verbose test: runs-on: ubuntu-22.04 From 7cf6b89b6a9b20b5a323376d35b59945b9cef286 Mon Sep 17 00:00:00 2001 From: Nargonath Date: Sun, 25 Feb 2024 21:47:30 +0100 Subject: [PATCH 12/21] ci(commitlint): remove calculation in commit boundary --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 06796d9..5a70c6d 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -17,7 +17,7 @@ jobs: - name: Install dependencies run: npm i -D @semantic-release/git @semantic-release/changelog @commitlint/{cli,config-conventional} commitlint - name: Validate PR commits with commitlint - run: npx commitlint --from ${{ github.event.pull_request.head.sha }}~$(( ${{ github.event.pull_request.commits }} - 1 )) --to ${{ github.event.pull_request.head.sha }} --verbose + run: npx commitlint --from ${{ github.event.pull_request.head.sha }}~${{ github.event.pull_request.commits }} --to ${{ github.event.pull_request.head.sha }} --verbose test: runs-on: ubuntu-22.04 From ebb758e84114aee73eba566d78949ba0147276e2 Mon Sep 17 00:00:00 2001 From: Nargonath Date: Sun, 25 Feb 2024 22:01:12 +0100 Subject: [PATCH 13/21] ci(commitlint): try another way of from boundary --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 5a70c6d..6a98450 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -17,7 +17,7 @@ jobs: - name: Install dependencies run: npm i -D @semantic-release/git @semantic-release/changelog @commitlint/{cli,config-conventional} commitlint - name: Validate PR commits with commitlint - run: npx commitlint --from ${{ github.event.pull_request.head.sha }}~${{ github.event.pull_request.commits }} --to ${{ github.event.pull_request.head.sha }} --verbose + run: npx commitlint --from $GITHUB_SHA --to ${{ github.event.pull_request.head.sha }} --verbose test: runs-on: ubuntu-22.04 From 99218c675c1ae2d5f711cb976e4a2ae6b47549c9 Mon Sep 17 00:00:00 2001 From: Nargonath Date: Sun, 25 Feb 2024 22:05:28 +0100 Subject: [PATCH 14/21] ci(commitlint): use context format for GITHUB_SHA --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 6a98450..67a7347 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -17,7 +17,7 @@ jobs: - name: Install dependencies run: npm i -D @semantic-release/git @semantic-release/changelog @commitlint/{cli,config-conventional} commitlint - name: Validate PR commits with commitlint - run: npx commitlint --from $GITHUB_SHA --to ${{ github.event.pull_request.head.sha }} --verbose + run: npx commitlint --from ${{ github.sha }} --to ${{ github.event.pull_request.head.sha }} --verbose test: runs-on: ubuntu-22.04 From 1cca0228af35cf531a29ddb0c7818ef3bae6bb6c Mon Sep 17 00:00:00 2001 From: Nargonath Date: Sun, 25 Feb 2024 22:28:30 +0100 Subject: [PATCH 15/21] ci(commitlint): reuse range for from boundary --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 67a7347..5a70c6d 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -17,7 +17,7 @@ jobs: - name: Install dependencies run: npm i -D @semantic-release/git @semantic-release/changelog @commitlint/{cli,config-conventional} commitlint - name: Validate PR commits with commitlint - run: npx commitlint --from ${{ github.sha }} --to ${{ github.event.pull_request.head.sha }} --verbose + run: npx commitlint --from ${{ github.event.pull_request.head.sha }}~${{ github.event.pull_request.commits }} --to ${{ github.event.pull_request.head.sha }} --verbose test: runs-on: ubuntu-22.04 From 06fa2b01321abfc0526691fac112ba639997e602 Mon Sep 17 00:00:00 2001 From: Nargonath Date: Sun, 25 Feb 2024 22:45:59 +0100 Subject: [PATCH 16/21] ci(commitlint): use head_ref as from boundary --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 5a70c6d..4d0b985 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -17,7 +17,7 @@ jobs: - name: Install dependencies run: npm i -D @semantic-release/git @semantic-release/changelog @commitlint/{cli,config-conventional} commitlint - name: Validate PR commits with commitlint - run: npx commitlint --from ${{ github.event.pull_request.head.sha }}~${{ github.event.pull_request.commits }} --to ${{ github.event.pull_request.head.sha }} --verbose + run: npx commitlint --from ${{ github.head_ref }} --to ${{ github.event.pull_request.head.sha }} --verbose test: runs-on: ubuntu-22.04 From cfaef496339c4950a6eaffee67ffc3ca7348544c Mon Sep 17 00:00:00 2001 From: Nargonath Date: Sun, 25 Feb 2024 22:50:50 +0100 Subject: [PATCH 17/21] ci(commitlint): use base_ref as from boundary --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 4d0b985..978090d 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -17,7 +17,7 @@ jobs: - name: Install dependencies run: npm i -D @semantic-release/git @semantic-release/changelog @commitlint/{cli,config-conventional} commitlint - name: Validate PR commits with commitlint - run: npx commitlint --from ${{ github.head_ref }} --to ${{ github.event.pull_request.head.sha }} --verbose + run: npx commitlint --from ${{ github.base_ref }} --to ${{ github.event.pull_request.head.sha }} --verbose test: runs-on: ubuntu-22.04 From e95387099c02b2ca24aeace2de00f1e49a83287b Mon Sep 17 00:00:00 2001 From: Nargonath Date: Sun, 25 Feb 2024 22:56:02 +0100 Subject: [PATCH 18/21] ci(commitlint): remove fetch-depth limitation --- .github/workflows/test.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 978090d..6a592fa 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -8,8 +8,6 @@ jobs: steps: - name: Fetch codebase uses: actions/checkout@v3 - with: - fetch-depth: 0 - name: Setup node uses: actions/setup-node@v3 with: From a15d55402af5d415607bce20d8688c238c1bcbfa Mon Sep 17 00:00:00 2001 From: Nargonath Date: Sun, 25 Feb 2024 23:00:56 +0100 Subject: [PATCH 19/21] ci(commitlint): retry with tilde and no depth limitation --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 6a592fa..9e38621 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -15,7 +15,7 @@ jobs: - name: Install dependencies run: npm i -D @semantic-release/git @semantic-release/changelog @commitlint/{cli,config-conventional} commitlint - name: Validate PR commits with commitlint - run: npx commitlint --from ${{ github.base_ref }} --to ${{ github.event.pull_request.head.sha }} --verbose + run: npx commitlint --from ${{ github.event.pull_request.head.sha }}~${{ github.event.pull_request.commits }} --to ${{ github.event.pull_request.head.sha }} --verbose test: runs-on: ubuntu-22.04 From f644c11f9de1b6c9200fa5dcb4f977edfd089137 Mon Sep 17 00:00:00 2001 From: Nargonath Date: Sun, 25 Feb 2024 23:04:45 +0100 Subject: [PATCH 20/21] ci(commitlint): use base.sha for from boundary --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 9e38621..3d80e0d 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -15,7 +15,7 @@ jobs: - name: Install dependencies run: npm i -D @semantic-release/git @semantic-release/changelog @commitlint/{cli,config-conventional} commitlint - name: Validate PR commits with commitlint - run: npx commitlint --from ${{ github.event.pull_request.head.sha }}~${{ github.event.pull_request.commits }} --to ${{ github.event.pull_request.head.sha }} --verbose + run: npx commitlint --from ${{ github.event.pull_request.base.sha }} --to ${{ github.event.pull_request.head.sha }} --verbose test: runs-on: ubuntu-22.04 From 31654d0e6ccf4cb6a5c369720c016f7a37d8f4a5 Mon Sep 17 00:00:00 2001 From: Nargonath Date: Sun, 25 Feb 2024 23:06:55 +0100 Subject: [PATCH 21/21] ci(commitlint): add fetch-depth limit back --- .github/workflows/test.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 3d80e0d..c7a68bf 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -8,6 +8,8 @@ jobs: steps: - name: Fetch codebase uses: actions/checkout@v3 + with: + fetch-depth: 0 - name: Setup node uses: actions/setup-node@v3 with: