Skip to content

Commit 3f21bfe

Browse files
committed
feat: update release script to remove chore content
1 parent 9382396 commit 3f21bfe

File tree

3 files changed

+67
-44
lines changed

3 files changed

+67
-44
lines changed

.editorconfig

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
root = true
2-
3-
[*]
4-
end_of_line = lf
1+
root = true
2+
3+
[*]
4+
end_of_line = lf
5+
6+
[release-notes-template]
7+
indent_style = space
8+
indent_size = 4

release-notes-template

Lines changed: 41 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,41 @@
1-
{% if version.tag -%}
2-
## [{{ version.tag }}]({{repository_url}}/releases/tag/{{ version.tag }})
3-
{% else -%}
4-
{% set from = commits | last -%}
5-
{% set to = version.id-%}
6-
{% set from_shorthand = from.id | truncate(length=7, end="") -%}
7-
{% set to_shorthand = to | truncate(length=7, end="") -%}
8-
## Unreleased ({{ from_shorthand ~ ".." ~ to_shorthand }})
9-
{% endif -%}
10-
11-
{% for type, typed_commits in commits | sort(attribute="type")| group_by(attribute="type")-%}
12-
#### {{ type | upper_first }}
13-
{% for scope, scoped_commits in typed_commits | group_by(attribute="scope") -%}
14-
15-
{% for commit in scoped_commits | sort(attribute="scope") -%}
16-
{% set shorthand = commit.id | truncate(length=7, end="") -%}
17-
- **({{ scope }})** {{ commit.summary }} - ([{{ shorthand }}]({{ repository_url }}/commit/{{ commit.id }}))
18-
{{ commit.body }}
19-
{% endfor -%}
20-
21-
{% endfor -%}
22-
23-
{%- for commit in typed_commits | unscoped -%}
24-
{% if commit.author -%}
25-
{% set author = commit.author -%}
26-
{% else -%}
27-
{% set author = commit.signature -%}
28-
{% endif -%}
29-
30-
{% set shorthand = commit.id | truncate(length=7, end="") -%}
31-
- {{ commit.summary }} - ([{{ shorthand }}]({{ repository_url }}/commit/{{ commit.id }}))
32-
{{ commit.body }}
33-
{% endfor -%}
34-
35-
{% endfor -%}
1+
{% if version.tag -%}
2+
## [{{ version.tag }}]({{repository_url}}/releases/tag/{{ version.tag }})
3+
{% else -%}
4+
{% set from = commits | last -%}
5+
{% set to = version.id-%}
6+
{% set from_shorthand = from.id | truncate(length=7, end="") -%}
7+
{% set to_shorthand = to | truncate(length=7, end="") -%}
8+
## Unreleased ({{ from_shorthand ~ ".." ~ to_shorthand }})
9+
{% endif -%}
10+
11+
{% for type, typed_commits in commits | sort(attribute="type") | group_by(attribute="type") -%}
12+
{% if type != "Miscellaneous Chores" -%}
13+
#### {{ type | upper_first }}
14+
{% endif -%}
15+
{% for scope, scoped_commits in typed_commits | group_by(attribute="scope") -%}
16+
17+
{% for commit in scoped_commits | sort(attribute="scope") -%}
18+
{% if commit.type != "Miscellaneous Chores" -%}
19+
{% set shorthand = commit.id | truncate(length=7, end="") -%}
20+
- **({{ scope }})** {{ commit.summary }} - ([{{ shorthand }}]({{ repository_url }}/commit/{{ commit.id }}))
21+
{{ commit.body }}
22+
{% endif -%}
23+
{% endfor -%}
24+
25+
{% endfor -%}
26+
27+
{%- for commit in typed_commits | unscoped -%}
28+
{% if commit.type != "Miscellaneous Chores" -%}
29+
{% if commit.author -%}
30+
{% set author = commit.author -%}
31+
{% else -%}
32+
{% set author = commit.signature -%}
33+
{% endif -%}
34+
35+
{% set shorthand = commit.id | truncate(length=7, end="") -%}
36+
- {{ commit.summary }} - ([{{ shorthand }}]({{ repository_url }}/commit/{{ commit.id }}))
37+
{{ commit.body }}
38+
{% endif -%}
39+
{% endfor -%}
40+
41+
{% endfor -%}

release.nu

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,31 @@ def get-ecsact-deps [] {
77
)
88
}
99

10-
def main [version: string, --dry-run] {
10+
def main [version, --dry-run, --update] {
1111
let start_dir = $env.PWD;
12+
let tmp_repo_dir = mktemp -d --suffix "EcsactSdkRelease";
13+
let last_release = (gh release view --json tagName | from json).tagName;
14+
git worktree add $tmp_repo_dir $last_release;
15+
cd $tmp_repo_dir;
1216
let before_update_deps = get-ecsact-deps;
17+
git worktree remove $tmp_repo_dir --force | complete; # this sometimes fails
18+
cd $start_dir;
1319
let changelog_template = [$start_dir, "release-notes-template"] | path join;
14-
15-
$before_update_deps | each {|dep| bzlmod add $dep.name; };
20+
21+
if $update {
22+
$before_update_deps | each {|dep| bzlmod add $dep.name; };
23+
}
1624

1725
# sanity check
18-
bazel build //...;
26+
bazel build "//...";
1927

2028
let release_notes = (get-ecsact-deps | each {|dep|
21-
let before_version = $before_update_deps | where name == $dep.name | get version | get 0;
29+
print $"Generating release notes for ($dep.name)";
30+
let before_version = ($before_update_deps | where name == $dep.name);
31+
if ($before_version | length) == 0 {
32+
return $"## NEW dependency ($dep.name)\n\n";
33+
}
34+
let before_version = $before_version | get version | get 0;
2235
let after_version = $dep | get version;
2336
let dep_repo_remote = $"https://github.com/ecsact-dev/($dep.name)";
2437
let cached_repo_dir = $".cache/repos/($dep.name)";

0 commit comments

Comments
 (0)