This file is used to document the formal release process.  Populate
the next time I do a real release.  Needed because I apparently forgot
to manually update the "Change Summary" section of RELEASE/README.txt.


# Choose a release
export RELEASE=20201014.0
export SWAKSDIR=/Users/jetmore/Documents/git/swaks
export BUILDDIR=$SWAKSDIR/tmp

# We will be releasing what's in the develop branch
# create a branch from develop named release/v$RELEASE
git fetch
git checkout develop
git pull
git checkout -b release/v$RELEASE

# review deprecations
  - base.pod.  Make sure new deprecations are present.  Update the "not before" date
  - remove code/docs/tests for any functionality that has reached its not-before date
  - add Changes entry for any removed functionality

# Update Changes, add a release entry

# run automated testing
## run all tests non-interactively
TEST_SWAKS=../../swaks bin/run-all.pl
## rerun any failed tests in interactive mode
TEST_SWAKS=../../swaks bin/run-all.pl --errors

# run manual testing
## see steps in testing/MANUAL.txt

# Generate a skeleton of the announce blog post.  Don't publish it yet, but you should
# draft and save it so you can have the URL for the following docs
https://www.jetmore.org/john/blog/2020/10/swaks-release-20201014-0-available/

# update README.md

# update App-swaks/Changes (in general this will only ever be "repackaging of version blah blah blah".  Only thing else would be changes specifically related to packaging)

# update App-swaks/Makefile.PL (version)

# update App-swaks/README (version and copyright year)

# update doc/index.html

# update doc/versions.html

# update doc/installation.html (fix the links in the direct-download examples to include the latest version, also the link to App::swaks)

# open doc/versions.html, doc/index.html, and installation.html in a browser and make sure everything looks ok

# Run the spell checker
# aspell --personal to set a personal wordlist doesn't seem to work, but using the "default"
# personal word list does.  So change where aspell looks for the default personal word list
# setting $HOME
# alias aspell=~/Documents/dev/bin/aspell

# Can save changes directly:
HOME=$SWAKSDIR/util aspell check Changes
HOME=$SWAKSDIR/util aspell --mode perl check swaks
HOME=$SWAKSDIR/util aspell --mode html check doc/faq.html
HOME=$SWAKSDIR/util aspell --mode html check doc/index.html
HOME=$SWAKSDIR/util aspell --mode html check doc/installation.html
HOME=$SWAKSDIR/util aspell check RELEASE/README.txt
HOME=$SWAKSDIR/util aspell check doc/recipes.pod
HOME=$SWAKSDIR/util aspell check doc/base.pod
HOME=$SWAKSDIR/util aspell check App-swaks/Changes
HOME=$SWAKSDIR/util aspell check App-swaks/README
HOME=$SWAKSDIR/util aspell --mode markdown check README.md

# run the actual script (this preps some stuff, but this won't be the final release):
$SWAKSDIR/util/gen-release.pl $RELEASE

# review RELEASE/README.txt and update with detailed changes and high-level overview of release

HOME=$SWAKSDIR/util aspell check RELEASE/README.txt

# Create the release gz and post on the website
# this tar command is for macos.  linux would not need the env variable and would use --transform instead of -s
/bin/rm $BUILDDIR/swaks-$RELEASE.tar.gz
COPYFILE_DISABLE=1 tar -cvzf $BUILDDIR/swaks-$RELEASE.tar.gz -s/^RELEASE/swaks-$RELEASE/ --exclude '._*' RELEASE
scp $BUILDDIR/swaks-$RELEASE.tar.gz ftp.jetmore.org:jetmore.org/john/code/swaks/files

# Build the perl distribution
cd $SWAKSDIR/App-swaks
perl Makefile.PL
make dist
/bin/mv App-swaks-$RELEASE.tar.gz $BUILDDIR/
make distclean
# we rebuild these each time and already store a "release" copy in RELEASE, no reason to store them here too
/bin/rm swaks LICENSE

# unpack files on the server and set up the "latest" link
ssh ftp.jetmore.org /bin/tar -xzvf jetmore.org/john/code/swaks/files/swaks-$RELEASE.tar.gz -C jetmore.org/john/code/swaks/files
ssh ftp.jetmore.org /bin/rm jetmore.org/john/code/swaks/latest jetmore.org/john/code/swaks/latest.tar.gz
ssh ftp.jetmore.org /bin/ln -s files/swaks-$RELEASE /home/jetmore/jetmore.org/john/code/swaks/latest
ssh ftp.jetmore.org /bin/ln -s files/swaks-$RELEASE.tar.gz /home/jetmore/jetmore.org/john/code/swaks/latest.tar.gz

###
# At this point the release files are published on the server but nothing's pointing to them yet.  Audit
# links in the unpublished blog post, README.md, index.html, etc to make sure they will work

# start actually publishing
scp doc/index.html ftp.jetmore.org:jetmore.org/john/code/swaks/index.html
scp doc/versions.html ftp.jetmore.org:jetmore.org/john/code/swaks/versions.html
scp doc/faq.html ftp.jetmore.org:jetmore.org/john/code/swaks/faq.html
scp doc/installation.html ftp.jetmore.org:jetmore.org/john/code/swaks/installation.html

### publish the perl package to cpan
# requires `cpan install CPAN::Uploader`
# `perl -MConfig -e 'Config::config_vars(qw(prefix));'` for probable install location
# see https://metacpan.org/pod/distribution/CPAN-Uploader/bin/cpan-upload for format of .pause
/usr/local/Cellar/perl/5.32.0/bin/cpan-upload --config $BUILDDIR/.pause $BUILDDIR/App-swaks-$RELEASE.tar.gz

(recommend updating the links in this file and saving before actually doing this git stuff)

# tag the release and merge the release branch into master
git fetch
git checkout master
git pull
git merge --no-ff release/v$RELEASE
git push
git tag -a v$RELEASE -m "Tagging the $RELEASE release"
git push origin v$RELEASE

# merge release branch into develop (there can be conflicts here)
git checkout develop
git pull
git merge --no-ff release/v$RELEASE
git push


###
# To this point we're published but we haven't told anyone yet.  Start sending actual announcements:

# publish the draft blog post

# send twitter notification
# Swaks release 20201014.0 available :: https://www.jetmore.org/john/blog/2020/10/swaks-release-20201014-0-available/ :: Share and Enjoy!


# send email to those who have requested it
g3: egrep -v '^#' ~/Documents/programming/swaks/NOTIFY  | egrep -v '^$'

######
Subject: Swaks 20201014.0 released

A new version of Swaks is available for download.  Please visit
https://www.jetmore.org/john/blog/2020/10/swaks-release-20201014-0-available/
for links and details.

--John

--
You are receiving this email because at one point you signed up to
receive announcements about Swaks.  If you no longer wish to receive
these updates please respond to this email and ask to be removed.
##########

########################################
########################################

Prepare for future development:
 - release branch can be deleted
 - rebase in-progress branches on new develop





