Skip to content

Commit

Permalink
Merge branch 'main' into support-count-tags
Browse files Browse the repository at this point in the history
  • Loading branch information
tisonkun committed Jun 9, 2024
2 parents 63cffa7 + 832edbc commit 1853a5c
Show file tree
Hide file tree
Showing 57 changed files with 6,520 additions and 3,638 deletions.
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
name: GitHub Integration ⚙️
description: Report a bug or request a feature about GitHub integration
labels: ['github_integration']
assignees:
name: Integration ⚙️
description: Report a bug or request a feature about an integration (e.g GitHub/GitLab/Bitbucket)
labels: ["integration"]
assignees:
- orhun
body:
- type: markdown
attributes:
value: |
Thanks for taking the time to fill out this bug report!
Please see https://git-cliff.org/docs/integration/github for more information about GitHub integration.
Please see https://git-cliff.org/docs/category/integration for more information about integrations.
- type: checkboxes
id: new-bug
attributes:
Expand Down
46 changes: 46 additions & 0 deletions .github/fixtures/test-bitbucket-integration/cliff.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
[remote.bitbucket]
owner = "orhunp"
repo = "git-cliff-readme-example"

[changelog]
# template for the changelog body
# https://keats.github.io/tera/docs/#introduction
body = """
## What's Changed
{%- if version %} in {{ version }}{%- endif -%}
{% for commit in commits %}
* {{ commit.message | split(pat="\n") | first | trim }}\
{% if commit.bitbucket.username %} by @{{ commit.bitbucket.username }}{%- endif -%}
{% if commit.bitbucket.pr_number %} in #{{ commit.bitbucket.pr_number }}{%- endif %}
{%- endfor -%}
{% if bitbucket.contributors | filter(attribute="is_first_time", value=true) | length != 0 %}
{% raw %}\n{% endraw -%}
## New Contributors
{%- endif %}\
{% for contributor in bitbucket.contributors | filter(attribute="is_first_time", value=true) %}
* @{{ contributor.username }} made their first contribution
{%- if contributor.pr_number %} in \
[#{{ contributor.pr_number }}]({{ self::remote_url() }}/pull/{{ contributor.pr_number }}) \
{%- endif %}
{%- endfor -%}
{% raw %}\n\n{% endraw -%}
"""
# remove the leading and trailing whitespace from the template
trim = true
# changelog footer
footer = """
<!-- generated by -cliff -->
"""

[git]
# parse the commits based on https://www.conventionalcommits.org
conventional_commits = false
# filter out the commits that are not conventional
filter_unconventional = true
# process each line of a commit as an individual commit
split_commits = false
# regex for preprocessing the commit messages
commit_preprocessors = [{ pattern = '\((\w+\s)?#([0-9]+)\)', replace = "" }]
# protect breaking changes from being skipped due to matching a skipping commit_parser
protect_breaking_commits = false
6 changes: 6 additions & 0 deletions .github/fixtures/test-bitbucket-integration/commit.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/usr/bin/env bash
set -e

git remote add origin https://bitbucket.org/orhunp/git-cliff-readme-example
git pull origin master
git fetch --tags
16 changes: 16 additions & 0 deletions .github/fixtures/test-bitbucket-integration/expected.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
## What's Changed
* feat(config): support multiple file formats by @orhun <orhun@archlinux.org>
* feat(cache): use cache while fetching pages by @orhun <orhun@archlinux.org>

## What's Changed in v1.0.1
* refactor(parser): expose string functions by @orhun <orhun@archlinux.org>
* chore(release): add release script by @orhun <orhun@archlinux.org>

## What's Changed in v1.0.0
* Initial commit by @orhun <orhun@archlinux.org>
* docs(project): add README.md by @orhun <orhun@archlinux.org>
* feat(parser): add ability to parse arrays by @orhun <orhun@archlinux.org>
* fix(args): rename help argument due to conflict by @orhun <orhun@archlinux.org>
* docs(example)!: add tested usage example by @orhun <orhun@archlinux.org>

