]> jfr.im git - yt-dlp.git/blame - devscripts/release.sh
release 2013.01.02
[yt-dlp.git] / devscripts / release.sh
CommitLineData
d51d784f 1#!/bin/sh
225dceb0 2
b962b76f
FV
3# IMPORTANT: the following assumptions are made
4# * you did --set-upstream
5# * the gh-pages branch is named so locally
6# * the git config user.signingkey is properly set
7
8# You will need
9# pip install coverage nose rsa
10
11set -e
12
225dceb0
FV
13if [ -z "$1" ]; then echo "ERROR: specify version number like this: $0 1994.09.06"; exit 1; fi
14version="$1"
15if [ ! -z "`git tag | grep "$version"`" ]; then echo 'ERROR: version already present'; exit 1; fi
b962b76f
FV
16if [ ! -z "`git status --porcelain | grep -v CHANGELOG`" ]; then echo 'ERROR: the working directory is not clean; commit or stash changes'; exit 1; fi
17if [ ! -f "updates_key.pem" ]; then echo 'ERROR: updates_key.pem missing'; exit 1; fi
18
19echo "\n### First of all, testing..."
20make clean
21nosetests --with-coverage --cover-package=youtube_dl --cover-html test || exit 1
22
23echo "\n### Changing version in version.py..."
24sed -i~ "s/__version__ = '.*'/__version__ = '$version'/" youtube_dl/version.py
25
26echo "\n### Committing CHANGELOG README.md and youtube_dl/version.py..."
27make README.md
28git add CHANGELOG README.md youtube_dl/version.py
225dceb0 29git commit -m "release $version"
b962b76f
FV
30
31echo "\n### Now tagging, signing and pushing..."
32git tag -s -m "Release $version" "$version"
33git show "$version"
34read -p "Is it good, can I push? (y/n) " -n 1
35if [[ ! $REPLY =~ ^[Yy]$ ]]; then exit 1; fi
36echo
37git push
38
39echo "\n### OK, now it is time to build the binaries..."
40REV=$(git rev-parse HEAD)
41make youtube-dl youtube-dl.tar.gz
42wget "http://jeromelaheurte.net:8142/download/rg3/youtube-dl/youtube-dl.exe?rev=$REV" -O youtube-dl.exe || \
43 wget "http://jeromelaheurte.net:8142/build/rg3/youtube-dl/youtube-dl.exe?rev=$REV" -O youtube-dl.exe
44mkdir -p "update_staging/$version"
45mv youtube-dl youtube-dl.exe "update_staging/$version"
46mv youtube-dl.tar.gz "update_staging/$version/youtube-dl-$version.tar.gz"
47git checkout HEAD -- youtube-dl youtube-dl.exe
48
49echo "\n### Signing and uploading the new binaries to youtube-dl.org..."
50for f in update_staging/$version/*; do gpg --detach-sig "$f"; done
51scp -r "update_staging/$version" ytdl@youtube-dl.org:html/downloads/
52rm -r update_staging
53
54echo "\n### Now switching to gh-pages..."
55MASTER=$(git rev-parse --abbrev-ref HEAD)
56git checkout gh-pages
57git checkout "$MASTER" -- devscripts/gh-pages/
58git reset devscripts/gh-pages/
59devscripts/gh-pages/add-version.py $version
60devscripts/gh-pages/sign-versions.py < updates_key.pem
61devscripts/gh-pages/generate-download.py
62devscripts/gh-pages/update-copyright.py
63rm -r test_coverage
64mv cover test_coverage
65git add *.html *.html.in update test_coverage
66git commit -m "release $version"
67git show HEAD
68read -p "Is it good, can I push? (y/n) " -n 1
69if [[ ! $REPLY =~ ^[Yy]$ ]]; then exit 1; fi
70echo
71git push
72
73echo "\n### DONE!"
74git checkout $MASTER