From 6d4ec8d3a657c9ad5cf384c9c9611e19a9ec1f29 Mon Sep 17 00:00:00 2001 From: George Lima Date: Thu, 31 Jan 2019 12:51:59 -0300 Subject: [PATCH 1/8] ci(config): add build_linux job --- .circleci/config.yml | 27 ++++++++++++++++++++++++--- package.json | 1 + 2 files changed, 25 insertions(+), 3 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 6baf59f..822b4f7 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -12,8 +12,7 @@ jobs: - run: apt-get -y update - run: apt-get -y install libusb-1.0-0-dev graphicsmagick libudev-dev - run: apt-get -y install tmux xvfb libxtst6 libxss1 libgtk2.0-0 libnss3 libasound2 libgconf-2-4 ffmpeg frei0r-plugins - # TODO: Just a quick try - - run: rm yarn.lock + - run: yarn config delete proxy - run: yarn install - run: name: Run Webpack @@ -38,8 +37,30 @@ jobs: - store_artifacts: path: /tmp/e2e-record.mp4 destination: e2e-record.mp4 + - save_cache: + key: zec-dependencies-cache-{{ checksum "yarn.lock" }} + paths: + - /usr/local/share/.cache/yarn/v2 + - ./node_modules + build_linux: + docker: + - image: electronuserland/builder:wine-chrome + steps: + - checkout + - restore_cache: + key: zec-dependencies-cache-{{ checksum "yarn.lock" }} + - run: apt-get -y update + - run: apt-get -y install libusb-1.0-0-dev icnsutils graphicsmagick libudev-dev + - run: yarn config delete proxy + - run: yarn electron:dist -l + - store_artifacts: + path: ./dist/zec-react-wallet_0.3.0_amd64.deb + destination: zec-react-wallet_0.3.0_amd64.deb workflows: version: 2 - test: + build_test: jobs: - test + - build_linux: + requires: + - test diff --git a/package.json b/package.json index a90254a..b25661d 100644 --- a/package.json +++ b/package.json @@ -4,6 +4,7 @@ "description": "Zcash Reference Wallet", "main": "config/main.js", "license": "MIT", + "homepage": "https://zfnd.org/", "scripts": { "start": "concurrently \"cross-env BROWSER=none yarn dev\" \"wait-on http://0.0.0.0:8080 && yarn electron:dev\"", "dev": "webpack-dev-server --config config/webpack-dev.config.js --mode development --open --hot", From c541ec7105e6ad473be6eb86c115a5fcac660ad6 Mon Sep 17 00:00:00 2001 From: George Lima Date: Fri, 15 Feb 2019 14:22:55 -0300 Subject: [PATCH 2/8] ci(config): split install_deps method --- .circleci/config.yml | 34 ++++++++++++++++++++++------------ 1 file changed, 22 insertions(+), 12 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 822b4f7..49a2fe1 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,19 +1,32 @@ version: 2 jobs: + install_deps: + docker: + - image: circleci/node + steps: + - checkout + - run: yarn config delete proxy + - run: yarn install + - save_cache: + key: zec-dependencies-cache-{{ checksum "yarn.lock" }} + paths: + - /usr/local/share/.cache/yarn/v2 + - ./node_modules + test: docker: - image: electronuserland/builder:wine-chrome steps: - checkout + - restore_cache: + key: zec-dependencies-cache-{{ checksum "yarn.lock" }} - run: apt-get -y update - run: apt install -y software-properties-common - run: add-apt-repository ppa:jonathonf/ffmpeg-4 - run: apt-get -y update - run: apt-get -y install libusb-1.0-0-dev graphicsmagick libudev-dev - run: apt-get -y install tmux xvfb libxtst6 libxss1 libgtk2.0-0 libnss3 libasound2 libgconf-2-4 ffmpeg frei0r-plugins - - run: yarn config delete proxy - - run: yarn install - run: name: Run Webpack command: yarn dev @@ -37,11 +50,7 @@ jobs: - store_artifacts: path: /tmp/e2e-record.mp4 destination: e2e-record.mp4 - - save_cache: - key: zec-dependencies-cache-{{ checksum "yarn.lock" }} - paths: - - /usr/local/share/.cache/yarn/v2 - - ./node_modules + build_linux: docker: - image: electronuserland/builder:wine-chrome @@ -49,18 +58,19 @@ jobs: - checkout - restore_cache: key: zec-dependencies-cache-{{ checksum "yarn.lock" }} - - run: apt-get -y update - - run: apt-get -y install libusb-1.0-0-dev icnsutils graphicsmagick libudev-dev - - run: yarn config delete proxy - run: yarn electron:dist -l - store_artifacts: path: ./dist/zec-react-wallet_0.3.0_amd64.deb destination: zec-react-wallet_0.3.0_amd64.deb + workflows: version: 2 - build_test: + test_build: jobs: - - test + - install_deps + - test: + requires: + - install_deps - build_linux: requires: - test From a9c8d1dcb0bf38195ae62c43c349cb4a6911f88a Mon Sep 17 00:00:00 2001 From: George Lima Date: Fri, 15 Feb 2019 14:44:35 -0300 Subject: [PATCH 3/8] ci(config): add upload_to_slack --- .circleci/config.yml | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 49a2fe1..fedb9a2 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -62,15 +62,20 @@ jobs: - store_artifacts: path: ./dist/zec-react-wallet_0.3.0_amd64.deb destination: zec-react-wallet_0.3.0_amd64.deb + - run: + name: Upload to Slack + command: | + export GIT_COMMIT_DESC=$(git log --format=oneline -n 1 | sed -E 's/^[^ ]+ (.*)$/\1/g') + curl -F file=./dist/zec-react-wallet_0.3.0_amd64.deb -F channels=$SLACK_CHANNEL -F token=$SLACK_API_TOKEN -F title="${CIRCLE_PROJECT_REPONAME} | branch -> ${CIRCLE_BRANCH} | commit -> ${GIT_COMMIT_DESC}" https://slack.com/api/files.upload workflows: version: 2 test_build: jobs: - install_deps - - test: - requires: - - install_deps + # - test: + # requires: + # - install_deps - build_linux: requires: - - test + - install_deps From d5bdfa71c8dd6f0a475633b69ca0530c1a1d7322 Mon Sep 17 00:00:00 2001 From: George Lima Date: Fri, 15 Feb 2019 14:54:17 -0300 Subject: [PATCH 4/8] ci(config): fix upload slack file --- .circleci/config.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index fedb9a2..0abe063 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -66,7 +66,7 @@ jobs: name: Upload to Slack command: | export GIT_COMMIT_DESC=$(git log --format=oneline -n 1 | sed -E 's/^[^ ]+ (.*)$/\1/g') - curl -F file=./dist/zec-react-wallet_0.3.0_amd64.deb -F channels=$SLACK_CHANNEL -F token=$SLACK_API_TOKEN -F title="${CIRCLE_PROJECT_REPONAME} | branch -> ${CIRCLE_BRANCH} | commit -> ${GIT_COMMIT_DESC}" https://slack.com/api/files.upload + curl -F file=@dist/zec-react-wallet_0.3.0_amd64.deb -F channels=$SLACK_CHANNEL -F token=$SLACK_API_TOKEN -F title="${CIRCLE_PROJECT_REPONAME} | branch -> ${CIRCLE_BRANCH} | commit -> ${GIT_COMMIT_DESC}" https://slack.com/api/files.upload workflows: version: 2 From f93ff3306abfa737e8d57a643af26f9433278656 Mon Sep 17 00:00:00 2001 From: George Lima Date: Fri, 15 Feb 2019 16:10:02 -0300 Subject: [PATCH 5/8] ci(config): remove comment --- .circleci/config.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 0abe063..df7956a 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -73,9 +73,9 @@ workflows: test_build: jobs: - install_deps - # - test: - # requires: - # - install_deps - - build_linux: + - test: requires: - install_deps + - build_linux: + requires: + - test From 4dbe5cf55b35615f8d30e37a708dd6cbce011c82 Mon Sep 17 00:00:00 2001 From: George Lima Date: Wed, 20 Feb 2019 12:30:51 -0300 Subject: [PATCH 6/8] ci(config): add filters in build_linux workflow --- .circleci/config.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.circleci/config.yml b/.circleci/config.yml index df7956a..b28429c 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -79,3 +79,7 @@ workflows: - build_linux: requires: - test + filters: + branches: + only: + - master From ec38bfd3fa66731362dbc8a98abd9b1477af8c45 Mon Sep 17 00:00:00 2001 From: George Lima Date: Wed, 20 Feb 2019 12:34:52 -0300 Subject: [PATCH 7/8] ci(config): remove yarn proxy step --- .circleci/config.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index b28429c..d630c77 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -6,7 +6,6 @@ jobs: - image: circleci/node steps: - checkout - - run: yarn config delete proxy - run: yarn install - save_cache: key: zec-dependencies-cache-{{ checksum "yarn.lock" }} From 0fdc9eaa75e35bf2e4bc6496b19e6a1cd6856849 Mon Sep 17 00:00:00 2001 From: George Lima Date: Wed, 20 Feb 2019 12:46:58 -0300 Subject: [PATCH 8/8] ci(config): remove install_deps job --- .circleci/config.yml | 27 ++++++++------------------- 1 file changed, 8 insertions(+), 19 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index d630c77..7a04354 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,31 +1,18 @@ version: 2 jobs: - install_deps: - docker: - - image: circleci/node - steps: - - checkout - - run: yarn install - - save_cache: - key: zec-dependencies-cache-{{ checksum "yarn.lock" }} - paths: - - /usr/local/share/.cache/yarn/v2 - - ./node_modules - test: docker: - image: electronuserland/builder:wine-chrome steps: - checkout - - restore_cache: - key: zec-dependencies-cache-{{ checksum "yarn.lock" }} - run: apt-get -y update - run: apt install -y software-properties-common - run: add-apt-repository ppa:jonathonf/ffmpeg-4 - run: apt-get -y update - run: apt-get -y install libusb-1.0-0-dev graphicsmagick libudev-dev - run: apt-get -y install tmux xvfb libxtst6 libxss1 libgtk2.0-0 libnss3 libasound2 libgconf-2-4 ffmpeg frei0r-plugins + - run: yarn install - run: name: Run Webpack command: yarn dev @@ -46,6 +33,11 @@ jobs: kill -s SIGINT $(pgrep ffmpeg) sleep 10 kill -s SIGTERM $(pgrep Xvfb) + - save_cache: + key: zec-dependencies-cache-{{ checksum "yarn.lock" }} + paths: + - /usr/local/share/.cache/yarn/v2 + - ./node_modules - store_artifacts: path: /tmp/e2e-record.mp4 destination: e2e-record.mp4 @@ -69,12 +61,9 @@ jobs: workflows: version: 2 - test_build: + build_test: jobs: - - install_deps - - test: - requires: - - install_deps + - test - build_linux: requires: - test