We describe here one way to work with the package sources.

Initialize cowbuilder:

sudo cowbuilder --create --distribution sid --mirror http://http.debian.net/debian --debootstrapopts "--keyring=/usr/share/keyrings/debian-archive-keyring.gpg" --basepath /var/cache/pbuilder/base-debian-sid.cow

Optionally update cowbuilder:

sudo cowbuilder --update --basepath /var/cache/pbuilder/base-debian-sid.cow

Clone the repository:

git clone git@github.com:Yubico/yubikey-personalization-gui-dpkg.git

Build the package:

git-buildpackage --git-pristine-tar --git-builder="pdebuild --auto-debsign --pbuilder cowbuilder -- --twice --basepath /var/cache/pbuilder/base-debian-sid.cow"

If all goes well, you should have newly built packages in
/var/cache/pbuilder/result/.

Update the package to a new upstream release (don't forget debian/changelog):

git-import-orig --pristine-tar /path/to/new-release.tar.gz

An alternative way compared to git-buildpackage is to build the
package using gitpkg:

git config gitpkg.deb-export-hook /usr/share/gitpkg/hooks/quilt-patches-deb-export-hook
git config gitpkg.pre-export-hook /usr/share/gitpkg/hooks/pristine-tar-pre-export-hook
git config gitpkg.create-fake-orig false
git config gitpkg.force-overwrite-orig false
gitpkg master
