-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathappveyor.yml
56 lines (45 loc) · 2.05 KB
/
appveyor.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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
version: 1.0.0.{build}
image: Visual Studio 2017
max_jobs: 1
branches:
only:
- master
init:
- git config --global core.autocrlf true
- git config --global user.email "appveyor@example.com"
- git config --global user.name "AppVeyor"
clone_folder: C:\Projects\DeleteLikeButton
shallow_clone: false
matrix:
fast_finish: true
install:
- ps: (Get-Content -Path '.\manifest.json' -Encoding UTF8 -Raw -Force) -replace '1.0.0.0',"$($env:APPVEYOR_BUILD_VERSION)" | Set-Content -Path '.\manifest.json' -Encoding UTF8 -Force
- git add -A
- git commit -m "Increment version"
build_script:
- git archive -o DeleteLikeButton.zip HEAD
test: off
deploy_script:
- ps: |
$GOOGLE_API_ACCESS_TOKEN = Invoke-RestMethod -Method Post -UseBasicParsing `
-Uri 'https://accounts.google.com/o/oauth2/token' `
-Body @{ client_id = $env:GOOGLE_API_CLIENT_ID
client_secret = $env:GOOGLE_API_CLIENT_SECRET
refresh_token = $env:GOOGLE_API_CLIENT_REFRESH_TOKEN
grant_type = 'refresh_token'
redirect_uri = 'urn:ietf:wg:oauth:2.0:oob'
} -TimeoutSec 30 -MaximumRedirection 10 -ErrorAction Stop | Select-Object -ExpandProperty 'access_token'
Invoke-WebRequest -UseBasicParsing -Uri "https://www.googleapis.com/upload/chromewebstore/v1.1/items/$env:GOOGLE_APPSTORE_APPID" `
-Headers @{
'Authorization' = "Bearer $GOOGLE_API_ACCESS_TOKEN"
'x-goog-api-version' = 2
} -Method Put -InFile '.\DeleteLikeButton.zip' -ErrorAction Stop | Out-Null
Invoke-WebRequest -UseBasicParsing -Uri "https://www.googleapis.com/chromewebstore/v1.1/items/$env:GOOGLE_APPSTORE_APPID/publish" `
-Headers @{
'Authorization' = "Bearer $GOOGLE_API_ACCESS_TOKEN"
'x-goog-api-version' = 2
'Content-Length' = 0
} -Method Post -ErrorAction Stop | Out-Null
artifacts:
- path: DeleteLikeButton.zip
name: DeleteLikeButton