Skip to content

Commit

Permalink
Merge pull request #1 from ronati/add-semantic-release
Browse files Browse the repository at this point in the history
Add semantic release
  • Loading branch information
Nargonath authored Feb 22, 2024
2 parents 3a7bc32 + 3222448 commit 20c3622
Show file tree
Hide file tree
Showing 6 changed files with 70 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
# - https://blog.github.com/2017-07-06-introducing-code-owners/

# The default owner
* @KeisukeYamashita
* @Nargonath @adanylenko
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
39 changes: 39 additions & 0 deletions .github/workflows/semver-release.yml
Original file line number Diff line number Diff line change
@@ -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
10 changes: 10 additions & 0 deletions .releaserc.json
Original file line number Diff line number Diff line change
@@ -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"
]
}
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
7 changes: 7 additions & 0 deletions commitlint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
module.exports = {
extends: ["@commitlint/config-conventional"],
ignores: [(commit) => commit.startsWith("chore(release)")],
rules: {
"body-max-line-length": [0],
},
};

0 comments on commit 20c3622

Please sign in to comment.