|
| 1 | +# How to create a new release (WIP) |
| 2 | + |
| 3 | +The idea is to |
| 4 | +- create a new release in the "release/$release_version" branch (tagged with `$release_version` and `latest`) |
| 5 | +- and a MR that the master branch can be updated with next beta version |
| 6 | +- create in PlantUML/PlantUML-stdlib a MR with the released version |
| 7 | + |
| 8 | +## 0. Preparation |
| 9 | + |
| 10 | +The process requires following 3 versions: |
| 11 | + |
| 12 | +- **$release_version**: version which should be created (e.g. `v2.6.0`) |
| 13 | +- **$next_version**: version of the next beta which should be stared |
| 14 | + as soon the release is created (e.g. `v2.7.0`). |
| 15 | + The master branch will be updated with a `beta1` of this version and C4Version() returns `2.7.0beta1`. |
| 16 | + If it is unknown/undefined it is calculated via the release_version. It is the next patch (release patch!=0) or subversion (release patch==0). |
| 17 | +- **$deployed_version**: this is the next "plantuml(/plantuml-stdlib)" version |
| 18 | + which should be updated with this release (e.g. "V1.2023.2") |
| 19 | + If it is unknown/undefined it is calculated via the running PlantUML web service |
| 20 | + |
| 21 | +### 0.0 Create a new issue with the title `Release $release_version` \(e.g. `Release v2.6.0`) |
| 22 | + |
| 23 | +and a body like in https://github.com/plantuml-stdlib/C4-PlantUML/issues/248 |
| 24 | + |
| 25 | +### 0.1 Check that all open issues of the related `$release_version milestone` are fixed |
| 26 | + |
| 27 | +### 0.2 Check that all other open changes are done |
| 28 | + |
| 29 | +Update copyright year, contrib files, URLS, .... if required |
| 30 | + |
| 31 | +### 0.* ... |
| 32 | + |
| 33 | +### 0.x Check which is the next released version of the PlantUML(/PlantUML-stdlib) |
| 34 | + |
| 35 | +it is used as $deployed_version and written in the released README.md |
| 36 | +If it is unknown it can be calculated via `CalculateDeployedVersion` (details see below) |
| 37 | + |
| 38 | +## 1. create new release in branch `release/$release_version` (based on master) |
| 39 | + |
| 40 | +Atm following steps are semi-automated and can be executed in a bash shell: |
| 41 | + |
| 42 | +### 1.0. define the relevant versions as environment variabels and create the `release/$release_version` branch |
| 43 | + |
| 44 | +\(in following sample the `release_version` = `v2.6.0`; `next_version` = `v2.7.0` and `deployed_version` = `V1.2022.15`) |
| 45 | + |
| 46 | +```bash |
| 47 | +export release_version=v2.6.0 |
| 48 | +export next_version=v2.7.0 |
| 49 | +export deployed_version=V1.2022.15 |
| 50 | +``` |
| 51 | + |
| 52 | +If the deployed_version is unknown it can be calculate via following (don't forget to set the environment variable after the call) |
| 53 | + |
| 54 | +```bash |
| 55 | +python ./.scripts/transform_files.py CalculateDeployedVersion |
| 56 | +``` |
| 57 | + |
| 58 | +As soon all versions are defined the `release/$release_version` branch \(e.g. `release/v2.6.0`) can be created based on master branch |
| 59 | + |
| 60 | +```bash |
| 61 | +git pull |
| 62 | +git checkout master |
| 63 | +git branch release/$release_version |
| 64 | +git checkout release/$release_version |
| 65 | +``` |
| 66 | + |
| 67 | +### 1.1. Update `C4Version()` in C4.puml with the new release (e.g. `2.6.0`; without `v`) |
| 68 | + |
| 69 | +```bash |
| 70 | +python ./.scripts/transform_files.py UpdateC4WithReleaseVersion |
| 71 | +``` |
| 72 | + |
| 73 | +### 1.2. Update all include paths and create a release version of the README.md |
| 74 | + |
| 75 | +Following script calls |
| 76 | + |
| 77 | +- Update all include paths with the release version tag based branch |
| 78 | +- Update includes of all image urls with the release version tag based in *.md |
| 79 | + (after that images displays the correct C4Version() number and uses only the release-tag path in all includes) |
| 80 | +- Update README.md with the new release header and title (based on the `readme_release_header.txt` template) |
| 81 | + |
| 82 | +```bash |
| 83 | +python ./.scripts/transform_files.py UpdateC4WithReleaseVersion |
| 84 | +python ./.scripts/transform_files.py UpdateAllImages |
| 85 | +python ./.scripts/transform_files.py ReplaceREADMEHeader |
| 86 | +``` |
| 87 | + |
| 88 | +These changes can/should be checked and if everything is ok it can be committed. |
| 89 | + |
| 90 | +Following commit all changes and tag it locally with `$release_version` (e.g. `v2.5.0`) |
| 91 | + |
| 92 | +```bash |
| 93 | +git checkout release/$release_version |
| 94 | +git add -u **/*.md |
| 95 | +git add -u **/*.puml |
| 96 | +git commit -m "Create release (branch) $release_version" |
| 97 | +git tag "$release_version" |
| 98 | +``` |
| 99 | + |
| 100 | +And if everything is ok it can be pushed too |
| 101 | + |
| 102 | +```bash |
| 103 | +git checkout release/$release_version |
| 104 | +git push -u origin release/$release_version |
| 105 | +``` |
| 106 | + |
| 107 | +## 2. Create `Release $release_version` \(e.g. `Release v2.6.0`) itself |
| 108 | + |
| 109 | +This is done manually \(incl. an additional check...) |
| 110 | + |
| 111 | +**Important:** As soon the release is finished check that |
| 112 | +- 'latest' tag is re-assigned to the new release branch |
| 113 | +- and '$release_version' tag is assigned to the new release branch |
| 114 | + |
| 115 | +As soon the version is released the release branch has to be write protected |
| 116 | + |
| 117 | +## 3. Update master branch with $next_version beta1 version |
| 118 | + |
| 119 | +### 3.1. create a `start-$next_version-beta1` branch \(e.g. `start-v2.7.0-beta1`) based on master branch |
| 120 | + |
| 121 | +```bash |
| 122 | +git pull |
| 123 | +git checkout master |
| 124 | +git branch start-$next_version-beta1 |
| 125 | +git checkout start-$next_version-beta1 |
| 126 | +``` |
| 127 | + |
| 128 | +Following script update `C4Version()` in C4.puml with the next beta release (e.g. `2.7.0beta1`; without `v`) |
| 129 | + |
| 130 | +```bash |
| 131 | +python ./.scripts/transform_files.py UpdateC4WithNextBeta |
| 132 | +``` |
| 133 | + |
| 134 | +Following commit all changes |
| 135 | + |
| 136 | +```bash |
| 137 | +git checkout start-$next_version-beta1 |
| 138 | +git add -u C4.puml |
| 139 | +git commit -m "Update version with first beta of $next_version ($release_version was created based on previous commit)" |
| 140 | +``` |
| 141 | + |
| 142 | +And if everything is ok it can be pushed too |
| 143 | + |
| 144 | +```bash |
| 145 | +git checkout start-$next_version-beta1 |
| 146 | +git push -u origin start-$next_version-beta1 |
| 147 | +``` |
| 148 | + |
| 149 | +### 3.2. Create a MR into master |
| 150 | + |
| 151 | +This is done manually \(incl. an additional check...) |
| 152 | + |
| 153 | +## 4. Create in PlantUML/PlantUML-stdlib a MR based on `release/$release_version` branch |
| 154 | + |
| 155 | +> !!! CHECK that the correct release branch is activated !!! |
| 156 | +
|
| 157 | +> It is assumed that following calls are started in "C4-PlantUML repository" folder |
| 158 | +(and not in the "plantuml-stdlib repository" folder) |
| 159 | + |
| 160 | +The process requires following information too: |
| 161 | + |
| 162 | +- **$deploy_repository_folder**: folder with the local `PlantUML/PlantUML-stdlib` git repositiory. |
| 163 | + E.g. if it is parallel to the C4-PlantUML repository the it could be `../plantuml-stdlib`. |
| 164 | + |
| 165 | +### 4.1. create in a PlantUML/PlantUML-stdlib fork a `C4$release_version` branch (e.g. `C4v2.6.0`) |
| 166 | + |
| 167 | +```bash |
| 168 | +export release_version=v2.6.0 |
| 169 | +export next_version=v2.7.0 |
| 170 | +export deployed_version=V1.2022.15 |
| 171 | + |
| 172 | +export deploy_repository_folder=../plantuml-stdlib |
| 173 | + |
| 174 | +git pull |
| 175 | +git checkout release/$release_version |
| 176 | + |
| 177 | +git -C $deploy_repository_folder pull |
| 178 | +git -C $deploy_repository_folder checkout master |
| 179 | +git -C $deploy_repository_folder branch C4$release_version |
| 180 | +git -C $deploy_repository_folder checkout C4$release_version |
| 181 | +``` |
| 182 | + |
| 183 | +### 4.2. prepare the C4_*.puml and INFO file |
| 184 | + |
| 185 | +```bash |
| 186 | +python ./.scripts/transform_files.py CreatePlantUMLStdlibC4Folder $deploy_repository_folder/C4 |
| 187 | +``` |
| 188 | + |
| 189 | +### 4.3. Commit changes with comment "Update C4-PlantUML to $release_version" |
| 190 | + |
| 191 | +```bash |
| 192 | +git -C $deploy_repository_folder add -u C4/** |
| 193 | +git -C $deploy_repository_folder commit -m "Update C4-PlantUML to $release_version" |
| 194 | +``` |
| 195 | + |
| 196 | +### 4.4. create a MR "Update C4-PlantUML to $next_version" |
| 197 | + |
| 198 | +This is done manually \(incl. an additional check...) |
0 commit comments