Skip to content

Instantly share code, notes, and snippets.

@rustyrussell
Created October 26, 2018 00:42
Show Gist options
  • Select an option

  • Save rustyrussell/02c34e14cc3bb841b7a88cd0b5ff3b4f to your computer and use it in GitHub Desktop.

Select an option

Save rustyrussell/02c34e14cc3bb841b7a88cd0b5ff3b4f to your computer and use it in GitHub Desktop.

Revisions

  1. rustyrussell created this gist Oct 26, 2018.
    49 changes: 49 additions & 0 deletions build-release.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,49 @@
    #! /bin/sh
    set -e

    if [ "$(git status --porcelain -u no)" != "" ]; then
    echo "Not a clean git directory" >&2
    exit 1
    fi

    VERSION=`git tag --points-at HEAD`
    if [ "$VERSION" = "" ]; then
    echo "No tagged version at HEAD?" >&2
    exit 1
    fi

    # Make sure repo is clean.
    make distclean

    for platform in Fedora-28-amd64 Ubuntu-16.04-amd64 Ubuntu-16.04-i386; do
    case $platform in
    Fedora-28-amd64)
    DOCKERFILE=contrib/Dockerfile.builder.fedora
    TAG=fedora
    ;;
    Ubuntu-16.04-amd64)
    DOCKERFILE=contrib/Dockerfile.builder
    TAG=ubuntu-amd64
    ;;
    Ubuntu-16.04-i386)
    DOCKERFILE=contrib/Dockerfile.builder.i386
    TAG=ubuntu-i386
    ;;
    *)
    echo "No Dockerfile for $platform" >&2
    exit 1
    esac

    docker build -f $DOCKERFILE -t $TAG .
    docker run --rm=true -v `pwd`:/build -w /build $TAG ./configure
    docker run --rm=true -v `pwd`:/build -w /build $TAG make -j3
    docker run --rm=true -v `pwd`:/build -w /build $TAG make install DESTDIR=/build/$VERSION-$platform
    (cd $VERSION-$platform && tar cvfz ../clightning-$VERSION-$platform.tar.gz *)
    docker run --rm=true -v `pwd`:/build -w /build $TAG rm -rf $VERSION-$platform
    docker run --rm=true -v `pwd`:/build -w /build $TAG make distclean
    done

    git archive --format=zip -o clightning-$VERSION.zip --prefix=lightning-master/ master

    sha256sum clightning-$VERSION* > SHA256SUMS
    gpg -s --armor -o SHA256SUMS.asc-$(gpgconf --list-options gpg | awk -F: '$1 == "default-key" {print $10}' | tr -d '"') SHA256SUMS