From ad8b6baa0327293f09d5d81abd5d8a4ec1fc1dd2 Mon Sep 17 00:00:00 2001 From: Cory Schwartz Date: Tue, 15 Jun 2021 11:58:59 -0700 Subject: [PATCH 01/10] bring appimage to v1.10.0-rc3 --- AppDir/usr/share/icons/icon.svg | 1 + AppImageBuilder.yml | 73 +++++++++++++++++++++++++++++++++ Makefile | 17 +++----- scripts/build-bundle.sh | 3 ++ scripts/publish-release.sh | 14 ++++++- 5 files changed, 95 insertions(+), 13 deletions(-) create mode 100644 AppDir/usr/share/icons/icon.svg create mode 100644 AppImageBuilder.yml diff --git a/AppDir/usr/share/icons/icon.svg b/AppDir/usr/share/icons/icon.svg new file mode 100644 index 00000000000..da992296a1a --- /dev/null +++ b/AppDir/usr/share/icons/icon.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/AppImageBuilder.yml b/AppImageBuilder.yml new file mode 100644 index 00000000000..19c74e4a26a --- /dev/null +++ b/AppImageBuilder.yml @@ -0,0 +1,73 @@ +version: 1 +AppDir: + path: ./AppDir + app_info: + id: io.filecoin.lotus + name: Lotus + icon: icon + version: latest + exec: usr/bin/lotus + exec_args: $@ + apt: + arch: amd64 + allow_unauthenticated: true + sources: + - 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 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: + - ocl-icd-libopencl1 + - libhwloc15 + exclude: [] + files: + 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.* + - usr/share/doc/*/changelog.* + - usr/share/doc/*/NEWS.* + - usr/share/doc/*/TODO.* + test: + fedora: + image: appimagecrafters/tests-env:fedora-30 + command: ./AppRun + use_host_x: true + debian: + image: appimagecrafters/tests-env:debian-stable + command: ./AppRun + use_host_x: true + arch: + image: appimagecrafters/tests-env:archlinux-latest + command: ./AppRun + use_host_x: true + centos: + image: appimagecrafters/tests-env:centos-7 + command: ./AppRun + use_host_x: true + ubuntu: + image: appimagecrafters/tests-env:ubuntu-xenial + command: ./AppRun + use_host_x: true +AppImage: + arch: x86_64 + update-information: guess + sign-key: None + diff --git a/Makefile b/Makefile index 93b6479429b..59e1a1cd45b 100644 --- a/Makefile +++ b/Makefile @@ -56,6 +56,12 @@ build/.update-modules: # end git modules +build/rice-box.go: + go run github.com/GeertJohan/go.rice/rice embed-go -i ./build + +BUILD_DEPS+=build/rice-box.go +CLEAN+=build/rice-box.go + ## MAIN BINARIES CLEAN+=build/.update-modules @@ -84,7 +90,6 @@ butterflynet: build-devnets lotus: $(BUILD_DEPS) rm -f lotus go build $(GOFLAGS) -o lotus ./cmd/lotus - go run github.com/GeertJohan/go.rice/rice append --exec lotus -i ./build .PHONY: lotus BINS+=lotus @@ -92,21 +97,18 @@ BINS+=lotus lotus-miner: $(BUILD_DEPS) rm -f lotus-miner go build $(GOFLAGS) -o lotus-miner ./cmd/lotus-storage-miner - go run github.com/GeertJohan/go.rice/rice append --exec lotus-miner -i ./build .PHONY: lotus-miner BINS+=lotus-miner lotus-worker: $(BUILD_DEPS) rm -f lotus-worker go build $(GOFLAGS) -o lotus-worker ./cmd/lotus-seal-worker - go run github.com/GeertJohan/go.rice/rice append --exec lotus-worker -i ./build .PHONY: lotus-worker BINS+=lotus-worker lotus-shed: $(BUILD_DEPS) rm -f lotus-shed go build $(GOFLAGS) -o lotus-shed ./cmd/lotus-shed - go run github.com/GeertJohan/go.rice/rice append --exec lotus-shed -i ./build .PHONY: lotus-shed BINS+=lotus-shed @@ -138,7 +140,6 @@ install-worker: lotus-seed: $(BUILD_DEPS) rm -f lotus-seed go build $(GOFLAGS) -o lotus-seed ./cmd/lotus-seed - go run github.com/GeertJohan/go.rice/rice append --exec lotus-seed -i ./build .PHONY: lotus-seed BINS+=lotus-seed @@ -172,13 +173,11 @@ lotus-townhall-front: .PHONY: lotus-townhall-front lotus-townhall-app: lotus-touch lotus-townhall-front - go run github.com/GeertJohan/go.rice/rice append --exec lotus-townhall -i ./cmd/lotus-townhall -i ./build .PHONY: lotus-townhall-app lotus-fountain: rm -f lotus-fountain go build -o lotus-fountain ./cmd/lotus-fountain - go run github.com/GeertJohan/go.rice/rice append --exec lotus-fountain -i ./cmd/lotus-fountain -i ./build .PHONY: lotus-fountain BINS+=lotus-fountain @@ -191,28 +190,24 @@ BINS+=lotus-chainwatch lotus-bench: rm -f lotus-bench go build -o lotus-bench ./cmd/lotus-bench - go run github.com/GeertJohan/go.rice/rice append --exec lotus-bench -i ./build .PHONY: lotus-bench BINS+=lotus-bench lotus-stats: rm -f lotus-stats go build $(GOFLAGS) -o lotus-stats ./cmd/lotus-stats - go run github.com/GeertJohan/go.rice/rice append --exec lotus-stats -i ./build .PHONY: lotus-stats BINS+=lotus-stats lotus-pcr: rm -f lotus-pcr go build $(GOFLAGS) -o lotus-pcr ./cmd/lotus-pcr - go run github.com/GeertJohan/go.rice/rice append --exec lotus-pcr -i ./build .PHONY: lotus-pcr BINS+=lotus-pcr lotus-health: rm -f lotus-health go build -o lotus-health ./cmd/lotus-health - go run github.com/GeertJohan/go.rice/rice append --exec lotus-health -i ./build .PHONY: lotus-health BINS+=lotus-health diff --git a/scripts/build-bundle.sh b/scripts/build-bundle.sh index 7d37edff87e..fe1c886114e 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 e77a6a9496b..22572de600d 100755 --- a/scripts/publish-release.sh +++ b/scripts/publish-release.sh @@ -29,13 +29,20 @@ RELEASE_ID=`echo "${RELEASE_RESPONSE}" | jq '.id'` if [ "${RELEASE_ID}" = "null" ]; then echo "creating release" + COND_CREATE_DISCUSSION="" + PRERELEASE=true + if [[ ${CIRCLE_TAG} =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then + COND_CREATE_DISCUSSION="\"discussion_category_name\": \"announcement\"," + PRERELEASE=false + fi + RELEASE_DATA="{ \"tag_name\": \"${CIRCLE_TAG}\", \"target_commitish\": \"${CIRCLE_SHA1}\", - \"discussion_category_name\": \"announcement\", + ${COND_CREATE_DISCUSSION} \"name\": \"${CIRCLE_TAG}\", \"body\": \"\", - \"prerelease\": false + \"prerelease\": ${PRERELEASE} }" # create it if it doesn't exist yet @@ -61,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 45b063648d4e0266785756461f41f6c2472b309b Mon Sep 17 00:00:00 2001 From: Cory Schwartz Date: Tue, 15 Jun 2021 11:59:47 -0700 Subject: [PATCH 02/10] tmp: test build in circleci --- .circleci/config.yml | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 11e8ac506cd..29b2e1478a3 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -428,6 +428,40 @@ 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: @@ -805,6 +839,7 @@ workflows: requires: - build-all - build-macos + - build-appimage filters: branches: ignore: @@ -812,6 +847,8 @@ workflows: tags: only: - /^v\d+\.\d+\.\d+(-rc\d+)?$/ + + - build-appimage - build-and-push-image: dockerfile: Dockerfile.lotus path: . From 041bf9990e5162fe11325e754233537a7c78614e Mon Sep 17 00:00:00 2001 From: Cory Schwartz Date: Tue, 15 Jun 2021 12:01:56 -0700 Subject: [PATCH 03/10] yaml syntax --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 29b2e1478a3..254e7814b62 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -428,7 +428,7 @@ jobs: - "~/.rustup" - "~/.cargo" - build-appimage: + build-appimage: machine: image: ubuntu-2004:202104-01 steps: From 9dc67abee6274fdddb2aa16a85499441132c7e3b Mon Sep 17 00:00:00 2001 From: Cory Schwartz Date: Tue, 15 Jun 2021 12:05:30 -0700 Subject: [PATCH 04/10] add make appimage --- Makefile | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Makefile b/Makefile index 59e1a1cd45b..a8857556f23 100644 --- a/Makefile +++ b/Makefile @@ -330,6 +330,15 @@ api-gen: goimports -w api/apistruct .PHONY: api-gen +appimage: lotus + rm -rf appimage-builder-cache || true + rm AppDir/io.filecoin.lotus.desktop || true + rm AppDir/icon.svg || true + rm Appdir/AppRun || true + mkdir -p AppDir/usr/bin + cp ./lotus AppDir/usr/bin/ + appimage-builder + docsgen: docsgen-md docsgen-openrpc docsgen-md-bin: actors-gen From 2b7e809efed8cacc89f57f5cada2f0f53bd33973 Mon Sep 17 00:00:00 2001 From: Cory Schwartz Date: Tue, 15 Jun 2021 12:20:19 -0700 Subject: [PATCH 05/10] filter build-appimage --- .circleci/config.yml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 254e7814b62..2df973dfb97 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -835,6 +835,16 @@ 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 @@ -848,7 +858,6 @@ workflows: only: - /^v\d+\.\d+\.\d+(-rc\d+)?$/ - - build-appimage - build-and-push-image: dockerfile: Dockerfile.lotus path: . From 87f2a4105205d6cb6ed08464df26a97020c0605d Mon Sep 17 00:00:00 2001 From: Cory Schwartz Date: Thu, 17 Jun 2021 23:46:01 -0700 Subject: [PATCH 06/10] only use embed for appimage --- Makefile | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/Makefile b/Makefile index a8857556f23..7de08dfa5ef 100644 --- a/Makefile +++ b/Makefile @@ -56,12 +56,6 @@ build/.update-modules: # end git modules -build/rice-box.go: - go run github.com/GeertJohan/go.rice/rice embed-go -i ./build - -BUILD_DEPS+=build/rice-box.go -CLEAN+=build/rice-box.go - ## MAIN BINARIES CLEAN+=build/.update-modules @@ -90,6 +84,7 @@ butterflynet: build-devnets lotus: $(BUILD_DEPS) rm -f lotus go build $(GOFLAGS) -o lotus ./cmd/lotus + go run github.com/GeertJohan/go.rice/rice append --exec lotus -i ./build .PHONY: lotus BINS+=lotus @@ -97,18 +92,21 @@ BINS+=lotus lotus-miner: $(BUILD_DEPS) rm -f lotus-miner go build $(GOFLAGS) -o lotus-miner ./cmd/lotus-storage-miner + go run github.com/GeertJohan/go.rice/rice append --exec lotus-miner -i ./build .PHONY: lotus-miner BINS+=lotus-miner lotus-worker: $(BUILD_DEPS) rm -f lotus-worker go build $(GOFLAGS) -o lotus-worker ./cmd/lotus-seal-worker + go run github.com/GeertJohan/go.rice/rice append --exec lotus-worker -i ./build .PHONY: lotus-worker BINS+=lotus-worker lotus-shed: $(BUILD_DEPS) rm -f lotus-shed go build $(GOFLAGS) -o lotus-shed ./cmd/lotus-shed + go run github.com/GeertJohan/go.rice/rice append --exec lotus-shed -i ./build .PHONY: lotus-shed BINS+=lotus-shed @@ -140,6 +138,7 @@ install-worker: lotus-seed: $(BUILD_DEPS) rm -f lotus-seed go build $(GOFLAGS) -o lotus-seed ./cmd/lotus-seed + go run github.com/GeertJohan/go.rice/rice append --exec lotus-seed -i ./build .PHONY: lotus-seed BINS+=lotus-seed @@ -173,11 +172,13 @@ lotus-townhall-front: .PHONY: lotus-townhall-front lotus-townhall-app: lotus-touch lotus-townhall-front + go run github.com/GeertJohan/go.rice/rice append --exec lotus-townhall -i ./cmd/lotus-townhall -i ./build .PHONY: lotus-townhall-app lotus-fountain: rm -f lotus-fountain go build -o lotus-fountain ./cmd/lotus-fountain + go run github.com/GeertJohan/go.rice/rice append --exec lotus-fountain -i ./cmd/lotus-fountain -i ./build .PHONY: lotus-fountain BINS+=lotus-fountain @@ -190,24 +191,28 @@ BINS+=lotus-chainwatch lotus-bench: rm -f lotus-bench go build -o lotus-bench ./cmd/lotus-bench + go run github.com/GeertJohan/go.rice/rice append --exec lotus-bench -i ./build .PHONY: lotus-bench BINS+=lotus-bench lotus-stats: rm -f lotus-stats go build $(GOFLAGS) -o lotus-stats ./cmd/lotus-stats + go run github.com/GeertJohan/go.rice/rice append --exec lotus-stats -i ./build .PHONY: lotus-stats BINS+=lotus-stats lotus-pcr: rm -f lotus-pcr go build $(GOFLAGS) -o lotus-pcr ./cmd/lotus-pcr + go run github.com/GeertJohan/go.rice/rice append --exec lotus-pcr -i ./build .PHONY: lotus-pcr BINS+=lotus-pcr lotus-health: rm -f lotus-health go build -o lotus-health ./cmd/lotus-health + go run github.com/GeertJohan/go.rice/rice append --exec lotus-health -i ./build .PHONY: lotus-health BINS+=lotus-health @@ -330,15 +335,17 @@ api-gen: goimports -w api/apistruct .PHONY: api-gen -appimage: lotus +appimage: rm -rf appimage-builder-cache || true rm AppDir/io.filecoin.lotus.desktop || true rm AppDir/icon.svg || true rm Appdir/AppRun || true mkdir -p AppDir/usr/bin + rm -rf lotus + go run github.com/GeertJohan/go.rice/rice embed-go -i ./build + go build $(GOFLAGS) -o lotus ./cmd/lotus cp ./lotus AppDir/usr/bin/ appimage-builder - docsgen: docsgen-md docsgen-openrpc docsgen-md-bin: actors-gen From 86baa119370fdd086c3cb58d5e165cd01b4b2a50 Mon Sep 17 00:00:00 2001 From: Cory Schwartz Date: Thu, 17 Jun 2021 23:47:08 -0700 Subject: [PATCH 07/10] test: build appimage in ci --- .circleci/config.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index 2df973dfb97..cf91e6cdee4 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -845,6 +845,7 @@ workflows: tags: only: - /^v\d+\.\d+\.\d+(-rc\d+)?$/ + - build-appimage - publish: requires: - build-all From 6e8cf9061a39065616ea33f84a8590ddf9b1c66c Mon Sep 17 00:00:00 2001 From: Cory Schwartz Date: Thu, 17 Jun 2021 23:48:35 -0700 Subject: [PATCH 08/10] temp name --- .circleci/config.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index cf91e6cdee4..b0e34942325 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -845,7 +845,8 @@ workflows: tags: only: - /^v\d+\.\d+\.\d+(-rc\d+)?$/ - - build-appimage + - build-appimage: + name: tmp-build-appimage - publish: requires: - build-all From 7f744b2760945923cc27ef9384c9e0bed6ddc0fe Mon Sep 17 00:00:00 2001 From: Cory Schwartz Date: Thu, 17 Jun 2021 23:52:34 -0700 Subject: [PATCH 09/10] require deps --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 7de08dfa5ef..4ae34fd5184 100644 --- a/Makefile +++ b/Makefile @@ -335,7 +335,7 @@ api-gen: goimports -w api/apistruct .PHONY: api-gen -appimage: +appimage: $(BUILD_DEPS) rm -rf appimage-builder-cache || true rm AppDir/io.filecoin.lotus.desktop || true rm AppDir/icon.svg || true From d35fcd926fe627a0e579402635411c71d02fcb38 Mon Sep 17 00:00:00 2001 From: Cory Schwartz Date: Fri, 18 Jun 2021 00:02:04 -0700 Subject: [PATCH 10/10] remove temp edits --- .circleci/config.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index b0e34942325..2df973dfb97 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -845,8 +845,6 @@ workflows: tags: only: - /^v\d+\.\d+\.\d+(-rc\d+)?$/ - - build-appimage: - name: tmp-build-appimage - publish: requires: - build-all