Skip to content
This repository was archived by the owner on Jul 30, 2024. It is now read-only.

Commit f4860f4

Browse files
committed
Merge branch 'dev'
2 parents 7e8d5fc + b297366 commit f4860f4

File tree

1 file changed

+16
-34
lines changed

1 file changed

+16
-34
lines changed

release

+16-34
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ current_branch="$($git_path symbolic-ref --short HEAD)"
1717
usage() {
1818
printf "Usage : ./release [OPTION] TAG\n\n"
1919
printf "Options :\n"
20-
printf "\t-h : Display this help.\n"
20+
printf "\t-h : Display this help.\n"²
2121
}
2222

2323
print_step() {
@@ -122,21 +122,16 @@ check_prerequisites() {
122122
require_clean_work_tree
123123
}
124124

125-
merge_in_main() {
126-
print_step "Merging into main branch..."
127-
128-
print_sub_step " * Merge on main branch"
129-
$git_path merge --quiet --no-edit $main_branch
130-
131-
print_sub_step " * Push main branch"
132-
$git_path push --quiet -o ci.skip origin $main_branch
133-
134-
$git_path checkout --quiet $main_branch
135-
}
136-
137125
release() {
138-
print_step "Pushing release $tag..."
126+
print_step "Releasing $tag..."
127+
128+
if [ "$current_branch" = "$dev_branch" ]; then
129+
print_sub_step " * Merge dev on main branch"
130+
$git_path checkout --quiet $main_branch
131+
$git_path merge --quiet --no-edit $dev_branch
132+
fi
139133

134+
print_sub_step " * Prepare files"
140135
sed -i "s|https://raw.githubusercontent.com/rawleenc/ArchCraftsman/dev|https://raw.githubusercontent.com/rawleenc/ArchCraftsman/main|g" archcraftsman.py
141136
$git_path add --all . >/dev/null
142137

@@ -147,42 +142,29 @@ release() {
147142
$git_path tag --annotate $tag --message="Release $tag"
148143

149144
print_sub_step " * Push release commit and tag"
150-
$git_path push --quiet origin $current_branch
145+
$git_path push --quiet origin $main_branch
151146
$git_path push --quiet origin $tag
152147
}
153148

154-
merge_in_dev() {
155-
print_step "Merging into dev branch..."
156-
157-
print_sub_step " * Merge on dev branch"
158-
$git_path merge --quiet --no-edit $dev_branch
159-
160-
print_sub_step " * Push dev branch"
161-
$git_path push --quiet -o ci.skip origin $dev_branch
149+
prepare_next_version() {
150+
print_step "Preparing next version..."
162151

152+
print_sub_step " * Merge main on dev branch"
163153
$git_path checkout --quiet $dev_branch
164-
}
165-
166-
prepare_next_version() {
167-
print_step "Prepare next version..."
154+
$git_path merge --quiet --no-edit $main_branch
168155

169156
sed -i "s|https://raw.githubusercontent.com/rawleenc/ArchCraftsman/main|https://raw.githubusercontent.com/rawleenc/ArchCraftsman/dev|g" archcraftsman.py
170157
$git_path add --all . >/dev/null
171158

172159
print_sub_step " * Create preparation commit"
173-
$git_path commit --quiet --allow-empty --message="Release $tag"
160+
$git_path commit --quiet --allow-empty --message="Prepare next version"
174161

175162
print_sub_step " * Push preparation commit"
176-
$git_path push --quiet origin $current_branch
177-
$git_path push --quiet origin $tag
163+
$git_path push --quiet origin $dev_branch
178164
}
179165

180166
check_prerequisites
181-
if [ "$current_branch" = "$dev_branch" ]; then
182-
merge_in_main
183-
fi
184167
release
185-
merge_in_dev
186168
prepare_next_version
187169

188170
echo "-------------------"

0 commit comments

Comments
 (0)