-
Notifications
You must be signed in to change notification settings - Fork 5
26 lines (22 loc) · 1.16 KB
/
cd.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
name: CD
on:
push:
branches: [ release/* ]
jobs:
build_publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: |
npm ci
npm run build
npm run pack
- env:
CLIENT_ID: ${{ secrets.TEST_RECORDER_CLIENT_ID }}
CLIENT_SECRET: ${{ secrets.TEST_RECORDER_CLIENT_SECRET }}
REFRESH_TOKEN: ${{ secrets.TEST_RECORDER_REFRESH_TOKEN }}
EXTENSION_ID: ${{ secrets.TEST_RECORDER_EXTENSION_ID }}
run: |
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 ./projects/extension/extension.zip -v "https://www.googleapis.com/upload/chromewebstore/v1.1/items/${EXTENSION_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/${EXTENSION_ID}/publish"