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 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: 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], + }, +};