From 9d3410d374242a6b6dde3576160bdbd44a8ed4b7 Mon Sep 17 00:00:00 2001 From: Cory Schwartz Date: Thu, 3 Jun 2021 00:05:43 -0700 Subject: [PATCH 1/5] 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[@]}" From 65651099b6d48de43ad3b8490a981ae3be9c4af1 Mon Sep 17 00:00:00 2001 From: Cory Schwartz Date: Thu, 3 Jun 2021 00:11:36 -0700 Subject: [PATCH 2/5] remove extraneous comment --- .circleci/config.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 0f4577523..b0f8120f3 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -802,8 +802,8 @@ workflows: - master - build-debug - build-all: - # requires: - # - test-short + requires: + - test-short filters: tags: only: From 92fdbd80d937bb73a8ef65062a740e291620d185 Mon Sep 17 00:00:00 2001 From: Cory Schwartz Date: Thu, 3 Jun 2021 10:18:13 -0700 Subject: [PATCH 3/5] tmp: publish dry run --- .circleci/config.yml | 14 +++++++------- scripts/publish-release.sh | 16 ++++++++++------ 2 files changed, 17 insertions(+), 13 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index b0f8120f3..69ef892e0 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -855,13 +855,13 @@ workflows: - build-all - build-macos - build-appimage - filters: - branches: - ignore: - - /.*/ - tags: - only: - - /^v\d+\.\d+\.\d+(-rc\d+)?$/ + # filters: + # branches: + # ignore: + # - /.*/ + # tags: + # only: + # - /^v\d+\.\d+\.\d+(-rc\d+)?$/ - build-and-push-image: dockerfile: Dockerfile.lotus path: . diff --git a/scripts/publish-release.sh b/scripts/publish-release.sh index 4c152d15c..fe1c89caf 100755 --- a/scripts/publish-release.sh +++ b/scripts/publish-release.sh @@ -18,6 +18,8 @@ do command -v "${REQUIRE}" >/dev/null 2>&1 || echo >&2 "'${REQUIRE}' must be installed" done +CIRCLE_TAG=DEFINITELYDOESNOTEXIST + #see if the release already exists by tag RELEASE_RESPONSE=` curl \ @@ -47,7 +49,7 @@ if [ "${RELEASE_ID}" = "null" ]; then # create it if it doesn't exist yet RELEASE_RESPONSE=` - curl \ + echo curl \ --request POST \ --header "Authorization: token ${GITHUB_TOKEN}" \ --header "Content-Type: application/json" \ @@ -58,6 +60,8 @@ else echo "release already exists" fi +RELEASE_RESPONSE=DEFINITELYDOESNOTEXIST + RELEASE_UPLOAD_URL=`echo "${RELEASE_RESPONSE}" | jq -r '.upload_url' | cut -d'{' -f1` echo "Preparing to send artifacts to ${RELEASE_UPLOAD_URL}" @@ -68,15 +72,15 @@ 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" + "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[@]}" do echo "Uploading ${RELEASE_FILE}..." - curl \ + echo curl \ --request POST \ --header "Authorization: token ${GITHUB_TOKEN}" \ --header "Content-Type: application/octet-stream" \ @@ -96,7 +100,7 @@ miscellaneous=( for MISC in "${miscellaneous[@]}" do echo "Uploading release bundle: ${MISC}" - curl \ + echo curl \ --request POST \ --header "Authorization: token ${GITHUB_TOKEN}" \ --header "Content-Type: application/octet-stream" \ From eafcc14f0bd5ed0f3e86544fe99493e96c66ad75 Mon Sep 17 00:00:00 2001 From: Cory Schwartz Date: Thu, 3 Jun 2021 10:20:49 -0700 Subject: [PATCH 4/5] comment out filters --- .circleci/config.yml | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 69ef892e0..2dd564476 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -804,10 +804,10 @@ workflows: - build-all: requires: - test-short - filters: - tags: - only: - - /^v\d+\.\d+\.\d+(-rc\d+)?$/ + # filters: + # tags: + # only: + # - /^v\d+\.\d+\.\d+(-rc\d+)?$/ - build-ntwk-calibration: requires: - test-short @@ -833,23 +833,23 @@ workflows: - build-macos: requires: - test-short - filters: - branches: - ignore: - - /.*/ - tags: - only: - - /^v\d+\.\d+\.\d+(-rc\d+)?$/ + # filters: + # branches: + # ignore: + # - /.*/ + # tags: + # only: + # - /^v\d+\.\d+\.\d+(-rc\d+)?$/ - build-appimage: requires: - test-short - filters: - branches: - ignore: - - /.*/ - tags: - only: - - /^v\d+\.\d+\.\d+(-rc\d+)?$/ + # filters: + # branches: + # ignore: + # - /.*/ + # tags: + # only: + # - /^v\d+\.\d+\.\d+(-rc\d+)?$/ - publish: requires: - build-all From 8b2b488d17defbe80a134add481ba9b9140336f7 Mon Sep 17 00:00:00 2001 From: Cory Schwartz Date: Thu, 3 Jun 2021 10:44:48 -0700 Subject: [PATCH 5/5] remove temporary edits --- .circleci/config.yml | 50 +++++++++++++++++++------------------- scripts/publish-release.sh | 10 +++----- 2 files changed, 28 insertions(+), 32 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 2dd564476..b0f8120f3 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -804,10 +804,10 @@ workflows: - build-all: requires: - test-short - # filters: - # tags: - # only: - # - /^v\d+\.\d+\.\d+(-rc\d+)?$/ + filters: + tags: + only: + - /^v\d+\.\d+\.\d+(-rc\d+)?$/ - build-ntwk-calibration: requires: - test-short @@ -833,35 +833,35 @@ workflows: - build-macos: requires: - test-short - # filters: - # branches: - # ignore: - # - /.*/ - # tags: - # only: - # - /^v\d+\.\d+\.\d+(-rc\d+)?$/ + filters: + branches: + ignore: + - /.*/ + tags: + only: + - /^v\d+\.\d+\.\d+(-rc\d+)?$/ - build-appimage: requires: - test-short - # filters: - # branches: - # ignore: - # - /.*/ - # tags: - # only: - # - /^v\d+\.\d+\.\d+(-rc\d+)?$/ + filters: + branches: + ignore: + - /.*/ + tags: + only: + - /^v\d+\.\d+\.\d+(-rc\d+)?$/ - publish: requires: - build-all - build-macos - build-appimage - # filters: - # branches: - # ignore: - # - /.*/ - # tags: - # only: - # - /^v\d+\.\d+\.\d+(-rc\d+)?$/ + filters: + branches: + ignore: + - /.*/ + tags: + only: + - /^v\d+\.\d+\.\d+(-rc\d+)?$/ - build-and-push-image: dockerfile: Dockerfile.lotus path: . diff --git a/scripts/publish-release.sh b/scripts/publish-release.sh index fe1c89caf..22572de60 100755 --- a/scripts/publish-release.sh +++ b/scripts/publish-release.sh @@ -18,8 +18,6 @@ do command -v "${REQUIRE}" >/dev/null 2>&1 || echo >&2 "'${REQUIRE}' must be installed" done -CIRCLE_TAG=DEFINITELYDOESNOTEXIST - #see if the release already exists by tag RELEASE_RESPONSE=` curl \ @@ -49,7 +47,7 @@ if [ "${RELEASE_ID}" = "null" ]; then # create it if it doesn't exist yet RELEASE_RESPONSE=` - echo curl \ + curl \ --request POST \ --header "Authorization: token ${GITHUB_TOKEN}" \ --header "Content-Type: application/json" \ @@ -60,8 +58,6 @@ else echo "release already exists" fi -RELEASE_RESPONSE=DEFINITELYDOESNOTEXIST - RELEASE_UPLOAD_URL=`echo "${RELEASE_RESPONSE}" | jq -r '.upload_url' | cut -d'{' -f1` echo "Preparing to send artifacts to ${RELEASE_UPLOAD_URL}" @@ -80,7 +76,7 @@ artifacts=( for RELEASE_FILE in "${artifacts[@]}" do echo "Uploading ${RELEASE_FILE}..." - echo curl \ + curl \ --request POST \ --header "Authorization: token ${GITHUB_TOKEN}" \ --header "Content-Type: application/octet-stream" \ @@ -100,7 +96,7 @@ miscellaneous=( for MISC in "${miscellaneous[@]}" do echo "Uploading release bundle: ${MISC}" - echo curl \ + curl \ --request POST \ --header "Authorization: token ${GITHUB_TOKEN}" \ --header "Content-Type: application/octet-stream" \