From 0b4d883d81cf366ca7fefbc65ac1dc52ac4901ee Mon Sep 17 00:00:00 2001 From: Paulius Stakauskas Date: Thu, 31 Oct 2019 13:00:40 +0000 Subject: [PATCH] Fix debian builds --- contrib/docker/dpkg-build/Dockerfile | 44 ++++++++++++++-------------- contrib/docker/dpkg-build/control | 2 +- 2 files changed, 23 insertions(+), 23 deletions(-) diff --git a/contrib/docker/dpkg-build/Dockerfile b/contrib/docker/dpkg-build/Dockerfile index 5fc34847cf..90c7a4c70a 100644 --- a/contrib/docker/dpkg-build/Dockerfile +++ b/contrib/docker/dpkg-build/Dockerfile @@ -1,34 +1,34 @@ FROM commerceblock/debbase:latest ARG token -ENV GITHUB_RELEASE_ACCESS_TOKEN=$token -ARG repository -ENV GITHUB_RELEASE_REPOSITORY=$repository -ARG commit -ENV GITHUB_RELEASE_COMMIT=$commit -ARG tag -ENV GITHUB_RELEASE_TAG=$tag RUN set -ex \ + && apt install -y jq \ + && export repo="repos/commerceblock/ocean/releases" \ + && export release_url="https://api.github.com/${repo}/latest" \ + && export id=$(curl -sH "Authorization: token ${token}" ${release_url} | jq .id) \ + && export tag_name=$(curl -sH "Authorization: token ${token}" ${release_url} | jq -r .tag_name) \ + && export upload_url="https://uploads.github.com/${repo}/${id}/assets?name=ocean-${tag_name}.deb" \ && cd ocean \ && git pull \ - && export gittag=$(git describe --tags --match '[0-9].[0-9].[0-9]*') \ - && export GITHUB_RELEASE_TAG=$gittag \ - && git checkout $gittag \ + && git checkout ${tag_name} \ && ./autogen.sh \ && ./configure --enable-glibc-back-compat \ --prefix=`pwd`/depends/x86_64-pc-linux-gnu \ LDFLAGS="-static-libstdc++" \ - && make \ - && mkdir -p ocean-$gittag/usr/local/bin \ - && cp src/oceand ocean-$gittag/usr/local/bin/ \ - && cp src/ocean-cli ocean-$gittag/usr/local/bin/ \ - && cp src/ocean-tx ocean-$gittag/usr/local/bin/ \ - && mkdir -p ocean-$gittag/DEBIAN \ + && make -j$(nproc) \ + && mkdir -p ocean-${tag_name}/usr/local/bin \ + && cp src/oceand ocean-${tag_name}/usr/local/bin/ \ + && cp src/ocean-cli ocean-${tag_name}/usr/local/bin/ \ + && cp src/ocean-tx ocean-${tag_name}/usr/local/bin/ \ + && mkdir -p ocean-${tag_name}/DEBIAN \ && cp contrib/docker/dpkg-build/control \ - ocean-$gittag/DEBIAN/ \ - && sed -i "s/Version: .*/Version: $gittag/" \ - ocean-$gittag/DEBIAN/control \ - && dpkg-deb --build ocean-$gittag \ - && go run github-release/main.go "Debian package" \ - ocean-$gittag.deb + ocean-${tag_name}/DEBIAN/ \ + && sed -i "s/Version: .*/Version: ${tag_name}/" \ + ocean-${tag_name}/DEBIAN/control \ + && dpkg-deb --build ocean-${tag_name} \ + && curl -v -d @ocean-${tag_name}.deb \ + -H "Content-Type: multipart/form-data" \ + -H "Authorization: token $(echo $token)" \ + -H "Content-Type: application/octet-stream" \ + ${upload_url} diff --git a/contrib/docker/dpkg-build/control b/contrib/docker/dpkg-build/control index 303d8b8463..d87490c75f 100644 --- a/contrib/docker/dpkg-build/control +++ b/contrib/docker/dpkg-build/control @@ -4,5 +4,5 @@ Section: base Priority: optional Architecture: amd64 Depends: libc6 (>= 2.27) -Maintainer: Martin Tsvetanov +Maintainer: CommerceBlock Description: oceand ocean-cli and ocean-tx binaries