2018-08-10 22:02:49 +00:00
|
|
|
# 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.
|
2018-08-10 22:02:49 +00:00
|
|
|
|
|
|
|
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)
|
2018-08-10 22:02:49 +00:00
|
|
|
* $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
|
|
|
|
|
|
|
|
|
|
|
|
### Start in the git repository
|
|
|
|
|
|
|
|
```
|
|
|
|
cd $GIT_PATH
|
2018-10-23 14:24:59 +00:00
|
|
|
git checkout develop
|
|
|
|
git pull
|
2018-08-10 22:02:49 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
### Edit version numbers
|
|
|
|
|
2018-10-23 19:18:17 +00:00
|
|
|
Edit `src/readme.txt` and 'src/tainacan.php' and change the version numbers to `$NEW_VERSION`.
|
|
|
|
|
|
|
|
### Set build to production mode
|
|
|
|
|
|
|
|
Edit `webpack.config.js` to set production mode.
|
2018-08-10 22:02:49 +00:00
|
|
|
|
|
|
|
### Commit and create tag
|
|
|
|
|
|
|
|
```
|
2018-10-23 19:18:17 +00:00
|
|
|
git commit -am"Releasing version $NEW_VERSION"
|
2018-08-10 22:02:49 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
### Build and cleanup
|
|
|
|
|
|
|
|
```
|
|
|
|
./build.sh
|
|
|
|
cd $BUILD_PATH
|
|
|
|
rm admin/scss/.sass-cache
|
|
|
|
```
|
|
|
|
|
|
|
|
### Prepare SVN repo
|
|
|
|
|
|
|
|
Create tag with the old version
|
|
|
|
|
|
|
|
```
|
|
|
|
svn cp https://plugins.svn.wordpress.org/tainacan/trunk https://plugins.svn.wordpress.org/tainacan/tags/$OLD_VERSION
|
|
|
|
```
|
|
|
|
|
|
|
|
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/
|
|
|
|
```
|
|
|
|
|
|
|
|
|
2018-08-10 22:02:49 +00:00
|
|
|
### Finish and commit
|
|
|
|
|
|
|
|
Go to the SVN folder
|
|
|
|
|
|
|
|
```
|
|
|
|
cd $SVN_PATH/trunk
|
|
|
|
```
|
|
|
|
|
|
|
|
`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-10-23 14:24:59 +00:00
|
|
|
### Create tag on git
|
|
|
|
|
|
|
|
```
|
|
|
|
git tag $NEW_VERSION
|
|
|
|
git checkout master
|
|
|
|
git merge develop
|
|
|
|
git push --all
|
|
|
|
git push --tags
|
|
|
|
```
|
|
|
|
|
2018-10-23 19:18:17 +00:00
|
|
|
### Set build back to development mode
|
2018-08-10 22:02:49 +00:00
|
|
|
|
2018-10-23 19:18:17 +00:00
|
|
|
Once you go back to develop branch, remember editing `webpack.config.js` to set production mode.
|
2018-08-10 22:02:49 +00:00
|
|
|
|
|
|
|
|