-
-
Notifications
You must be signed in to change notification settings - Fork 2
66 lines (59 loc) · 2.07 KB
/
release.yaml
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
57
58
59
60
61
62
63
64
65
66
name: Release
permissions:
contents: write
on:
release:
types:
- published
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
- name: Build
env:
VERSION: ${{ github.event.release.tag_name }}
run: make
- name: Upload to GitHub release assets
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
UPLOAD_URL: ${{ github.event.release.upload_url }}
VERSION: ${{ github.event.release.tag_name }}
run: |
set +e
for variant in firefox chrome; do
name="mergify-${variant}-${VERSION}.zip"
curl -L \
--fail \
-X POST \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer $GITHUB_TOKEN" \
-H "Content-Type: application/octet-stream" \
--data-binary "@${name}" \
"${UPLOAD_URL%%/assets*}/assets?name=${name}"
if [ $? = 22 ]; then
echo "Upload of $name failed"
exit 22
fi
done
set -e
- name: Upload to Google Web Store
env:
VERSION: ${{ github.event.release.tag_name }}
GOOGLE_CHROME_WEBSTORE_APP_ID: ${{ secrets.GOOGLE_CHROME_WEBSTORE_APP_ID }}
GOOGLE_CHROME_WEBSTORE_TOKEN: ${{ secrets.GOOGLE_CHROME_WEBSTORE_TOKEN }}
run: |
name="mergify-chrome-${VERSION}.zip"
curl \
-v \
-H "Authorization: Bearer ${GOOGLE_CHROME_WEBSTORE_TOKEN}" \
-H "x-goog-api-version: 2" \
-X PUT \
-T "$name" \
"https://www.googleapis.com/upload/chromewebstore/v1.1/items/${GOOGLE_CHROME_WEBSTORE_APP_ID}"
curl -v \
-H "Authorization: Bearer $GOOGLE_CHROME_WEBSTORE_TOKEN" \
-H "x-goog-api-version: 2" \
-H "Content-Length: 0" \
-X POST \
"https://www.googleapis.com/chromewebstore/v1.1/items/${GOOGLE_CHROME_WEBSTORE_APP_ID}/publish"