Skip to content

Instantly share code, notes, and snippets.

@smoser
Last active February 28, 2020 16:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save smoser/3cd61fe6e08f0c0955ef949350897d15 to your computer and use it in GitHub Desktop.
Save smoser/3cd61fe6e08f0c0955ef949350897d15 to your computer and use it in GitHub Desktop.
ssh-import-id Upstream and Ubuntu release process

ssh-import-id Release Process

Development

  • Bugs on launchpad: Bugs are done on launchpad. upstream, ubuntu package.
  • Version Control: Using Git on launchpad. ssh-import-id
  • Pull Requests / Merge Proposals: Use launchpad merge proposals to master first. Then release to ubuntu.
  • CI: I'm not sure what C-i is in place.

Upstream Release Process

To make a new ssh-import-id upstream release.

  1. Set variables. These are referenced in code snippets below.

    $ LAST_RELEASE=5.9
    $ RELEASE=5.10
    $ NEXT_RELEASE=5.11
    
  2. make a release commit on master that does the following. An example is 5.8 commit.

    • Update ssh_import_id/version.py to contain the new $RELEASE. This should work:

      $ sed -i "s/${LAST_RELEASE}/${RELEASE}/" ssh_import_id/version.py
      
    • Update debian/changelog with changes. The

      Then update update debian/changelog with new release information

      $ dch --newversion ${RELEASE}-0ubuntu1
      

      I would run log2dch to get the content and then just paste it in. Something like:

      $ git log ${LAST_RELEASE}.. | log2dch
      

      Then release to the most recent ubuntu series.

       $ dch --release --distribution=$(ubuntu-distro-info --devel)
      

      Commit.

       $ git commit -m "Release $RELEASE" debian/changelog ssh_import_id/version.py
      
  3. Tag, Sign commit and push

    $ git tag --sign --message="Release $RELEASE" $RELEASE
    $ git push origin HEAD $RELEASE
    
  4. Create a source tarball and sign.

    $ ./tools/make-tarball 
    ssh-import-id-5.9.tar.gz
    
    $ gpg --sign --armour --detach-sig ssh-import-id-$RELEASE.tar.gz
    
  5. Upload to launchpad. You can do this manually, but I like lp-project-upload from lptools.

    # If you don't create changes.txt and release notes it prompts you for them.
    $ git log $LAST_RELEASE.. | log2dch | sed -e 's,^[ ]*,,' > changes.txt
    $ : > release-notes.txt
    
    $ lp-project-upload ssh-import-id $RELEASE \
        ssh-import-id-$RELEASE.tar.gz \
        $NEXT_RELEASE changes.txt release-notes.txt
    

    After doing the above you should see changes at ssh-import-id/trunk.

  6. Upload to pypi. After doing so, you should see the new release in pypi/ssh-import-id.

    # just for reference, my .pypirc
    $ cat .pypirc 
    [distutils]
    index-servers = pypi
    
    [pypi]
    repository: https://pypi.python.org/pypi
    username: smoser
    
    $ ./setup.py sdist upload --sign
    
  7. Quick Sniff test pypi. Install it in a virtual env and give it a quick run. I use venv for creating virtual envs, but do whatever you want.

    $ venv create /tmp/mytest pip install ssh-import-id==$RELEASE
    $ venv activate /tmp/mytest ssh-import-id --output=/dev/null smoser
    
  8. Close Bugs. Just go through any bugs closed and mark them fix-released in $RELEASE.

Ubuntu Release Process

This basically follows the cloud-init or curtin release process, using new-upstream-snapshot

  1. If this is a new upstream release (rather than a snapshot), make sure you upload the same orig tarball to ubuntu. I did this with below. Note the orig.tar.gz has a '_' while the upstream has a '-'.

    $ mkdir -p ../dl
    $ cp ssh-import-id.tar.gz ../dl/
    $ ln ../dl/ssh-import-id-$RELEASE.tar.gz ../dl/ssh-import-id_${RELEASE}.orig.tar.gz
    
  2. Run new-upstream-snapshot process

     $ git checkout ubuntu/devel
     $ git fetch origin
     $ git reset --hard origin/ubuntu/devel
     
     # you may need to merge debian/changelog manually as upstream keeps this.
     $ new-upstream-snapshot
     
     # its output tells you to finish this with:
     
     $ sed -i -e "1s/UNRELEASED/focal/" debian/changelog
     $ git commit -m "releasing ssh-import-id version $RELEASE-0ubuntu1" debian/changelog
     $ git tag ubuntu/$RELEASE-0ubuntu1
     $ git push origin ubuntu/devel:ubuntu/devel ubuntu/$RELEASE-0ubuntu1
    
  3. Build source package, binary package, upload.

    I use build-package and sbuild/sbuild-it. But do whatever you like.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment