-
-
Notifications
You must be signed in to change notification settings - Fork 23
74 lines (63 loc) · 2.05 KB
/
publish.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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
name: Publish
on:
push:
tags:
- '*'
jobs:
publish:
strategy:
matrix:
platform: [chrome, edge, firefox, github]
fail-fast: false
runs-on: ubuntu-latest
environment: 'publish'
steps:
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v4
name: Install pnpm
with:
version: 9
run_install: false
- uses: actions/setup-node@v4
name: Use Node.js
with:
node-version: 18.x
cache: 'pnpm'
- run: pnpm install
- run: pnpm run build
env:
VERSION: ${{ github.ref_name }}
- name: Testing
run: pnpm run test
- name: Firefox Upload & release
run: pnpm publish:firefox
if: matrix.platform == 'firefox'
env:
WEB_EXT_API_KEY: ${{ secrets.FIREFOX_WEB_EXT_API_KEY }}
WEB_EXT_API_SECRET: ${{ secrets.FIREFOX_WEB_EXT_API_SECRET }}
- name: Chrome Upload & release
if: matrix.platform == 'chrome'
uses: mnao305/[email protected]
with:
file-path: build/chrome-${{ github.ref_name }}.zip
extension-id: 'hihgfcgbmnbomabfdbajlbpnacndeihl'
client-id: ${{ secrets.GOOGLE_CLIENT_ID }}
client-secret: ${{ secrets.GOOGLE_CLIENT_SECRET }}
refresh-token: ${{ secrets.GOOGLE_REFRESH_TOKEN }}
- name: Edge Upload & release
run: pnpm publish:edge
if: matrix.platform == 'edge'
env:
VERSION: ${{ github.ref_name }}
EDGE_CLIENT_ID: ${{ secrets.EDGE_CLIENT_ID }}
EDGE_CLIENT_SECRET: ${{ secrets.EDGE_CLIENT_SECRET }}
EDGE_ACCESS_TOKEN_URL: ${{ secrets.EDGE_ACCESS_TOKEN_URL }}
EDGE_PRODUCT_ID: ${{ secrets.EDGE_PRODUCT_ID }}
- name: Release
uses: softprops/action-gh-release@v1
if: matrix.platform == 'github'
with:
files: |
build/chrome-${{ github.ref_name }}.zip
build/edge-${{ github.ref_name }}.zip
build/firefox-${{ github.ref_name }}.zip