Skip to content

Commit 96cc779

Browse files
authored
ci: Modifies release action (#960)
1 parent 7621f8c commit 96cc779

File tree

5 files changed

+45
-44
lines changed

5 files changed

+45
-44
lines changed

.github/workflows/create-release.yml

Lines changed: 36 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -18,24 +18,42 @@ jobs:
1818
- name: Checkout
1919
uses: actions/checkout@v4
2020

21-
- name: Conventional Changelog Action
22-
id: changelog
23-
uses: TriPSs/conventional-changelog-action@v5
21+
- uses: codfish/semantic-release-action@v3
22+
id: semantic
2423
with:
25-
github-token: ${{ secrets.GITHUB_TOKEN }}
26-
output-file: 'CHANGELOG.md'
27-
git-user-name: 'github-actions[bot]'
28-
git-user-email: 'github-actions[bot]@users.noreply.github.com'
29-
version-file: './pyproject.toml'
30-
version-path: 'tool.poetry.version'
31-
24+
tag-format: 'v${version}'
25+
additional-packages: |
26+
['conventional-changelog-conventionalcommits@7']
27+
plugins: |
28+
[
29+
'@semantic-release/commit-analyzer',
30+
[
31+
"@semantic-release/release-notes-generator",
32+
{
33+
"preset": "conventionalcommits",
34+
"presetConfig": {
35+
"types": [
36+
{ type: 'feat', section: 'Features', hidden: false },
37+
{ type: 'fix', section: 'Bug Fixes', hidden: false },
38+
{ type: 'perf', section: 'Performance Improvements', hidden: false },
39+
{ type: 'revert', section: 'Reverts', hidden: false },
40+
{ type: 'docs', section: 'Other Updates', hidden: false },
41+
{ type: 'style', section: 'Other Updates', hidden: false },
42+
{ type: 'chore', section: 'Other Updates', hidden: false },
43+
{ type: 'refactor', section: 'Other Updates', hidden: false },
44+
{ type: 'test', section: 'Other Updates', hidden: false },
45+
{ type: 'build', section: 'Other Updates', hidden: false },
46+
{ type: 'ci', section: 'Other Updates', hidden: false }
47+
]
48+
}
49+
}
50+
],
51+
'@semantic-release/github'
52+
]
53+
env:
54+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
55+
- run: echo ${{ steps.semantic.outputs.release-version }}
3256

33-
- name: Create Release
34-
uses: actions/create-release@v1
35-
if: ${{ steps.changelog.outputs.skipped == 'false' }}
57+
- run: echo "$OUTPUTS"
3658
env:
37-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
38-
with:
39-
tag_name: ${{ steps.changelog.outputs.tag }}
40-
release_name: ${{ steps.changelog.outputs.tag }}
41-
body: ${{ steps.changelog.outputs.clean_changelog }}
59+
OUTPUTS: ${{ toJson(steps.semantic.outputs) }}

CHANGELOG.md

Lines changed: 0 additions & 24 deletions
This file was deleted.

docs/RELEASE_GUIDELINES.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@ Once a PR is merged to `main`, the Action will automatically run. It will automa
3030

3131
Once a merge to `main` is completed that would result in a major/minor/patch version increase (such as `feat`, `fix`, etc.) then a changelog will be generated, and this will trigger a release to be published automatically with the appropriate version number.
3232

33-
The workflow is configured so that the `CHANGELOG.md` is continuously updated. The Action by default uses the `package.json` version, which it also automatically updates.
33+
By default, `semantic-release` only includes `fix`, `feat`, and `perf` commit types in the release. Our project includes all commit types in their release notes, while still using `semantic-release`'s commit analyzer to only create releases for `fix`, `feat`, and `perf` commits.
34+
35+
Note that, it is not possible to automate the update of a `CHANGELOG` as this would require the GitHub token to have permissions to push commits to the repository, which cannot be enabled.
3436

3537
## Security
3638

docs/design/adrs/2024-05-02-enable-project-versioning.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,6 @@ Pros:
6060
- When introducing automated versioning, there are a few things we need to consider:
6161
- **major/minor/patch** versions: Each release is tagged with a semantic version which is based on the change included (e.g. breaking change, feature, bug fix).
6262
- **Changelog**: A changelog must be included which details the changes that are included in the release.
63-
- The [**conventional-changelog-action**](https://github.com/TriPSs/conventional-changelog-action) GitHub Action automates releases. It looks at commit messages to automatically generate the version number and to generate the changelog.
63+
- The [**semantic-release-action**](https://github.com/codfish/semantic-release-action?tab=readme-ov-file#semantic-release-action) GitHub Action automates releases. It looks at commit messages to automatically generate the version number and to generate the changelog.
6464
- It uses [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/), meaning we'd need to follow a convention of labelling PRs with `fix`/`feat`/`BREAKING CHANGE`, etc, in order to be picked up by the release generator. It uses these labels to create the correct version.
6565
- As a consequence, current dependabot PRs would not trigger a release PR. These would be in main until an automatic or manual release was triggered.

package.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"name": "chat-with-your-data",
3+
"version": "1.1.0",
4+
"private": true
5+
}

0 commit comments

Comments
 (0)