Skip to content

Commit c17ae87

Browse files
dbantyGitHub
and
GitHub
authored
chore: prepare release 0.11.1 (#581)
Co-authored-by: GitHub <[email protected]>
1 parent 98528cd commit c17ae87

7 files changed

+81
-88
lines changed

.changeset/add_a_changelogsection_variable_for_substitution.md

-32
This file was deleted.

.changeset/added_an_allow_empty_option_to_the_preparerelease_step.md

-30
This file was deleted.

.changeset/github_actions_recipes.md

-7
This file was deleted.

.changeset/new_createpullrequest_step.md

-11
This file was deleted.

.changeset/only_consider_prereleases_newer_than_the_last_stable.md

-7
This file was deleted.

CHANGELOG.md

+80
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,86 @@ All notable changes to this project will be documented in this file.
44

55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

7+
## 0.11.1 (2023-09-22)
8+
9+
### Features
10+
11+
#### Add a `ChangelogEntry` variable for substitution
12+
13+
Anywhere that the existing `Version` variable can be used (for example, in [the `Command` step]), you can now also use `ChangelogEntry` to get the section of the changelog that corresponds to the current version. For example, you could (almost) replicate Knope's GitHub Release creation _without_ Knope's GitHub integration with a workflow like this:
14+
15+
```toml
16+
[[workflows]]
17+
name = "release"
18+
19+
[[workflows.steps]]
20+
type = "PrepareRelease"
21+
22+
[[workflows.steps]]
23+
type = "Command"
24+
command = "git commit -m \"chore: prepare release $version\" && git push"
25+
26+
[workflows.steps.variables]
27+
"$version" = "Version"
28+
29+
[[workflows.steps]]
30+
type = "Command"
31+
command = "gh release create --title '$version' --notes '$changelog'"
32+
33+
[workflows.steps.variables]
34+
"$version" = "Version"
35+
"$changelog" = "ChangelogEntry"
36+
```
37+
38+
[the `Command` step]: https://knope-dev.github.io/knope/config/step/Command.html
39+
40+
#### Added an `allow_empty` option to the `PrepareRelease` step
41+
42+
Closes #416
43+
44+
If you want to run `PrepareRelease` on every push to a branch without it failing when there's nothing to release, you can now include the `allow_empty` option like this:
45+
46+
```toml
47+
[[workflows.steps]]
48+
type = "PrepareRelease"
49+
allow_empty = true
50+
```
51+
52+
Then, you can use some logic to gracefully skip the rest of your CI process if there is nothing to release. For example, in GitHub Actions, you could do something like this:
53+
54+
```yaml
55+
- name: Prepare Release
56+
run: knope prepare-release
57+
- name: Check for Release
58+
id: status
59+
run: echo ready=$(if [[ `git status --porcelain` ]]; then echo "true"; else echo "false"; fi;) >> $GITHUB_OUTPUT
60+
- name: Release
61+
if: steps.status.outputs.ready == 'true'
62+
run: knope release
63+
```
64+
65+
This allows you to differentiate between there being nothing to release and the `PrepareRelease` step failing for other reasons.
66+
67+
#### New `CreatePullRequest` step
68+
69+
The new [`CreatePullRequest` step] allows you to create or update a pull request on GitHub. It's designed to be a nice way to preview and accept new releases via a pull request workflow, but could certainly work for more contexts as well! To see an example of the new PR-based release workflow, check out [Knope's prepare-release workflow] and [Knope's release workflow].
70+
71+
[`CreatePullRequest` step]: https://knope-dev.github.io/knope/docs/config/step/CreatePullRequest
72+
[Knope's prepare-release workflow]: https://github.com/knope-dev/knope/blob/e7292fa746fe1d81b84e5848815c02a0d8fc6f95/.github/workflows/prepare_release.yml
73+
[knope's release workflow]: https://github.com/knope-dev/knope/blob/e7292fa746fe1d81b84e5848815c02a0d8fc6f95/.github/workflows/release.yml
74+
75+
### Fixes
76+
77+
#### Only consider prereleases newer than the last stable
78+
79+
This fixes a regression in the previous version of Knope where _all_ prereleases would be considered, rather than just those tagged after the latest stable version.
80+
81+
### Documentation
82+
83+
#### GitHub Actions Recipes
84+
85+
There's a [new section of the docs](https://knope-dev.github.io/knope/github_actions/github_actions.html) with some recipes for using Knope in GitHub Actions. If you have suggestions for additional recipes, please open a [discussion](https://github.com/knope-dev/knope/discussions)!
86+
787
## 0.11.0 (2023-09-13)
888

989
### Breaking Changes

Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "knope"
33
description = "A command line tool for automating common development tasks"
4-
version = "0.11.0"
4+
version = "0.11.1"
55
authors = ["Dylan Anthony <[email protected]>"]
66
edition = "2021"
77
license = "MIT"

0 commit comments

Comments
 (0)