Skip to content

Commit 94bb34c

Browse files
committed
chore(ci): skip changelog generation for pre-releases
1 parent 44e5470 commit 94bb34c

4 files changed

Lines changed: 30 additions & 18 deletions

File tree

CHANGELOG.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,18 @@
77

88
## [Unreleased]
99

10+
### <!-- 0 -->🚀 Features
11+
- Add support for pipelines triggered through the api by @fargito in [#52](https://github.com/CodSpeedHQ/runner/pull/52)
12+
1013
### <!-- 1 -->🐛 Bug Fixes
14+
- Use correct ref for tag pipelines by @fargito
1115
- Git-cliff configuration for changelog generation by @art049
1216

17+
### <!-- 3 -->📚 Documentation
18+
- Add link to GitLab CI docs by @fargito in [#51](https://github.com/CodSpeedHQ/runner/pull/51)
19+
1320
### <!-- 7 -->⚙️ Internals
21+
- Skip changelog generation for pre-releases
1422
- Bump pre-commit action by @art049
1523
- Fix changelog markdown template whitespaces by @art049
1624

@@ -32,8 +40,6 @@
3240
- Configure git-cliff for changelog generation by @art049
3341
- Add rust settings by @fargito
3442

35-
## New Contributors
36-
* @fargito made their first contribution in [#47](https://github.com/CodSpeedHQ/runner/pull/47)
3743

3844
## [3.1.0] - 2024-11-05
3945

@@ -273,9 +279,6 @@
273279
- Setup cargo dist by @art049 in [#1](https://github.com/CodSpeedHQ/runner/pull/1)
274280
- Add linting components to the toolchain by @art049
275281

276-
## New Contributors
277-
* @art049 made their first contribution
278-
* @adriencaccia made their first contribution in [#6](https://github.com/CodSpeedHQ/runner/pull/6)
279282

280283
[unreleased]: https://github.com/CodSpeedHQ/runner/compare/v3.2.0..HEAD
281284
[3.2.0]: https://github.com/CodSpeedHQ/runner/compare/v3.1.0..v3.2.0

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ insta = { version = "1.29.0", features = ["json", "redactions"] }
5555
[workspace.metadata.release]
5656
sign-tag = true
5757
sign-commit = true
58-
pre-release-hook = ["git", "cliff", "-o", "CHANGELOG.md", "--tag", "v{{version}}", "--github-token", "{{env.GITHUB_TOKEN}}"]
58+
pre-release-hook = ["./scripts/pre-release.sh", "v{{version}}"]
5959

6060
[profile.dist]
6161
inherits = "release"

cliff.toml

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -39,18 +39,7 @@ body = """
3939
[#{{ commit.remote.pr_number }}]({{ self::remote_url() }}/pull/{{ commit.remote.pr_number }}) \
4040
{%- endif -%}
4141
{% endfor %}
42-
{% endfor %}
43-
44-
{%- if github.contributors | filter(attribute="is_first_time", value=true) | length != 0 %}
45-
## New Contributors
46-
{%- endif -%}
47-
48-
{% for contributor in github.contributors | filter(attribute="is_first_time", value=true) %}
49-
* @{{ contributor.username }} made their first contribution
50-
{%- if contributor.pr_number %} in \
51-
[#{{ contributor.pr_number }}]({{ self::remote_url() }}/pull/{{ contributor.pr_number }}) \
52-
{%- endif %}
53-
{%- endfor %}\n\n
42+
{% endfor %}\n\n
5443
"""
5544
# template for the changelog footer
5645
footer = """

scripts/pre-release.sh

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#!/bin/bash
2+
set -e
3+
4+
# First and only argument is the version number
5+
VERSION=$1 # The version number, prefixed with 'v'
6+
7+
# Skip alpha/beta/rc changelog generation
8+
if [[ $VERSION == *"alpha"* ]] || [[ $VERSION == *"beta"* ]] || [[ $VERSION == *"rc"* ]]; then
9+
echo "Skipping changelog generation for alpha/beta/rc release"
10+
exit 0
11+
fi
12+
13+
# Check that GITHUB_TOKEN is set
14+
if [ -z "$GITHUB_TOKEN" ]; then
15+
echo "GITHUB_TOKEN is not set. Trying to fetch it from gh"
16+
GITHUB_TOKEN=$(gh auth token)
17+
18+
fi
19+
20+
git cliff -o CHANGELOG.md --tag $VERSION --github-token $GITHUB_TOKEN

0 commit comments

Comments
 (0)