-
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
Showing
4 changed files
with
57 additions
and
49 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 |
---|---|---|
@@ -1,2 +1,3 @@ | ||
external | ||
dist | ||
.cache |
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,4 @@ | ||
root = true | ||
|
||
[*] | ||
end_of_line = lf |
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 |
---|---|---|
@@ -1,45 +1,48 @@ | ||
def get-ecsact-deps [] { | ||
(buildozer -output_json 'print name version' //MODULE.bazel:%bazel_dep | ||
| from json | ||
| get records | ||
| each {|record| {name: $record.fields.0.text, version: $record.fields.1.text?} } | ||
| filter {|dep| $dep.name | str starts-with "ecsact_"} | ||
) | ||
} | ||
|
||
def main [version: string] { | ||
let start_dir = $env.PWD; | ||
let before_update_deps = get-ecsact-deps; | ||
let changelog_template = [$start_dir, "release-notes-template"] | path join; | ||
|
||
$before_update_deps | each {|dep| bzlmod add $dep.name; }; | ||
|
||
let release_notes = (get-ecsact-deps | each {|dep| | ||
let before_version = $before_update_deps | where name == $dep.name | get version | get 0; | ||
let after_version = $dep | get version; | ||
let dep_repo_remote = $"https://github.com/ecsact-dev/($dep.name)"; | ||
let cached_repo_dir = $".cache/repos/($dep.name)"; | ||
mut dep_release_notes = ""; | ||
|
||
if $after_version != $before_version { | ||
rm -rf $cached_repo_dir; | ||
git clone --quiet $dep_repo_remote $cached_repo_dir; | ||
cd $cached_repo_dir; | ||
let changelog = cog changelog $"($before_version)..($after_version)" -o ecsact-dev --repository $dep.name --remote "github.com" -t $changelog_template; | ||
rm -rf $cached_repo_dir; | ||
cd $start_dir; | ||
$dep_release_notes += $"# ($dep.name) ($before_version) -> ($after_version)\n\n"; | ||
$dep_release_notes += $changelog; | ||
} | ||
|
||
$dep_release_notes | ||
}); | ||
|
||
let release_notes = $release_notes | reduce {|$section, $full| $full + $section} -f ""; | ||
git add MODULE.bazel; | ||
git commit -m $"chore\(deps\): ecsact repos for ($version) release"; | ||
git push origin main; | ||
git tag $version; | ||
git push origin $version; | ||
gh release create $version -n $release_notes --latest -t $version --verify-tag --latest; | ||
} | ||
def get-ecsact-deps [] { | ||
(buildozer -output_json 'print name version' //MODULE.bazel:%bazel_dep | ||
| from json | ||
| get records | ||
| each {|record| {name: $record.fields.0.text, version: $record.fields.1.text?} } | ||
| filter {|dep| $dep.name | str starts-with "ecsact_"} | ||
) | ||
} | ||
|
||
def main [version: string] { | ||
let start_dir = $env.PWD; | ||
let before_update_deps = get-ecsact-deps; | ||
let changelog_template = [$start_dir, "release-notes-template"] | path join; | ||
|
||
$before_update_deps | each {|dep| bzlmod add $dep.name; }; | ||
|
||
# sanity check | ||
bazel build //...; | ||
|
||
let release_notes = (get-ecsact-deps | each {|dep| | ||
let before_version = $before_update_deps | where name == $dep.name | get version | get 0; | ||
let after_version = $dep | get version; | ||
let dep_repo_remote = $"https://github.com/ecsact-dev/($dep.name)"; | ||
let cached_repo_dir = $".cache/repos/($dep.name)"; | ||
mut dep_release_notes = ""; | ||
|
||
if $after_version != $before_version { | ||
rm -rf $cached_repo_dir; | ||
git clone --quiet $dep_repo_remote $cached_repo_dir; | ||
cd $cached_repo_dir; | ||
let changelog = cog changelog $"($before_version)..($after_version)" -o ecsact-dev --repository $dep.name --remote "github.com" -t $changelog_template; | ||
rm -rf $cached_repo_dir; | ||
cd $start_dir; | ||
$dep_release_notes += $"# ($dep.name) ($before_version) -> ($after_version)\n\n"; | ||
$dep_release_notes += $changelog; | ||
} | ||
|
||
$dep_release_notes | ||
}); | ||
|
||
let release_notes = $release_notes | reduce {|$section, $full| $full + $section} -f ""; | ||
git add MODULE.bazel; | ||
git commit -m $"chore\(deps\): ecsact repos for ($version) release"; | ||
git push origin main; | ||
git tag $version; | ||
git push origin $version; | ||
gh release create $version -n $release_notes --latest -t $version --verify-tag --latest; | ||
} |