From c3b41fd56aa079aeb7bd9ef1c9c17a9418b5c804 Mon Sep 17 00:00:00 2001 From: Anmol Sethi Date: Sat, 12 Nov 2022 10:29:39 -0800 Subject: [PATCH] 2022-11-12 10:29:39am --- ci/release/changelogs/next.md | 8 ++--- ci/release/changelogs/v0.0.99.md | 13 +++++++ ci/release/release.sh | 58 +++++++++++++++++++++++++------- ci/sub | 2 +- 4 files changed, 62 insertions(+), 19 deletions(-) create mode 100644 ci/release/changelogs/v0.0.99.md diff --git a/ci/release/changelogs/next.md b/ci/release/changelogs/next.md index 1030a2961..501bb82d7 100644 --- a/ci/release/changelogs/next.md +++ b/ci/release/changelogs/next.md @@ -1,15 +1,13 @@ -## Summary 🍻 - For v0.0.99 we focused on X, Y and Z. Enjoy! -### Features 💸 +#### Features 💸 - Now you can easily do x, y and z #9999 -### Improvements 🔧 +#### Improvements 🔧 - Improves something or the other #9999 -### Bugfixes 🔴 +#### Bugfixes 🔴 - Fixes something or the other #9999 diff --git a/ci/release/changelogs/v0.0.99.md b/ci/release/changelogs/v0.0.99.md new file mode 100644 index 000000000..501bb82d7 --- /dev/null +++ b/ci/release/changelogs/v0.0.99.md @@ -0,0 +1,13 @@ +For v0.0.99 we focused on X, Y and Z. Enjoy! + +#### Features 💸 + +- Now you can easily do x, y and z #9999 + +#### Improvements 🔧 + +- Improves something or the other #9999 + +#### Bugfixes 🔴 + +- Fixes something or the other #9999 diff --git a/ci/release/release.sh b/ci/release/release.sh index 6eac14d10..516b0aa19 100755 --- a/ci/release/release.sh +++ b/ci/release/release.sh @@ -99,26 +99,58 @@ main() { VERSION="$1" shift - 1_branch - 2_changelog - 3_commit - 4_tag - 5_draft_release - 6_draft_pr - 7_build_assets - 9_upload_assets + runjob ensure_branch + runjob ensure_changelog + runjob ensure_commit + # runjob push_branch + # 3_commit + # 4_tag + # 5_draft_release + # 6_draft_pr + # 7_build_assets + # 9_upload_assets - if [ "$(git_describe_ref)" != "$TAG" ]; then - git tag -am "$TAG" "$TAG" + # if [ "$(git_describe_ref)" != "$TAG" ]; then + # git tag -am "$TAG" "$TAG" + # fi + # hide git push origin "$TAG" +} + +ensure_branch() { + if [ -z "$(git branch --list "$VERSION")" ]; then + sh_c git branch "$VERSION" master fi - hide git push origin "$TAG" + sh_c git checkout -q "$VERSION" } -1_branch() { +ensure_changelog() { + if [ -f "./ci/release/changelogs/$VERSION.md" ]; then + return 0 + fi + sh_c cp "./ci/release/changelogs/next.md" "./ci/release/changelogs/$VERSION.md" + if [ -z "${PRERELEASE-}" ]; then + sh_c cp "./ci/release/changelogs/template.md" "./ci/release/changelogs/next.md" + fi } -7_build_assets() { +ensure_commit() { + sh_c git add --all + if ! git commit --dry-run >/dev/null; then + return 0 + fi + if [ "$(git show --no-patch --format=%s)" = "$VERSION" ]; then + sh_c git commit --amend --no-edit + else + sh_c git commit -m "$VERSION" + fi +} + +push_branch() { + sh_c git push -fu origin "$VERSION" +} + +ensure_built_assets() { ./ci/release/build.sh ${REBUILD:+--rebuild} $VERSION } diff --git a/ci/sub b/ci/sub index ffe9df3b8..a4961f772 160000 --- a/ci/sub +++ b/ci/sub @@ -1 +1 @@ -Subproject commit ffe9df3b89e12db7f1dc4ed9d5a25730dde5cc79 +Subproject commit a4961f772d1f98bb7a8185a6590ed4346684e392