From 9d3410d374242a6b6dde3576160bdbd44a8ed4b7 Mon Sep 17 00:00:00 2001 From: Cory Schwartz Date: Thu, 3 Jun 2021 00:05:43 -0700 Subject: [PATCH] include appimage on release --- .circleci/config.yml | 50 ++++++++++++++++++++++++++++++++++++-- AppImageBuilder.yml | 38 +++++++++++++++++------------ scripts/build-bundle.sh | 3 +++ scripts/publish-release.sh | 3 +++ 4 files changed, 77 insertions(+), 17 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index d59939096..0f4577523 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -428,6 +428,41 @@ jobs: - "~/.rustup" - "~/.cargo" + build-appimage: + machine: + image: ubuntu-2004:202104-01 + steps: + - checkout + - attach_workspace: + at: "." + - run: + name: install appimage-builder + command: | + # docs: https://appimage-builder.readthedocs.io/en/latest/intro/install.html + sudo apt update + sudo apt install -y python3-pip python3-setuptools patchelf desktop-file-utils libgdk-pixbuf2.0-dev fakeroot strace + sudo curl -Lo /usr/local/bin/appimagetool https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage + sudo chmod +x /usr/local/bin/appimagetool + sudo pip3 install appimage-builder + - run: + name: install lotus dependencies + command: sudo apt install ocl-icd-opencl-dev libhwloc-dev + - run: + name: build appimage + command: | + sed -i "s/version: latest/version: ${CIRCLE_TAG:-latest}/" AppImageBuilder.yml + make appimage + - run: + name: prepare workspace + command: | + mkdir appimage + mv Lotus-latest-x86_64.AppImage appimage + - persist_to_workspace: + root: "." + paths: + - appimage + + gofmt: executor: golang steps: @@ -767,8 +802,8 @@ workflows: - master - build-debug - build-all: - requires: - - test-short + # requires: + # - test-short filters: tags: only: @@ -805,10 +840,21 @@ workflows: tags: only: - /^v\d+\.\d+\.\d+(-rc\d+)?$/ + - build-appimage: + requires: + - test-short + filters: + branches: + ignore: + - /.*/ + tags: + only: + - /^v\d+\.\d+\.\d+(-rc\d+)?$/ - publish: requires: - build-all - build-macos + - build-appimage filters: branches: ignore: diff --git a/AppImageBuilder.yml b/AppImageBuilder.yml index 48db68930..19c74e4a2 100644 --- a/AppImageBuilder.yml +++ b/AppImageBuilder.yml @@ -1,4 +1,3 @@ -# appimage-builder recipe see https://appimage-builder.readthedocs.io for details version: 1 AppDir: path: ./AppDir @@ -6,31 +5,40 @@ AppDir: id: io.filecoin.lotus name: Lotus icon: icon - version: current + version: latest exec: usr/bin/lotus exec_args: $@ apt: arch: amd64 allow_unauthenticated: true sources: - - sourceline: deb http://us.archive.ubuntu.com/ubuntu bionic main restricted - - sourceline: deb http://us.archive.ubuntu.com/ubuntu bionic-updates main restricted - - sourceline: deb http://us.archive.ubuntu.com/ubuntu bionic universe - - sourceline: deb http://us.archive.ubuntu.com/ubuntu bionic-updates universe - - sourceline: deb http://us.archive.ubuntu.com/ubuntu bionic multiverse - - sourceline: deb http://us.archive.ubuntu.com/ubuntu bionic-updates multiverse - - sourceline: deb http://us.archive.ubuntu.com/ubuntu bionic-backports main restricted + - sourceline: deb http://archive.ubuntu.com/ubuntu/ focal main restricted + - sourceline: deb http://archive.ubuntu.com/ubuntu/ focal-updates main restricted + - sourceline: deb http://archive.ubuntu.com/ubuntu/ focal universe + - sourceline: deb http://archive.ubuntu.com/ubuntu/ focal-updates universe + - sourceline: deb http://archive.ubuntu.com/ubuntu/ focal multiverse + - sourceline: deb http://archive.ubuntu.com/ubuntu/ focal-updates multiverse + - sourceline: deb http://archive.ubuntu.com/ubuntu/ focal-backports main restricted universe multiverse - - sourceline: deb http://security.ubuntu.com/ubuntu bionic-security main restricted - - sourceline: deb http://security.ubuntu.com/ubuntu bionic-security universe - - sourceline: deb http://security.ubuntu.com/ubuntu bionic-security multiverse + - sourceline: deb http://security.ubuntu.com/ubuntu focal-security main restricted + - sourceline: deb http://security.ubuntu.com/ubuntu focal-security universe + - sourceline: deb http://security.ubuntu.com/ubuntu focal-security multiverse + - sourceline: deb https://cli-assets.heroku.com/apt ./ + - sourceline: deb http://ppa.launchpad.net/openjdk-r/ppa/ubuntu focal main + - sourceline: deb http://ppa.launchpad.net/git-core/ppa/ubuntu focal main + - sourceline: deb http://archive.canonical.com/ubuntu focal partner include: - - libgcc1 - - libhwloc5 - ocl-icd-libopencl1 + - libhwloc15 exclude: [] files: - include: [] + include: + - /usr/lib/x86_64-linux-gnu/libgcc_s.so.1 + - /usr/lib/x86_64-linux-gnu/libpthread-2.31.so + - /usr/lib/x86_64-linux-gnu/libm-2.31.so + - /usr/lib/x86_64-linux-gnu/libdl-2.31.so + - /usr/lib/x86_64-linux-gnu/libc-2.31.so + - /usr/lib/x86_64-linux-gnu/libudev.so.1.6.17 exclude: - usr/share/man - usr/share/doc/*/README.* diff --git a/scripts/build-bundle.sh b/scripts/build-bundle.sh index 7d37edff8..fe1c88611 100755 --- a/scripts/build-bundle.sh +++ b/scripts/build-bundle.sh @@ -49,4 +49,7 @@ do ipfs add -q "lotus_${CIRCLE_TAG}_${ARCH}-amd64.tar.gz" > "lotus_${CIRCLE_TAG}_${ARCH}-amd64.tar.gz.cid" done +cp "../appimage/Lotus-${CIRCLE_TAG}-x86_64.AppImage" . +sha512sum "Lotus-${CIRCLE_TAG}-x86_64.AppImage" > "Lotus-${CIRCLE_TAG}-x86_64.AppImage.sha512" +ipfs add -q "Lotus-${CIRCLE_TAG}-x86_64.AppImage" > "Lotus-${CIRCLE_TAG}-x86_64.AppImage.cid" popd diff --git a/scripts/publish-release.sh b/scripts/publish-release.sh index ad2a52dcf..4c152d15c 100755 --- a/scripts/publish-release.sh +++ b/scripts/publish-release.sh @@ -68,6 +68,9 @@ artifacts=( "lotus_${CIRCLE_TAG}_darwin-amd64.tar.gz" "lotus_${CIRCLE_TAG}_darwin-amd64.tar.gz.cid" "lotus_${CIRCLE_TAG}_darwin-amd64.tar.gz.sha512" + "Lotus-${CIRCLE_TAG}-x86_64.AppImage" + "Lotus-${CIRCLE_TAG}-x86_64.AppImage.cid" + "Lotus-${CIRCLE_TAG}-x86_64.AppImage.sha512" ) for RELEASE_FILE in "${artifacts[@]}"