Skip to content

Commit fd268dc

Browse files
committed
Tweaking the release builder
1 parent a3d85f0 commit fd268dc

4 files changed

Lines changed: 124 additions & 88 deletions

File tree

admin/docbot.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,4 @@ If "deploy" is not added, the script execution is considered
3030
a trial run, and nothing is pushed to the repo.
3131

3232
Whether or not deployed, the results are left inside
33-
user_guide_src/build
33+
user_guide_src/build (which is git ignored).

admin/post_release

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
#~/bin/bash
2+
3+
## Cleanup after a framework release
4+
5+
UPSTREAM=https://github.com/bcit-ci/CodeIgniter4.git
6+
version=4
7+
qualifier=
8+
9+
branch=post-release-
10+
devonly='.github/* admin/* build/* contributing/* user_guide_src/* CODE_OF_CONDUCT.md \
11+
DCO.txt PULL_REQUEST_TEMPLATE.md'
12+
which=release
13+
14+
BOLD='\033[1m'
15+
NORMAL='\033[0m'
16+
COLOR='\033[1;31m'
17+
ERROR='\033[0;31m'
18+
19+
echo -e "${BOLD}${COLOR}CodeIgniter4 release cleanup${NORMAL}"
20+
echo '----------------------------'
21+
22+
#---------------------------------------------------
23+
# Check arguments
24+
echo -e "${BOLD}Checking arguments...${NORMAL}"
25+
26+
if [ $# -lt 1 ]; then
27+
echo "You really need to read the directions first!"
28+
exit 1
29+
fi
30+
31+
version=$1
32+
if [ $# -gt 1 ]; then
33+
qualifier="-${2}"
34+
which='pre-release'
35+
fi
36+
release_branch="release-$version$qualifier"
37+
branch="post-${release_branch}"
38+
39+
#---------------------------------------------------
40+
# Create the post-release branch
41+
echo -e "${BOLD}Creating $branch${NORMAL}"
42+
43+
git checkout $release_branch
44+
git branch -d $branch # remove the branch if there
45+
git checkout -b $branch
46+
47+
#---------------------------------------------------
48+
# Put our house back in order
49+
echo -e "${BOLD}Put our house back in order${NORMAL}"
50+
51+
mv -r admin/previous-gitignore .gitignore
52+
rm -Rf docs
53+
54+
#---------------------------------------------------
55+
# Add next version block in changelog.rst
56+
echo -e "${BOLD}Setup next release${NORMAL}"
57+
sed -i '5 i\
58+
Version |release|
59+
====================================================
60+
61+
Release Date: Not Released
62+
' user_guide_src/source/changelog.rst
63+
64+
#---------------------------------------------------
65+
# Merge away
66+
echo -e "${BOLD}Setup the develop branch${NORMAL}"
67+
git add .
68+
git commit -S -m "Post ${branch} cleanup"
69+
git push origin master
70+
git push UPSTREAM master
71+
72+
git checkout develop
73+
git merge ${branch}
74+
git push origin develop
75+
git push UPSTREAM develop
76+
77+
# keep or delete the release branch? up to you
78+
#git branch -d $branch
79+
80+
#---------------------------------------------------
81+
# Phew!
82+
83+
echo -e "${BOLD}Congratulations - we have liftoff${NORMAL}"
84+
echo "Don't forget to announce this release on the forum and on twitter!"

admin/release

Lines changed: 9 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
#~/bin/bash
22

3-
## Build and deploy framework release
3+
## Build a framework release branch
4+
5+
#---------------------------------------------------
6+
# Setup variables
47

58
UPSTREAM=https://github.com/bcit-ci/CodeIgniter4.git
69
action=test
@@ -25,17 +28,10 @@ echo '----------------------------'
2528
echo -e "${BOLD}Checking arguments...${NORMAL}"
2629

2730
if [ $# -lt 1 ]; then
28-
echo "You really need to read the directions first!"
31+
echo -e "${BOLD}Usage: admin/release version# pre-release-qualifier${NORMAL}"
2932
exit 1
3033
fi
3134

32-
if [ $1 = 'deploy' ]; then
33-
action=deploy
34-
elif [ $1 != 'test' ]; then
35-
echo -e "${ERROR}Invalid action ($1)${NORMAL}"
36-
exit 1
37-
fi
38-
shift # drop the command from the argument list
3935

4036
version=$1
4137
if [ $# -gt 1 ]; then
@@ -111,69 +107,12 @@ for f in $devonly; do
111107
done
112108

113109
#---------------------------------------------------
114-
# And finally, the release tag
115-
echo -e "${BOLD}Tag this branch for release${NORMAL}"
110+
# And finally, get ready for merging
116111
git add .
117112
git commit -m "Release ${version}${qualifier}"
118-
git tag -a v${version}${qualifier} -m "Release ${version}${qualifier} build"
119-
120-
#---------------------------------------------------
121-
# Are we there yet?
122-
if [ $action = 'test' ]; then
123-
echo -e "${BOLD}Your $branch branch is ready to inspect.${NORMAL}"
124-
exit 0
125-
fi
126-
echo -e "${BOLD}Are we there yet (yes|no)?${NORMAL}"
127-
read answer
128-
if [ $answer != 'yes' ]; then
129-
echo -e "${BOLD}Your $branch branch is ready to inspect.${NORMAL}"
130-
echo "Rerun this script when ready to deploy"
131-
exit 1
132-
fi
133113

134-
#---------------------------------------------------
135-
# Merge away
136-
echo -e "${BOLD}Merge the release into master${NORMAL}"
137-
git checkout master
138-
git merge $branch
139-
git push UPSTREAM master
140-
git push UPSTREAM --tags
141114

142115
#---------------------------------------------------
143-
# Put our house back in order
144-
echo -e "${BOLD}Put our house back in order${NORMAL}"
145-
146-
mv -r admin/previous-gitignore .gitignore
147-
rm -Rf docs
148-
149-
#---------------------------------------------------
150-
# Add next version block in changelog.rst
151-
echo -e "${BOLD}Setup next release${NORMAL}"
152-
sed -i '5 i\
153-
Version |release|
154-
====================================================
155-
156-
Release Date: Not Released
157-
' user_guide_src/source/changelog.rst
158-
159-
#---------------------------------------------------
160-
# Merge away
161-
echo -e "${BOLD}Setup the develop branch${NORMAL}"
162-
git add .
163-
git commit -S -m "Post ${branch} cleanup"
164-
git push origin master
165-
git push UPSTREAM master
166-
167-
git checkout develop
168-
git merge master
169-
git push origin develop
170-
git push UPSTREAM develop
171-
172-
# keep or delete the release branch? up to you
173-
#git branch -d $branch
174-
175-
#---------------------------------------------------
176-
# Phew!
177-
178-
echo -e "${BOLD}Congratulations - we have liftoff${NORMAL}"
179-
echo "Don't forget to announce this release on the forum and on twitter!"
116+
# Done for now
117+
echo -e "${BOLD}Your $branch branch is ready to inspect.${NORMAL}"
118+
echo -e "${BOLD}Follow the directions in release.md to continue.${NORMAL}"

admin/release.md

Lines changed: 30 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
# release
22

3-
Builds & deploys a framework release.
3+
Builds the branches needed for a framework release.
44

55
This tool is meant to help automate the process of
66
launching a new release, by creating the release
7-
distribution files, tagging everything properly,
8-
and getting the repo branches in order.
7+
distribution files, (tagging everything properly),
8+
and getting/keeping the repo branches in order.
99

1010
## Audience
1111

@@ -22,24 +22,29 @@ There might be other feature branches, but they are not relevant to this process
2222

2323
Once "develop" is ready for a new release, the general workflow is to
2424

25-
- create a release branch from develop
25+
- create a "release" branch from develop
2626
- update version dependencies or constants
2727
- generate version(s) of the user guide
2828
- move or ignore stuff, distinguishing release from development
2929
- test that all is as it should be
30-
- tag and merge the release branch into "master"
31-
- merge "master" into "develop"
30+
- merge the release branch into "master"
31+
- **manually** create the release & tag on github, based on master
3232
- put everything back where it should be for development
33-
- remove the release branch
33+
- merge the post-release branch into "master"
34+
- merge the post-release branch into "develop"
35+
- **manually** delete the release branches in the repo
36+
- **manually** post a sticky announcement thread on the forum
37+
- **manually** tweet the release announcement
3438

3539
Visually:
3640

37-
develop -> release -> master -> develop
41+
develop -> release -> master
42+
post-release -> master
43+
post->release -> develop
3844

39-
Finally, there are a couple of manual tasks:
40-
41-
- post a sticky announcement thread on the forum
42-
- tweet the release announcement
45+
The `release` bash script does the first six workflow steps,
46+
and the `post-release` script does the other three between
47+
the manual steps.
4348

4449
## Assumptions
4550

@@ -61,11 +66,10 @@ as part of a bug fix minor release.
6166

6267
Inside a shell prompt, in the project root:
6368

64-
`admin/release [test|deploy] version [qualifier]`
69+
`admin/release version [qualifier]`
6570

66-
If the "deploy" action is not specified, the script execution is considered
67-
a trial run, and nothing is pushed to the repo.
68-
Whether or not deployed, the results are left inside
71+
Nothing is pushed to the repo. at this point -
72+
the results are left inside
6973
the release branch in your local clone.
7074

7175
The "version" should follow semantic versioning, e.g. `4.0.6`, and the
@@ -75,7 +79,16 @@ The "qualifier" argument is a suffix to add to the version
7579
for a pre-release, e.g. `beta.2` or `rc.41`.
7680

7781
Examples:
78-
- `admin/release test 4.0.0 alpha.1` would prepare the "4.0.0-alpha.1" pre-release PR
82+
- `admin/release 4.0.0 alpha.1` would prepare the "4.0.0-alpha.1" pre-release PR
7983
- `admin/release 4.0.0` would prepare the "4.0.0" release PR
8084
- `admin/release peanut butter banana` would complain and tell you to read these directions
8185

86+
Complete the next few steps of the release manually:
87+
- merge the release branch to "master"
88+
- push that to the main repo
89+
- on github.com, create an appropriate release (or pre-release)
90+
91+
Once the release branch has been vetted, and you have
92+
completed the manual steps, clean up with:
93+
94+
`admin/post_release`

0 commit comments

Comments
 (0)