-
-
Notifications
You must be signed in to change notification settings - Fork 0
61 lines (48 loc) · 1.91 KB
/
upload-to-store.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
name: Update Chrome Store
on:
push:
tags:
- v*
jobs:
build-chrome-extension:
name: Build Chrome extension artifact
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Check out
uses: actions/checkout@v3
- name: Setup Bun
uses: oven-sh/setup-bun@v1
- name: Installing dependencies
run: bun install
- name: Build for production
run: bun run build
- name: Compress build folder
run: zip -r chrome-extension-${{ github.event.pull_request.head.sha }}.zip build
- name: Archive chrome-extension artifact
uses: actions/upload-artifact@v3
with:
name: chrome-extension-${{ github.sha }}
path: chrome-extension-${{ github.event.pull_request.head.sha }}.zip
upload-extension:
name: Upload extension
runs-on: ubuntu-latest
needs: build-chrome-extension
env:
EXTENSION_ID: jcoanhnlcggnjkefelkngdpongoaipdk
steps:
- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: "18"
- name: Download bundle artifact
uses: actions/download-artifact@v3
with:
name: chrome-extension-${{ github.sha }}
- name: Install webstore cli
run: npm install -g chrome-webstore-upload-cli
- name: Upload to Store
run: chrome-webstore-upload upload --source chrome-extension-${{ github.event.pull_request.head.sha }}.zip --extension-id ${{ env.EXTENSION_ID }} --client-id ${{ secrets.CI_GOOGLE_CLIENT_ID }} --client-secret ${{ secrets.CI_GOOGLE_CLIENT_SECRET }} --refresh-token ${{ secrets.CI_GOOGLE_REFRESH_TOKEN }}
- name: Publish to Store
run: chrome-webstore-upload publish --extension-id ${{ env.EXTENSION_ID }} --client-id ${{ secrets.CI_GOOGLE_CLIENT_ID }} --client-secret ${{ secrets.CI_GOOGLE_CLIENT_SECRET }} --refresh-token ${{ secrets.CI_GOOGLE_REFRESH_TOKEN }}