-
Notifications
You must be signed in to change notification settings - Fork 71
70 lines (61 loc) · 1.84 KB
/
Copy path_build-ext.yml
File metadata and controls
70 lines (61 loc) · 1.84 KB
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
67
68
69
70
name: Build and publish Chrome extension
on:
workflow_call:
inputs:
environment:
required: true
type: string # stg, prd
ref:
required: true
type: string # staging, main
extension_id:
required: true
type: string
jobs:
build-chrome-extension:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ inputs.ref }}
fetch-depth: 0
- name: Setup node
uses: actions/setup-node@v4
with:
node-version: lts/*
- name: Build
run: |
export GRAFANA_API_KEY=${{ secrets.GRAFANA_API_KEY }}
cd webapp/_webapp
npm install
npm run build:${{ inputs.environment }}:chrome
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: paperdebugger-chrome-extension-${{ inputs.environment }}
path: webapp/_webapp/dist
push-to-chrome-web-store:
runs-on: ubuntu-latest
needs: build-chrome-extension
steps:
- name: Install zip
run: |
sudo apt-get update && sudo apt-get install -y zip
- name: Download artifacts
uses: actions/download-artifact@v4
with:
name: paperdebugger-chrome-extension-${{ inputs.environment }}
path: dist
- name: Zip extension files
run: |
zip -r dist.zip dist/*
- name: Upload to Chrome Web Store (upload only)
uses: mobilefirstllc/cws-publish@latest
with:
action: 'upload'
client_id: ${{ secrets.CHROME_EXT_CLIENT_ID }}
client_secret: ${{ secrets.CHROME_EXT_CLIENT_SECRET }}
refresh_token: ${{ secrets.CHROME_EXT_REFRESH_TOKEN }}
extension_id: ${{ inputs.extension_id }}
zip_file: 'dist.zip'