diff --git a/.travis.yml b/.travis.yml index 0b60e37..1d38b29 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,6 +11,8 @@ script: - python3 -m pylint instaloader - python3 -m mypy -m instaloader - make -C docs html SPHINXOPTS="-W -n" +addons: + ssh_known_hosts: aur.archlinux.org deploy: - provider: pypi user: aandergr @@ -28,3 +30,8 @@ deploy: on: branch: master python: 3.6 + - provider: script + script: deploy/arch/deploy.sh $TRAVIS_TAG + on: + tags: true + python: 3.6 diff --git a/deploy/arch/.SRCINFO.template b/deploy/arch/.SRCINFO.template new file mode 100644 index 0000000..97cdae6 --- /dev/null +++ b/deploy/arch/.SRCINFO.template @@ -0,0 +1,15 @@ +pkgbase = instaloader + pkgdesc = Command line tool to download pictures, videos and metadata from Instagram + pkgver = {{version}} + pkgrel = 1 + url = https://instaloader.github.io/ + arch = any + license = MIT + makedepends = python-setuptools + depends = python>=3.5 + depends = python-requests>=2.4 + options = !emptydirs + source = instaloader-{{version}}.tar.gz::https://codeload.github.com/instaloader/instaloader/tar.gz/v{{version}} + sha512sums = {{hash}} + +pkgname = instaloader diff --git a/deploy/arch/PKGBUILD.template b/deploy/arch/PKGBUILD.template new file mode 100644 index 0000000..dcacce3 --- /dev/null +++ b/deploy/arch/PKGBUILD.template @@ -0,0 +1,27 @@ +# Maintainer: André Koch-Kramer + +pkgname=instaloader +pkgver={{version}} +pkgrel=1 +pkgdesc="Command line tool to download pictures, videos and metadata from Instagram" +arch=('any') +url="https://instaloader.github.io/" +license=('MIT') +groups=() +depends=('python>=3.5' 'python-requests>=2.4') +makedepends=('python-setuptools') +options=('!emptydirs') +source=($pkgname-$pkgver.tar.gz::https://codeload.github.com/instaloader/instaloader/tar.gz/v$pkgver) +sha512sums=('{{hash}}') + +build() { + cd "$srcdir/$pkgname-$pkgver" + python setup.py clean --all + python setup.py build +} + +package() { + cd "$srcdir/$pkgname-$pkgver" + install -Dm644 LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE + python setup.py install --root "$pkgdir/" --skip-build +} diff --git a/deploy/arch/deploy.sh b/deploy/arch/deploy.sh new file mode 100755 index 0000000..287aabd --- /dev/null +++ b/deploy/arch/deploy.sh @@ -0,0 +1,26 @@ +#!/usr/bin/env bash + +cd $(dirname $0) + +# decrypt and add ssh key +openssl aes-256-cbc -K $encrypted_354637631c28_key -iv $encrypted_354637631c28_iv -in id_rsa_AUR.enc -out /tmp/AUR_openssh -d +eval "$(ssh-agent -s)" +chmod 600 /tmp/AUR_openssh +ssh-add /tmp/AUR_openssh + +# clone and modify AUR repo +git clone --depth 1 ssh://aur@aur.archlinux.org/instaloader.git + +curl -sSfOJ https://codeload.github.com/instaloader/instaloader/tar.gz/$1 +VERSION=${1:1} +HASH=$(sha512sum instaloader-$VERSION.tar.gz | cut -f1 -d " ") +sed -e "s/{{version}}/$VERSION/g" -e "s/{{hash}}/$HASH/g" PKGBUILD.template > instaloader/PKGBUILD +sed -e "s/{{version}}/$VERSION/g" -e "s/{{hash}}/$HASH/g" .SRCINFO.template > instaloader/.SRCINFO + +# commit and push changes +cd instaloader +git config user.email "koch-kramer@web.de" +git config user.name "André Koch-Kramer" +git add . +git commit -m "Release of version $VERSION" +git push diff --git a/deploy/arch/id_rsa_AUR.enc b/deploy/arch/id_rsa_AUR.enc new file mode 100644 index 0000000..cad2372 Binary files /dev/null and b/deploy/arch/id_rsa_AUR.enc differ