<!-- generated by -cliff -->
5 changes: 4 additions & 1 deletion .github/fixtures/test-github-integration/cliff.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,10 @@ body = """
## New Contributors
{%- endif %}\
{% for contributor in github.contributors | filter(attribute="is_first_time", value=true) %}
* @{{ contributor.username }} made their first contribution in #{{ contributor.pr_number }}
* @{{ contributor.username }} made their first contribution
{%- if contributor.pr_number %} in \
[#{{ contributor.pr_number }}]({{ self::remote_url() }}/pull/{{ contributor.pr_number }}) \
{%- endif %}
{%- endfor -%}
{% if version %}
Expand Down
54 changes: 54 additions & 0 deletions .github/fixtures/test-gitlab-integration/cliff.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
[remote.gitlab]
owner = "dark0dave"
repo = "dotfiles"

[changelog]
# template for the changelog body
# https://keats.github.io/tera/docs/#introduction
body = """
## What's Changed
{%- if version %} in {{ version }}{%- endif -%}
{% for commit in commits %}
* {{ commit.message | split(pat="\n") | first | trim }}\
{% if commit.gitlab.username %} by @{{ commit.gitlab.username }}{%- endif -%}
{% if commit.gitlab.pr_number %} in #{{ commit.gitlab.pr_number }}{%- endif %}
{%- endfor -%}
{% if gitlab.contributors | filter(attribute="is_first_time", value=true) | length != 0 %}
{% raw %}\n{% endraw -%}
## New Contributors
{%- endif %}\
{% for contributor in gitlab.contributors | filter(attribute="is_first_time", value=true) %}
* @{{ contributor.username }} made their first contribution
{%- if contributor.pr_number %} in \
[#{{ contributor.pr_number }}]({{ self::remote_url() }}/pull/{{ contributor.pr_number }}) \
{%- endif %}
{%- endfor -%}
{% if version %}
{% if previous.version %}
**Full Changelog**: https://gitlab.com/{{ remote.gitlab.owner }}/{{ remote.gitlab.repo }}/compare/{{ previous.version }}...{{ version }}
{% endif %}
{% else -%}
{% raw %}\n{% endraw %}
{% endif %}
"""
# remove the leading and trailing whitespace from the template
trim = true
# changelog footer
footer = """\n
<!-- generated by git-cliff -->
"""

[git]
# parse the commits based on https://www.conventionalcommits.org
conventional_commits = false
# filter out the commits that are not conventional
filter_unconventional = true
# process each line of a commit as an individual commit
split_commits = false
# regex for preprocessing the commit messages
commit_preprocessors = [{ pattern = '\((\w+\s)?#([0-9]+)\)', replace = "" }]
# protect breaking changes from being skipped due to matching a skipping commit_parser
protect_breaking_commits = false
7 changes: 7 additions & 0 deletions .github/fixtures/test-gitlab-integration/commit.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env bash
set -e

git remote add origin https://gitlab.com/dark0dave/dotfiles
git pull origin main
git fetch --tags
git checkout 3c048a1
18 changes: 18 additions & 0 deletions .github/fixtures/test-gitlab-integration/expected.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
## What's Changed
* Initial commit by @dark0dave
* Added tmux files by @dark0dave
* Updated readme by @dark0dave
* Updated readme and added zshrc files by @dark0dave
* Added python files by @dark0dave
* Added curl files by @dark0dave
* Zsh update by @dark0dave
* Update README.md by @dark0dave
* Fix for path by @dark0dave
* Update README.md by @dark0dave
* Started setup files by @dark0dave
* Updated tmux to be a little nicer by @dark0dave
* Merge branch 'feature/tmux-improvements' into 'master' by @dark0dave in #2



<!-- generated by git-cliff -->
9 changes: 5 additions & 4 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ jobs:
TOOLCHAIN: stable,
TARGET: x86_64-pc-windows-gnu,
NPM_PUBLISH: false,
PYPI_PUBLISH: true,
PYPI_PUBLISH: false,
}
- {
NAME: win32-x64-msvc,
Expand Down Expand Up @@ -115,15 +115,15 @@ jobs:
}
- {
NAME: darwin-x64,
OS: macos-12,
OS: macos-14,
TOOLCHAIN: stable,
TARGET: x86_64-apple-darwin,
NPM_PUBLISH: true,
PYPI_PUBLISH: true,
}
- {
NAME: darwin-arm64,
OS: macos-12,
OS: macos-14,
TOOLCHAIN: stable,
TARGET: aarch64-apple-darwin,
NPM_PUBLISH: true,
Expand Down Expand Up @@ -189,7 +189,7 @@ jobs:
> git-cliff-${{ env.RELEASE_VERSION }}-${{ matrix.build.TARGET }}.tar.gz.sha512
fi
- name: Sign the release
if: matrix.build.OS == 'ubuntu-22.04' || matrix.build.OS == 'macos-12'
if: matrix.build.OS == 'ubuntu-22.04' || matrix.build.OS == 'macos-14'
run: |
echo "${{ secrets.GPG_RELEASE_KEY }}" | base64 --decode > private.key
echo "${{ secrets.GPG_PASSPHRASE }}" | gpg --pinentry-mode=loopback \
Expand Down Expand Up @@ -309,6 +309,7 @@ jobs:
yarn install
yarn build
cp ../../README.md .
cp ../../CHANGELOG.md .
if [ ${{ contains(github.ref, '-') }} = "true" ]; then
yarn npm publish --tag rc
else
Expand Down
53 changes: 42 additions & 11 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -124,17 +124,6 @@ jobs:
fail: true
token: ${{ secrets.GITHUB_TOKEN }}

audit:
name: Audit check
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Run cargo-audit
uses: actions-rs/audit-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}

msrv:
name: Check Rust version
runs-on: ubuntu-22.04
Expand All @@ -152,3 +141,45 @@ jobs:
printf "Checking MSRV for $package..."
cargo msrv --output-format json --path "$package" verify | tail -n 1 | jq --exit-status '.success'
done
tarball:
name: Check NodeJS tarball
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install node
uses: actions/setup-node@v4
with:
node-version: 18
registry-url: "https://registry.npmjs.org"
- name: Validate the files in the tarball
shell: bash
working-directory: npm/git-cliff
run: |
yarn install
yarn build
cp ../../README.md .
cp ../../CHANGELOG.md .
files_expected_in_tarball=(
"CHANGELOG.md"
"README.md"
"lib/cjs/index.cjs"
"lib/cjs/index.cjs.map"
"lib/cjs/index.d.cts"
"lib/cli/cli.js"
"lib/esm/index.d.ts"
"lib/esm/index.js"
"lib/esm/index.js.map"
"package.json"
)
tarball_output=$(yarn pack --dry-run)
for file in "${files_expected_in_tarball[@]}"; do
if [[ ! "$tarball_output" == *"$file"* ]]; then
echo "Error: Expected file '$file' not found in tarball."
exit 1
fi
done
1 change: 1 addition & 0 deletions .lycheeignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ https://github.com/cocogitto/cocogitto
pypi.org
https://console.substack.com
git-cliff/commit/
patreon
66 changes: 66 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,71 @@
[![animation](https://raw.githubusercontent.com/orhun/git-cliff/main/website/static/img/git-cliff-anim.gif)](https://git-cliff.org)

## [2.3.0](https://github.com/orhun/git-cliff/compare/v2.2.2..v2.3.0) - 2024-06-03

### ⛰️ Features

- *(bitbucket)* Add Bitbucket support ([#663](https://github.com/orhun/git-cliff/issues/663)) - ([8ffc054](https://github.com/orhun/git-cliff/commit/8ffc0548fe0fd8930627412fecb9bc08a7879504))
- *(gitlab)* [**breaking**] Add GitLab support ([#654](https://github.com/orhun/git-cliff/issues/654)) - ([b490f2a](https://github.com/orhun/git-cliff/commit/b490f2a24e3ebeb6ee54382ce9aa642ecff17b01))
- *(output)* Support using stdout via dash (`-o -`) ([#644](https://github.com/orhun/git-cliff/issues/644)) - ([df81f63](https://github.com/orhun/git-cliff/commit/df81f636f53e63d305d06944ff014a21612cb666))

### 🐛 Bug Fixes

- *(args)* Allow -o and -p together if they point to different files ([#653](https://github.com/orhun/git-cliff/issues/653)) - ([076f859](https://github.com/orhun/git-cliff/commit/076f85915386c4769c838ca9a359d216249d2a97))

### 📚 Documentation

- *(nix)* Add installation instructions for Nix ([#669](https://github.com/orhun/git-cliff/issues/669)) - ([63c8ad4](https://github.com/orhun/git-cliff/commit/63c8ad43e9ecaa825ef1f0a67164265497f3a1dd))
- *(website)* Add highlights for 2.3.0 ([#670](https://github.com/orhun/git-cliff/issues/670)) - ([1338703](https://github.com/orhun/git-cliff/commit/1338703a2aedb4116dcae849ada4941432f57e74))
- *(website)* Clean up Nix docs - ([2c2a300](https://github.com/orhun/git-cliff/commit/2c2a300616fa151b91858a2a7d88bdc9b9dae497))
- *(website)* Add more git range examples ([#655](https://github.com/orhun/git-cliff/issues/655)) - ([d451252](https://github.com/orhun/git-cliff/commit/d4512521fbcfb971c94aa7794d78bced1ddec7a1))

### ⚙️ Miscellaneous Tasks

- *(cd)* Use macos-14 runner - ([22c94ed](https://github.com/orhun/git-cliff/commit/22c94ed8355d71a5fe99d8c1e9c8a3824338debf))
- *(example)* Allow using github template without github variables ([#672](https://github.com/orhun/git-cliff/issues/672)) - ([6a9feba](https://github.com/orhun/git-cliff/commit/6a9feba98f36de1980bab313f6b0a861f5009d71))
- *(links)* Ignore patreon links - ([bfe2774](https://github.com/orhun/git-cliff/commit/bfe27744701296185d2f1d37dba7cfb48bd70519))
- *(npm)* Update yarn.lock - ([1c2b4ac](https://github.com/orhun/git-cliff/commit/1c2b4ac85b49f62ae6f19660e7e47b3bc24a5cae))

## [2.2.2](https://github.com/orhun/git-cliff/compare/v2.2.1..v2.2.2) - 2024-05-11

### ⛰️ Features

- *(changelog)* Allow adding custom context ([#613](https://github.com/orhun/git-cliff/issues/613)) - ([522bd53](https://github.com/orhun/git-cliff/commit/522bd536a4ad63dfbfbaebcac8a92202b32b202f))

### 🐛 Bug Fixes

- *(changelog)* Ignore empty lines when using `split_commits` ([#608](https://github.com/orhun/git-cliff/issues/608)) - ([b8fb852](https://github.com/orhun/git-cliff/commit/b8fb85220e86138ad8b129ebf1e0599ce8aa5938))
- *(parser)* Allow matching empty commit body ([#605](https://github.com/orhun/git-cliff/issues/605)) - ([1d1b3b8](https://github.com/orhun/git-cliff/commit/1d1b3b80e163baf34113456f24e3fbbc203e355d))

### 📚 Documentation

- *(readme)* Add social media badges - ([d53b905](https://github.com/orhun/git-cliff/commit/d53b9051840b46f41ccaeca6de3c37c1379a6e5a))
- *(website)* Add note about supported platforms for NPM - ([4e4d7cd](https://github.com/orhun/git-cliff/commit/4e4d7cdbfced3618bdfaf392dbe0a3f4bbbba799))
- *(website)* Add SourceHut builds example ([#617](https://github.com/orhun/git-cliff/issues/617)) - ([f636cfc](https://github.com/orhun/git-cliff/commit/f636cfc5ce0fdbe07d9010c1690876abcc017d29))

### ⚙️ Miscellaneous Tasks

- *(npm)* Add minimum supported Node versions ([#621](https://github.com/orhun/git-cliff/issues/621)) - ([95bdf2d](https://github.com/orhun/git-cliff/commit/95bdf2db3724715f76a7b649367541ace5ca9d1f))
- *(npm)* Update yarn.lock - ([adc5c5b](https://github.com/orhun/git-cliff/commit/adc5c5ba876281cdeab0d7e7150a32d959f90886))
- *(pypi)* Disable PyPi builds for x86_64-pc-windows-gnu - ([f675b0b](https://github.com/orhun/git-cliff/commit/f675b0b5bdbe57437e39dbe4c0b78e7c4f373936))
- *(tests)* Don't check last commit ([#619](https://github.com/orhun/git-cliff/issues/619)) - ([68b9839](https://github.com/orhun/git-cliff/commit/68b98393e72d4a38a2e9166477784a9e1a55c9cf))

## [2.2.1](https://github.com/orhun/git-cliff/compare/v2.2.0..v2.2.1) - 2024-04-10

### 🐛 Bug Fixes

- *(npm)* Include the proper files in the npm tarball ([#594](https://github.com/orhun/git-cliff/issues/594)) - ([800c896](https://github.com/orhun/git-cliff/commit/800c8964933deda12ef17a27c566dde430a7cae9))

### 📚 Documentation

- *(readme)* Mention git-changelog-command-line tool ([#589](https://github.com/orhun/git-cliff/issues/589)) - ([d65b443](https://github.com/orhun/git-cliff/commit/d65b4433ce784a713355f47b30096031c7dc05f4))
- *(website)* Add GITHUB_REPO variable to GitHub action ([#597](https://github.com/orhun/git-cliff/issues/597)) - ([3b74254](https://github.com/orhun/git-cliff/commit/3b742548cccf7a55bc071a7614fa224b41078aa2))
- *(website)* Update release date - ([45132da](https://github.com/orhun/git-cliff/commit/45132da64284eb60330021ab8ca6d1db07206610))

### ⚙️ Miscellaneous Tasks

- *(ci)* Remove audit check - ([6ba6809](https://github.com/orhun/git-cliff/commit/6ba6809ea1ff9b34f192b387e77da06cf0570606))

## [2.2.0](https://github.com/orhun/git-cliff/compare/v2.1.2..v2.2.0) - 2024-03-30

### ⛰️ Features
Expand Down
8 changes: 7 additions & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,13 @@ cargo build
cargo test
```

6. Make sure [rustfmt](https://github.com/rust-lang/rustfmt) and [clippy](https://github.com/rust-lang/rust-clippy) don't complain about your changes.
6. If needed, update the snapshot tests (i.e. tests using `expect_test`):

```sh
env UPDATE_EXPECT=1 cargo test
```

7. Make sure [rustfmt](https://github.com/rust-lang/rustfmt) and [clippy](https://github.com/rust-lang/rust-clippy) don't complain about your changes.

We use the `nightly` channel for `rustfmt` so please set the appropriate settings for your editor/IDE for that.

Expand Down
Loading

0 comments on commit 1853a5c

Please sign in to comment.