Skip to content

Commit

Permalink
Create Debian packages and deploy to the github release (#67)
Browse files Browse the repository at this point in the history
  • Loading branch information
PawelLipski committed Dec 15, 2019
1 parent 46a8abf commit f23e166
Show file tree
Hide file tree
Showing 9 changed files with 82 additions and 17 deletions.
3 changes: 3 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.eggs/
.tox/
ci/Dockerfile-*
41 changes: 27 additions & 14 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,36 +3,49 @@ language: python
jobs:
include:
- python: 2.7
env: TOXENV=py27
- python: 2.7
env: TOXENV=pep8
- python: 3.6
env: TOXENV=py36
env: TOXENV=py27,pep8
- python: 3.6
env: TOXENV=pep8
env: TOXENV=py36,pep8
- python: 3.8
env: TOXENV=py38
- python: 3.8
env: TOXENV=pep8
env: TOXENV=py38,pep8
cache: pip

install: pip install tox
script: tox

script:
- tox
- python setup.py sdist bdist_wheel

before_deploy: # Wrapped in an `if` to make sure it's run only once before the first deploy and not before every single deploy
if [[ -z "$DEB_BUILT" ]]; then
export DEB_BUILT=true &&
docker build -f ci/Dockerfile-stdeb -t git-machete:stdeb . &&
id=$(docker create git-machete:stdeb) &&
docker cp $id:/git-machete/deb_dist . &&
docker rm -v $id;
fi

deploy:

- provider: pypi
skip_cleanup: true
username: "__token__"
password:
secure: U6JJcByjLv2PutUpnpqDT7cNIUYu9Ap9t4G90KULEn6Syxa49aX14BT6k2jBakWbQgrPCxLLNSWeCoC4xPl/Z2/9HLEFxZLVovtVbiaJ8HrTcoWmEZijnGob9Ofh94TFP8VtifjqHXeIrPi78XyZEks/ed0Sj3jSH4BL74PDHvqbD1RnsezFm4QGI2ESOWY+laJ2ralcpHRJh0hJb0QHxOpbKPVM+QefiFs+VFkFP25hQcn/G3qdduzW5NQ8OHBYCbevy6/1yt/M67ZzAeA0n4UrkZ/3vBsMJJ3wynWWZ3xO+lGs6eqZ31E8vicogYbw5hXs119JRkKUrcU5uqVL1mogf8N6y76w2xNV6Aul/XtpBiuPQsHm0tChwTI6yyGzAZBRPMB1KzRclDKGQThIBhpX+wfqHSpvdj1CZV5AMm3+6nHA0LSGWiuJ1BW7pTrAp9YFPbrQfH59JWMhy8ng5lexcQQj7spSO/DPw0VMIfUiw644BfSfyZwls5du4yYfWOkd8RoELEa2IGqCp1sTqjWvSuX3nzKCbJhxAwrVU5mK9fiMPcL1jURIwlFvooI+qKAp3CdGZ1IM+HFmpzXym2kvZvmrNXduVSZcqG3DrCFxt77FYsN5SNB/uly1vLq/6Y0BaCw9ao6YWfW3fvU2cCcyejjzPyfGzZ2jA5uOpZ8=
distributions: "sdist bdist_wheel"
on:
condition: $TOXENV = py36
python: 3.6
tags: true

- provider: releases # Github
api_key:
skip_cleanup: true
release_notes: "See [RELEASE_NOTES](RELEASE_NOTES.md) for details."
token:
secure: arhgNhJMfVq8xaa5xMswvjkgfgE8dDJ6BM0X+HI28m7BrwjxaVyr5Ct1qIohEQSZOpihwHzFLLwzSICc5sR6H8Ai4yYcm/sLGOAHyp4p1HeAXPqbtyUtn3rbcjsKXSfwjntkGommC6sYoY5GZhJy2qcRQIADjRMPQWRURY5/6KBBY05scL2vVpQw2NHp2pNCiMSDhokFsN3mv1PX15QDJdKFuIrD61cD15ljkwol7OJ+wKzGozyJB6GHkWi7WsGXsgdzjruHY7tcqPEksa+sWxxGGMmLQ7gVruVUlguunACjh0xlZvMBDKWEeffvRy9JSkAKVccTtaiZw9beoCaihZOVys/Bw4Znv3e+UpkOOrBwMFOdjc1R/Kz1/aewuYFckKhP/opdkpOj3T0VIckmK4s/vWYWhHLRiAHE4gb47UxYIKHGqPfs9XMyZryRF6iaTm3LKtTb+ufM0OQEKtWR0MBBRmpqapx74Jd6tuf7n4KbsS4ZuVeb27+OBhfogpYdfGW2KxzwCOwYl+iGCsNkPyMUOmqo8MfFvwEsHU7SnZ1G2tcSoptT8+Bj8n2lKB7sf/llywUJxKKG9kpK9Y9Tc6yvtgjj4ewjsjgaGCksS5jVPk223WEHu/iX4FK4Ftms9cXWLbQpMKW4dACyAEu8ONIRw+TXvUFA2J3wWsOiQNk=
file_glob: true
file: "dist/*"
file:
- dist/*
- deb_dist/*.deb
on:
condition: $TOXENV = py36
python: 3.6
tags: true
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2018 Paweł Lipski
Copyright (c) 2017-2019 Paweł Lipski

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,11 @@ We suggest a couple of alternative ways of installation.

**Bash and zsh completion scripts are provided** in completion/ directory, see [wiki for their installation instructions](https://github.com/VirtusLab/git-machete/wiki).

git-machete works under both Python 2.7 and Python 3.
git-machete works under both Python 2.7 and Python 3.x.

### Using Debian packages (Ubuntu, Debian etc.)

See [the latest release](https://github.com/VirtusLab/git-machete/releases/latest) for downloadable .deb packages.

### Using AUR (Arch Linux only)

Expand Down
5 changes: 5 additions & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Release notes

## New in git-machete 2.12.4

- fixed: artifact upload to Github Releases
- added: creation and upload of Debian packages to Github Releases

## New in git-machete 2.12.3

- improved: build process
Expand Down
30 changes: 30 additions & 0 deletions ci/Dockerfile-stdeb
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
FROM ubuntu:18.04

# This has to be done within `ubuntu` Docker image. Otherwise (when running on a default Travis Ubuntu Xenial VM), Travis fails with the following:

# python setup.py install --force --root=debian/python-git-machete --no-compile -O0 --install-layout=deb --prefix=/usr
# usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
# or: setup.py --help [cmd1 cmd2 ...]
# or: setup.py --help-commands
# or: setup.py cmd --help
# error: option --install-layout not recognized

RUN apt-get update && apt-get install -y python-all python-pip python3-pip python3-stdeb dh-python git lintian

COPY . git-machete/
WORKDIR git-machete/
RUN pip install pbr
RUN pip3 install pbr
# Hacks necessary to enforce a reasonable description in the generated Debian package (instead of one autogenerated from the existing summary and README.md)
RUN sed -i 's/summary =.*/summary = Git repository organizer \& rebase workflow automation tool/' setup.cfg
RUN cp ci/README-stdeb.md README.md
RUN python3 setup.py --command-packages=stdeb.command sdist_dsc --with-python2=True --with-python3=True --copyright-file=LICENSE bdist_deb

WORKDIR deb_dist/
RUN ls -l
RUN dpkg-deb --info python3-git-machete_*.deb
RUN dpkg-deb --contents python3-git-machete_*.deb
RUN lintian python3-git-machete_*.deb
RUN dpkg --install python3-git-machete_*.deb
RUN which git-machete
RUN git machete --version
7 changes: 7 additions & 0 deletions ci/README-stdeb.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
git machete is a versatile tool for organizing your repo with features like:
- neat, customizable git machete status that shows what branches are in sync
with their parent branch/remote tracking branch and which of them need to
be rebased/pulled/pushed,
- semi-automatic traversal of the branches that helps you effortlessly rebase
and push/pull the branches you care for (git machete traverse),
- automatic discovery of branch relations (git machete discover).
2 changes: 1 addition & 1 deletion git_machete/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = '2.12.3'
__version__ = '2.12.4'
3 changes: 3 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,6 @@ universal = 1
[pbr]
warnerrors = True
[easy_install]
allow_hosts = *.python.org,*.pythonhosted.org,pypi.org

0 comments on commit f23e166

Please sign in to comment.