-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 8adf678
Showing
7 changed files
with
439 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
name: Release | ||
|
||
on: | ||
push: | ||
branches: [ "main" ] | ||
env: | ||
FORCE_COLOR: 1 | ||
|
||
jobs: | ||
release: | ||
runs-on: ubuntu-latest | ||
concurrency: | ||
group: release | ||
environment: | ||
name: pypi | ||
url: https://pypi.org/p/cz-changeup | ||
permissions: | ||
id-token: write | ||
contents: write | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Run commitizen | ||
if: ${{ !startsWith(github.event.head_commit.message, 'bump:') }} | ||
id: cz | ||
uses: commitizen-tools/commitizen-action@master | ||
with: | ||
extra_requirements : "." | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
changelog_increment_filename: body.md | ||
|
||
- name: Build package distributions | ||
id: build | ||
if: env.REVISION != env.PREVIOUS_REVISION | ||
run: | | ||
pipx run build | ||
- name: Publish package distributions to PyPI | ||
id: pypi-publish | ||
if: env.REVISION != env.PREVIOUS_REVISION | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
with: | ||
verbose: true | ||
|
||
- name: Publish package distributions to GitHub Releases | ||
id: github-release | ||
if: env.REVISION != env.PREVIOUS_REVISION | ||
uses: softprops/action-gh-release@v2 | ||
with: | ||
body_path: "body.md" | ||
tag_name: v${{ steps.cz.outputs.version }} | ||
token: ${{ secrets.GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
ci: | ||
autoupdate_commit_msg: "ci(pre-commit): pre-commit autoupdate" | ||
autofix_commit_msg: "style: pre-commit auto fixes [...]" | ||
autoupdate_schedule: monthly | ||
|
||
default_install_hook_types: [pre-commit, commit-msg] | ||
|
||
repos: | ||
|
||
# Meta hooks | ||
- repo: meta | ||
hooks: | ||
- id: check-hooks-apply | ||
- id: check-useless-excludes | ||
|
||
# Security & credential scanning/alerting | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v4.6.0 | ||
hooks: | ||
- id: check-ast | ||
- id: check-builtin-literals | ||
- id: check-case-conflict | ||
- id: check-merge-conflict | ||
- id: check-toml | ||
- id: check-vcs-permalinks | ||
- id: check-yaml | ||
- id: debug-statements | ||
- id: detect-private-key | ||
- id: end-of-file-fixer | ||
- id: mixed-line-ending | ||
- id: trailing-whitespace | ||
|
||
# Lint and format with ruff | ||
- repo: https://github.com/astral-sh/ruff-pre-commit | ||
# Ruff version. | ||
rev: v0.5.6 | ||
hooks: | ||
# Run the linter. | ||
- id: ruff | ||
args: [ --fix ] | ||
# Run the formatter. | ||
- id: ruff-format | ||
|
||
# # Commitizen | ||
# - repo: https://github.com/commitizen-tools/commitizen | ||
# rev: v3.28.0 | ||
# hooks: | ||
# - id: commitizen | ||
# - id: commitizen-branch | ||
# stages: [push] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# cz-changeup | ||
|
||
This plugin is a version of | ||
[Commitizen](https://commitizen-tools.github.io/commitizen/)'s default conventional | ||
style with a more informative changelog format. | ||
|
||
## Installation | ||
|
||
```bash | ||
pip install cz-changeup | ||
``` | ||
|
||
## Configuration | ||
|
||
Add to your `pyproject.toml`: | ||
|
||
```toml | ||
[tool.commitizen] | ||
name = "cz_changeup" | ||
``` | ||
|
||
The behavior of the plugin can be customized by providing the following options under `tool.commitizen`: | ||
|
||
| Option | Description | Default | Example | | ||
| ------------------------ | ----------------------------------------------------------------------------------------------------- | ------- | ------------------------------ | | ||
| `changeup_repo_base_url` | The base URL for the repository. If given, adds a link to the commit for each entry in the changelog. | `""` | `"https://github.com/my/repo"` | | ||
| `changeup_show_body` | Whether to include the commit body in the changelog. | `true` | | | ||
| `changeup_body_indent` | The number of spaces to indent the commit body if `show_body` is set to `true`. | `2` | | |
Oops, something went wrong.