tainacan/docs/release.md

186 lines
3.5 KiB
Markdown
Raw Normal View History

# Releasing a new version
2018-10-23 19:18:17 +00:00
This is a work in progress documentaion on how to release a new version.
Assuming:
* $CURRENT_VERSION is the current "old" version (e.g. 0.2)
2018-10-23 19:18:17 +00:00
* $NEW_VERSION is the version we are releasing (e.g. 0.3)
* $GIT_PATH is where our repository is cloned
* $BUILD_PATH is where the plugin is condigured to buid
* $SVN_PATH is where the WordPress.org SVN repo is
2019-03-21 16:03:11 +00:00
## Pre-release
Before we publish a new version, we always release one or more Release Candidates so the community have time to test and make sure the new version of Tainacan is clean and ready to reach the world.
### Start in the git repository
```
cd $GIT_PATH
2018-10-23 14:24:59 +00:00
git checkout develop
git pull
```
2019-03-21 16:03:11 +00:00
### Create a new Release branch
Create a new `release/$NEW_VERSION` branch. If using git flow:
```
git flow release start $NEW_VERSION
```
### Edit version numbers
2019-04-16 20:55:55 +00:00
Edit `src/readme.txt` and `src/tainacan.php` and change the version numbers to `$NEW_VERSION`. In `tainacan.php` also change the `TAINACAN_VERSION` constant after the comments section
2018-10-23 19:18:17 +00:00
2019-03-21 16:03:11 +00:00
When releasing a RC version, append RC (number) to the version.
Also increase the `Tested Up` version, if applicable.
2018-10-23 19:18:17 +00:00
### Set build to production mode
Edit `webpack.config.js` to set production mode.
2019-05-20 19:33:00 +00:00
### Build
```
./build.sh
cd $BUILD_PATH
```
2019-03-21 16:03:11 +00:00
### Set build to development mode
```
cd $GIT_PATH
git checkout webpack.config.js
```
### Publish the RC
Create a ZIP package with the built plugin and publish a blog post calling for tests.
2019-03-21 18:57:07 +00:00
Commit and push to Git!
2019-03-21 16:03:11 +00:00
### Test
Using the Test guide as a resource, test every feature of the plugin, including importers and exporters. With time, we can build more detailed test scripts and distribute tests among people in the community.
### Fix and publish new RC, or finish
If bugs are found, fix them and commit to the release branch. Publish a new RC, following the steps above, until we have a stable version we feel confident to release.
## Release
The plugin is ready to go. We have published one or more RCs and the community have tested it. Lets get it live to the world!
### Finish version number
Back to the git repository, make sure everything is up to date:
```
cd $GIT_PATH
git checkout release/$NEW_VERSION
git pull
```
Edit `src/readme.txt` and `src/tainacan.php` and change the version numbers to `$NEW_VERSION`.
Commit and push.
### Set build to production mode
Edit `webpack.config.js` to set production mode.
2019-05-20 19:33:00 +00:00
### Build
2019-03-21 16:03:11 +00:00
```
./build.sh
cd $BUILD_PATH
```
### Set build to development mode
```
cd $GIT_PATH
git checkout webpack.config.js
```
### Prepare SVN repo
clean trunk
```
rm -rf $SVN_PATH/trunk/*
```
### Copy new files
```
cp -R $BUILD_PATH/* $SVN_PATH/trunk/
```
2018-08-14 18:09:52 +00:00
Update assets
```
cp $GIT_PATH/wp-repo-assets/* $SVN_PATH/assets/
```
2019-04-16 20:55:55 +00:00
Create tag folder
```
2019-05-20 19:33:00 +00:00
cd $SVN_PATH
mkdir tags/$NEW_VERSION
cp -R trunk/* tags/$NEW_VERSION/
svn add tags/$NEW_VERSION
2019-04-16 20:55:55 +00:00
```
2018-08-14 18:09:52 +00:00
### Finish and commit
Go to the SVN folder
```
2018-11-21 17:05:14 +00:00
cd $SVN_PATH
```
`svn rm` all files that have been removed
```
svn st | grep '^!' | awk '{print $2}' | xargs svn rm
```
`svn add` all new files
```
svn st | grep '^?' | awk '{print $2}' | xargs svn add
```
Commit!
```
svn ci
```
2018-11-21 17:05:14 +00:00
### Check
In few minutes the new release should be available in the WordPress directory.
Check if everything is ok.
### Commit and create tag on git
Once the release is tested and confirmed, commit and create the tag on git.
2019-03-21 16:03:11 +00:00
Merge the release branch into master and develop branches and create a tag.
Using git flow:
2018-10-23 14:24:59 +00:00
```
2018-11-21 17:05:14 +00:00
cd $GIT_PATH
2019-03-21 16:03:11 +00:00
git flow release finish $NEW_VERSION
2018-10-23 14:24:59 +00:00
git push --all
git push --tags
```