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
9 # pip install coverage nose rsa
13 if [ -z "$1" ]; then echo "ERROR: specify version number like this: $0 1994.09.06"; exit 1; fi
15 if [ ! -z "`git tag | grep "$version"`" ]; then echo 'ERROR: version already present'; exit 1; fi
16 if [ ! -z "`git status --porcelain | grep -v CHANGELOG`" ]; then echo 'ERROR: the working directory is not clean; commit or stash changes'; exit 1; fi
17 if [ ! -f "updates_key.pem" ]; then echo 'ERROR: updates_key.pem missing'; exit 1; fi
19 echo "\n### First of all, testing..."
21 nosetests
--with-coverage --cover-package=youtube_dl
--cover-html test || exit 1
23 echo "\n### Changing version in version.py..."
24 sed -i~
"s/__version__ = '.*'/__version__ = '$version'/" youtube_dl
/version.py
26 echo "\n### Committing CHANGELOG README.md and youtube_dl/version.py..."
28 git add CHANGELOG README.md youtube_dl
/version.py
29 git commit
-m "release $version"
31 echo "\n### Now tagging, signing and pushing..."
32 git tag
-s -m "Release $version" "$version"
34 read -p "Is it good, can I push? (y/n) " -n 1
35 if [[ ! $REPLY =~ ^
[Yy
]$
]]; then exit 1; fi
39 echo "\n### OK, now it is time to build the binaries..."
40 REV
=$(git rev-parse HEAD)
41 make youtube
-dl youtube
-dl.
tar.gz
42 wget
"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
44 mkdir -p "update_staging/$version"
45 mv youtube
-dl youtube
-dl.exe
"update_staging/$version"
46 mv youtube
-dl.
tar.gz
"update_staging/$version/youtube-dl-$version.tar.gz"
47 git checkout HEAD
-- youtube
-dl youtube
-dl.exe
49 echo "\n### Signing and uploading the new binaries to youtube-dl.org..."
50 for f
in update_staging
/$version/*; do gpg
--detach-sig "$f"; done
51 scp
-r "update_staging/$version" ytdl@youtube
-dl.org
:html
/downloads
/
54 echo "\n### Now switching to gh-pages..."
55 MASTER
=$(git rev-parse --abbrev-ref HEAD)
57 git checkout
"$MASTER" -- devscripts
/gh
-pages/
58 git
reset devscripts
/gh
-pages/
59 devscripts
/gh
-pages/add
-version.py
$version
60 devscripts
/gh
-pages/sign
-versions.py
< updates_key.pem
61 devscripts
/gh
-pages/generate
-download.py
62 devscripts
/gh
-pages/update
-copyright.py
64 mv cover test_coverage
65 git add
*.html
*.html.
in update test_coverage
66 git commit
-m "release $version"
68 read -p "Is it good, can I push? (y/n) " -n 1
69 if [[ ! $REPLY =~ ^
[Yy
]$
]]; then exit 1; fi