-
Notifications
You must be signed in to change notification settings - Fork 21
/
Copy pathconfig.yml
37 lines (37 loc) · 1.47 KB
/
config.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
version: 2
jobs:
build:
branches:
only: master
docker:
- image: circleci/node
environment:
- APP_ID: oaaeanlgefipegfcbgpgnhhnpengdjld
steps:
- checkout
- run:
name: "Install Dependencies"
command: |
sudo apt-get update
sudo apt-get -y install curl jq
yarn
- run:
name: "Run TypeScript Compile"
command: yarn run tsc
- run:
name: "Run TSLint"
command: yarn run lint
- run:
name: "Build"
command: yarn run build
- run:
name: "Zip the built extension"
command: git archive -o build.zip HEAD
- run:
name: "Upload & Publish Extension to the Google Chrome Store"
command: |
if [ "${CIRCLE_BRANCH}" == "master" ]; then
ACCESS_TOKEN=$(curl "https://accounts.google.com/o/oauth2/token" -d "client_id=${CLIENT_ID}&client_secret=${CLIENT_SECRET}&refresh_token=${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 -v "https://www.googleapis.com/upload/chromewebstore/v1.1/items/${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/${APP_ID}/publish"
fi