Make releasing a git-linear process
- Git tag releases - Amend README and Changelog for the release - Prepare the next developement phasedev-ui
parent
b07fd6240a
commit
e91c5bc2ad
|
@ -1,9 +1,10 @@
|
|||
NEXT RELEASE (Change that when releasing)
|
||||
*IN-DEVELOPEMENT*
|
||||
----------------
|
||||
Make licence explicit: it is GPLv3 as per the conditions of the source
|
||||
code dump from Epsitec.
|
||||
Fix URL of colobot repository.
|
||||
Render README for Markdown.
|
||||
Ease git-based releasing.
|
||||
|
||||
----------------
|
||||
2012-10-05
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# Colobot Data Files
|
||||
|
||||
## Development Release [[[date]]]
|
||||
## *IN-DEVELOPEMENT* Release
|
||||
|
||||
This package contains the data files for the Colobot project (https://github.com/colobot/colobot).
|
||||
It includes (or will include):
|
||||
|
|
|
@ -1,31 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Bash script to create a zipped package labeled with current date
|
||||
|
||||
# Get current date (UTC)
|
||||
date=`date -u '+%Y-%m-%d'`
|
||||
# Name of directory in zip
|
||||
dir_name="colobot-data-$date"
|
||||
# Name of zip
|
||||
zip_name="$dir_name.zip"
|
||||
|
||||
# git branches
|
||||
current_branch=$(git rev-parse --abbrev-ref HEAD)
|
||||
release_branch=${current_branch}_release_$date
|
||||
|
||||
# Create new branch for the date substitution
|
||||
git checkout -b $release_branch >/dev/null 2>&1
|
||||
# Prepare the release where needed
|
||||
sed -i 's/\[\[\[date\]\]\]/'"$date"'/' README.txt
|
||||
|
||||
# Commit the changes
|
||||
git commit README.txt -m "colobot-data $date release" >/dev/null
|
||||
|
||||
# Create the zipfile
|
||||
echo -n "Creating package $zip_name …"
|
||||
git archive --prefix=$dir_name/ --format=zip $release_branch > ../$dir_name.zip
|
||||
echo " done!"
|
||||
|
||||
# Cleanup our trails
|
||||
git checkout $current_branch >/dev/null 2>&1
|
||||
git branch -D $release_branch >/dev/null
|
|
@ -0,0 +1,41 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Bash script to create a zipped package labeled with current date
|
||||
|
||||
# Get current date (UTC)
|
||||
version=`date -u '+%Y-%m-%d'`
|
||||
# Full archive name
|
||||
git_release_tag=colobot-data-$version
|
||||
# Name of archive
|
||||
archive_name="$git_release_tag.zip"
|
||||
|
||||
echo -n "Preparing the $version release …"
|
||||
# Prepare the release where needed
|
||||
for f in README.md CHANGELOG.txt; do
|
||||
sed -i 's/\*IN-DEVELOPEMENT\*/'"$version"'/' $f
|
||||
git add $f
|
||||
done
|
||||
|
||||
# Commit the changes
|
||||
git commit -m "colobot-data $version release" >/dev/null
|
||||
git tag -m "colobot-data $version release" $git_release_tag
|
||||
echo " done!"
|
||||
|
||||
# Create the zipfile
|
||||
echo -n "Creating package $archive_name …"
|
||||
git archive --prefix=$git_release_tag/ --format=zip $git_release_tag > ../$archive_name
|
||||
echo " done!"
|
||||
|
||||
echo -n "Post-release cleanup …"
|
||||
# Cleanup our trails
|
||||
git checkout HEAD^ README.md >/dev/null 2>&1
|
||||
mv CHANGELOG.txt CHANGELOG-TAIL.txt
|
||||
echo "*IN-DEVELOPEMENT*
|
||||
----------
|
||||
" > CHANGELOG.txt
|
||||
cat CHANGELOG-TAIL.txt >> CHANGELOG.txt
|
||||
rm CHANGELOG-TAIL.txt
|
||||
git add CHANGELOG.txt
|
||||
|
||||
git commit -m "Post-release preparations" > /dev/null
|
||||
echo " done!"
|
Loading…
Reference in New Issue