Skip to content

Commit

Permalink
More fixes for release scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
gornostal committed May 5, 2019
1 parent 777e5e6 commit 2581c0d
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 28 deletions.
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ deploy:
file:
- ulauncher_${TRAVIS_TAG}.tar.gz
- ulauncher_${TRAVIS_TAG}_all.deb
- ulauncher_${TRAVIS_TAG}_fedora.rpm
- ulauncher_${TRAVIS_TAG}_fedora28.rpm
- ulauncher_${TRAVIS_TAG}_fedora29.rpm
- ulauncher_${TRAVIS_TAG}_centos7.rpm
skip_cleanup: true
on:
Expand Down
32 changes: 16 additions & 16 deletions scripts/aur-update.py
Original file line number Diff line number Diff line change
@@ -1,38 +1,38 @@
#!/usr/bin/env python2
#!/usr/bin/env python3

# Run in ArchLinux container

import os
import sys
import re
import urllib2
from urllib.request import urlopen
import json
from tempfile import mkdtemp
from subprocess import call

print "##################################"
print "# Updating AUR with a new PKGBUILD"
print "##################################"
print("##################################")
print("# Updating AUR with a new PKGBUILD")
print("##################################")

try:
version = sys.argv[1]
except IndexError:
print "ERROR: First argument should be version"
print("ERROR: First argument should be version")
sys.exit(1)

try:
update_stable = os.environ['UPDATE_STABLE'] in ('1', 'true')
except KeyError:
print "ERROR: UPDATE_STABLE is not defined"
print("ERROR: UPDATE_STABLE is not defined")
sys.exit(1)
print 'UPDATE_STABLE=%s' % update_stable
print('UPDATE_STABLE=%s' % update_stable)

try:
allow_prerelease = os.environ['ALLOW_PRERELEASE'] in ('1', 'true')
except KeyError:
print "Optional ALLOW_PRERELEASE is not set. Default to False"
print("Optional ALLOW_PRERELEASE is not set. Default to False")
allow_prerelease = False
print 'ALLOW_PRERELEASE=%s' % allow_prerelease
print('ALLOW_PRERELEASE=%s' % allow_prerelease)


if update_stable:
Expand All @@ -51,15 +51,14 @@ def main():
pkgbuild = pkgbuild_from_template(targz)
push_update(pkgbuild)
else:
print "Don't update AUR"
print("Don't update AUR")
sys.exit(0)


def fetch_release():
url = 'https://ext-api.ulauncher.io/misc/ulauncher-releases/%s' % version
print "Fetching release info from '%s'..." % url
response = urllib2.urlopen(url)
return json.load(response)
print("Fetching release info from '%s'..." % url)
return json.loads(urlopen(url).read().decode('utf-8'))


def get_targz_link():
Expand All @@ -84,7 +83,7 @@ def push_update(pkgbuild):
ssh_enabled_env = dict(os.environ, GIT_SSH_COMMAND=git_ssh_command)

temp_dir = mkdtemp()
print "Temp dir: %s" % temp_dir
print("Temp dir: %s" % temp_dir)
run_shell(('git', 'clone', aur_repo, temp_dir), env=ssh_enabled_env)
os.chdir(temp_dir)
run_shell(('git', 'config', 'user.email', 'ulauncher.app@gmail.com'))
Expand All @@ -100,7 +99,8 @@ def push_update(pkgbuild):
def run_shell(command, **kw):
code = call(command, **kw)
if code:
print "ERROR: command %s exited with code %s" % (command, code)
print("ERROR: command %s exited with code %s" % (command, code))
sys.exit(1)


main()
2 changes: 1 addition & 1 deletion scripts/build-rpm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ build-rpm () {

# Args:
# required: $1 version
# required: $2 distro name (feodra, suse, centos7). It should match with a suffix in setup.cfg
# required: $2 distro name (feodra, centos7). It should match with a suffix in setup.cfg
# optional: $3 file suffix

echo "##################################"
Expand Down
2 changes: 1 addition & 1 deletion scripts/dev-container.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ dev-container () {
-v $HOME/.bash_history:/root/.bash_history \
-p 3002:3002 \
--name ulauncher \
$SUSE_423_BUILD_IMAGE \
$BUILD_IMAGE \
bash
}
6 changes: 3 additions & 3 deletions scripts/make-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ make-release() {

set -ex

# create_deb
create_deb
create_rpms
# launchpad_upload
# aur_update
launchpad_upload
aur_update
}

create_deb() {
Expand Down
12 changes: 6 additions & 6 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@ group = Applications/Productivity
build_requires = gcc,make,python3-distutils-extra
requires = python3 >= 3.5
gobject-introspection
python-gobject
python3-gobject
keybinder3
libappindicator-gtk3
webkitgtk4
dbus-python
python-pyxdg
python-inotify
python-Levenshtein
python-websocket-client
dbus-python3
python3-pyxdg
python3-inotify
python3-Levenshtein
python3-websocket-client

0 comments on commit 2581c0d

Please sign in to comment.