From eb1602f4add4309035bf6b465a83dd6953d753a4 Mon Sep 17 00:00:00 2001 From: Viktor Date: Tue, 21 Apr 2020 15:50:03 +0300 Subject: [PATCH] [BRG-549] Update gitlab ci process --- .gitlab-ci.yml | 58 +++++++++++++++++++++++++++++++++++++++----- config/manifest.json | 2 +- 2 files changed, 53 insertions(+), 7 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 4df5fd08..7dd2a720 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,20 +1,66 @@ stages: + - test - build + - publish -build.publish: +test:lint: + image: node:12 + stage: test + cache: + paths: + - node_modules + script: + - npm i + - npm run lint + only: + - merge_requests + tags: + - docker + +test:test: + image: node:12 + stage: test + cache: + paths: + - node_modules + script: + - npm i + - npm run test + only: + - merge_requests + tags: + - docker + +build: image: node:10.16 stage: build - before_script: - - apt-get update -y && apt-get -y --allow-unauthenticated install curl jq + cache: + paths: + - node_modules script: - npm i - npm run build-ext - - ACCESS_TOKEN=$(curl "https://accounts.google.com/o/oauth2/token" -d "client_id=${CHROME_CLIENT_ID}&client_secret=${CHROME_CLIENT_SECRET}&refresh_token=${CHROME_REFRESH_TOKEN}&grant_type=refresh_token&redirect_uri=urn:ietf:wg:oauth:2.0:oob" | jq -r .access_token) - - 'curl -H "Authorization: Bearer ${ACCESS_TOKEN}" -H "x-goog-api-version: 2" -X PUT -T build/zip/echo_bridge.zip -v "https://www.googleapis.com/upload/chromewebstore/v1.1/items/${CHROME_APP_ID}"' - - 'curl -H "Authorization: Bearer ${ACCESS_TOKEN}" -H "x-goog-api-version: 2" -H "Content-Length: 0" -X POST -v "https://www.googleapis.com/chromewebstore/v1.1/items/${CHROME_APP_ID}/publish?publishTarget=default"' only: - tags except: - /^.*rc.*$/ + artifacts: + paths: + - build/zip/echo_bridge.zip + tags: + - docker + +publish: + stage: publish + dependencies: + - build + script: + - ACCESS_TOKEN=$(curl "https://accounts.google.com/o/oauth2/token" -d "client_id=${CHROME_CLIENT_ID}&client_secret=${CHROME_CLIENT_SECRET}&refresh_token=${CHROME_REFRESH_TOKEN}&grant_type=refresh_token&redirect_uri=urn:ietf:wg:oauth:2.0:oob" | jq -r .access_token) + - 'curl -H "Authorization: Bearer ${ACCESS_TOKEN}" -H "x-goog-api-version: 2" -X PUT -T ./build/zip/echo_bridge.zip -v "https://www.googleapis.com/upload/chromewebstore/v1.1/items/${CHROME_APP_ID}"' + - 'curl -H "Authorization: Bearer ${ACCESS_TOKEN}" -H "x-goog-api-version: 2" -H "Content-Length: 0" -X POST -v "https://www.googleapis.com/chromewebstore/v1.1/items/${CHROME_APP_ID}/publish?publishTarget=default"' tags: - docker + only: + - tags + except: + - /^.*rc.*$/ diff --git a/config/manifest.json b/config/manifest.json index 1c22ca03..a5cf479e 100644 --- a/config/manifest.json +++ b/config/manifest.json @@ -18,7 +18,7 @@ "96": "images/96.png", "128": "images/128.png" }, - "version": "1.16.1", + "version": "1.16.2", "background": { "scripts": [ "background.js"