3 # IMPORTANT: the following assumptions are made
4 # * the GH repo is on the origin remote
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 # make hash on local files
17 if [ -z "$1" ]; then echo "ERROR: specify version number like this: $0 1994.09.06"; exit 1; fi
19 if [ ! -z "`git tag | grep "$version"`" ]; then echo 'ERROR: version already present'; exit 1; fi
20 if [ ! -z "`git status --porcelain | grep -v CHANGELOG`" ]; then echo 'ERROR: the working directory is not clean; commit or stash changes'; exit 1; fi
21 if [ ! -f "updates_key.pem" ]; then echo 'ERROR: updates_key.pem missing'; exit 1; fi
23 echo "\n### First of all, testing..."
25 nosetests
--with-coverage --cover-package=youtube_dl
--cover-html test || exit 1
27 echo "\n### Changing version in version.py..."
28 sed -i~
"s/__version__ = '.*'/__version__ = '$version'/" youtube_dl
/version.py
30 echo "\n### Committing CHANGELOG README.md and youtube_dl/version.py..."
32 git add CHANGELOG README.md youtube_dl
/version.py
33 git commit
-m "release $version"
35 echo "\n### Now tagging, signing and pushing..."
36 git tag
-s -m "Release $version" "$version"
38 read -p "Is it good, can I push? (y/n) " -n 1
39 if [[ ! $REPLY =~ ^
[Yy
]$
]]; then exit 1; fi
41 MASTER
=$(git rev-parse --abbrev-ref HEAD)
42 git push origin
$MASTER:master
43 git push origin
"$version"
45 echo "\n### OK, now it is time to build the binaries..."
46 REV
=$(git rev-parse HEAD)
47 make youtube
-dl youtube
-dl.
tar.gz
48 wget
"http://jeromelaheurte.net:8142/download/rg3/youtube-dl/youtube-dl.exe?rev=$REV" -O youtube
-dl.exe
|| \
49 wget
"http://jeromelaheurte.net:8142/build/rg3/youtube-dl/youtube-dl.exe?rev=$REV" -O youtube
-dl.exe
50 mkdir -p "update_staging/$version"
51 mv youtube
-dl youtube
-dl.exe
"update_staging/$version"
52 mv youtube
-dl.
tar.gz
"update_staging/$version/youtube-dl-$version.tar.gz"
53 RELEASE_FILES
=youtube
-dl youtube
-dl.exe youtube
-dl-$version.
tar.gz
54 (cd update_staging
/$version/ && md5sum $RELEASE_FILES > MD5SUMS
)
55 (cd update_staging
/$version/ && sha1sum $RELEASE_FILES > SHA1SUMS
)
56 (cd update_staging
/$version/ && sha512sum
$RELEASE_FILES > SHA512SUMS
)
57 git checkout HEAD
-- youtube
-dl youtube
-dl.exe
59 echo "\n### Signing and uploading the new binaries to youtube-dl.org..."
60 for f
in $RELEASE_FILES; do gpg
--detach-sig "update_staging/$version/$f"; done
61 scp
-r "update_staging/$version" ytdl@youtube
-dl.org
:html
/downloads
/
64 echo "\n### Now switching to gh-pages..."
66 git checkout
"$MASTER" -- devscripts
/gh
-pages/
67 git
reset devscripts
/gh
-pages/
68 devscripts
/gh
-pages/add
-version.py
$version
69 devscripts
/gh
-pages/sign
-versions.py
< updates_key.pem
70 devscripts
/gh
-pages/generate
-download.py
71 devscripts
/gh
-pages/update
-copyright.py
73 mv cover test_coverage
74 git add
*.html
*.html.
in update test_coverage
75 git commit
-m "release $version"
77 read -p "Is it good, can I push? (y/n) " -n 1
78 if [[ ! $REPLY =~ ^
[Yy
]$
]]; then exit 1; fi
80 git push origin gh
-pages