-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
action.yml
125 lines (111 loc) · 4.22 KB
/
action.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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
name: "WXT Submit"
author: "ryohidaka <[email protected]>"
description: "A GitHub Action that submits new versions of an extension created with WXT for review."
branding:
color: green
icon: send
inputs:
# Common Options
dry-run:
description: "Dry Run Flag"
required: false
default: false
root-path:
description: "The root path of the wxt project. Default is the current directory."
required: false
default: "."
# Inputs for Chrome Extension
chrome:
required: false
default: false
chrome-extension-id:
description: "Chrome Extension ID"
chrome-client-id:
description: "Chrome Client ID"
chrome-client-secret:
description: "Chrome Client Secret"
chrome-refresh-token:
description: "Chrome Refresh Token"
# Inputs for Firefox Addon
firefox:
required: false
default: false
firefox-extension-id:
description: "Firefox Extension ID"
firefox-jwt-issuer:
description: "Firefox JWT Issuer"
firefox-jwt-secret:
description: "Firefox JWT Secret"
# Inputs for Edge Extension
edge:
required: false
default: false
edge-product-id:
description: "Edge Product ID"
edge-client-id:
description: "Edge Client ID"
edge-client-secret:
description: "Edge Client Secret"
edge-access-token-url:
description: "Edge Access Token URL"
runs:
using: "composite"
steps:
- uses: actions/checkout@v4
- name: Set GitHub Path
run: echo "$GITHUB_ACTION_PATH" >> $GITHUB_PATH
shell: bash
env:
GITHUB_ACTION_PATH: ${{ github.action_path }}
- name: Check if Dryrun is enabled
run: $GITHUB_ACTION_PATH/scripts/check_dry_run.sh "${{ inputs.dry-run }}"
shell: bash
- name: Check required inputs for Chrome Extension
if: ${{ inputs.chrome == 'true' }}
run: $GITHUB_ACTION_PATH/scripts/check_chrome_inputs.sh "${{ inputs.chrome-extension-id }}" "${{ inputs.chrome-client-id }}" "${{ inputs.chrome-client-secret }}" "${{ inputs.chrome-refresh-token }}"
shell: bash
- name: Check required inputs for Firefox Addon
if: ${{ inputs.firefox == 'true' }}
run: $GITHUB_ACTION_PATH/scripts/check_firefox_inputs.sh "${{ inputs.firefox-extension-id }}" "${{ inputs.firefox-jwt-issuer }}" "${{ inputs.firefox-jwt-secret }}"
shell: bash
- name: Check required inputs for Edge Extension
if: ${{ inputs.edge == 'true' }}
run: $GITHUB_ACTION_PATH/scripts/check_edge_inputs.sh "${{ inputs.edge-product-id }}" "${{ inputs.edge-client-id }}" "${{ inputs.edge-client-secret }}" "${{ inputs.edge-access-token-url }}"
shell: bash
- uses: pnpm/action-setup@v4
with:
version: "latest"
- uses: actions/setup-node@v4
with:
node-version: latest
cache: "pnpm"
cache-dependency-path: ${{ inputs.root-path }}
- name: Install dependencies
run: $GITHUB_ACTION_PATH/scripts/install_dependencies.sh "${{ inputs.root-path }}"
shell: bash
- name: Submit to Chrome
if: ${{ inputs.chrome == 'true' }}
run: $GITHUB_ACTION_PATH/scripts/submit_to_chrome.sh "${{ inputs.root-path }}" "${{ inputs.dry-run }}"
shell: bash
env:
CHROME_EXTENSION_ID: ${{ inputs.chrome-extension-id }}
CHROME_CLIENT_ID: ${{ inputs.chrome-client-id }}
CHROME_CLIENT_SECRET: ${{ inputs.chrome-client-secret }}
CHROME_REFRESH_TOKEN: ${{ inputs.chrome-refresh-token }}
- name: Submit to Firefox
if: ${{ inputs.firefox == 'true' }}
run: $GITHUB_ACTION_PATH/scripts/submit_to_firefox.sh "${{ inputs.root-path }}" "${{ inputs.dry-run }}"
shell: bash
env:
FIREFOX_EXTENSION_ID: ${{ inputs.firefox-extension-id }}
FIREFOX_JWT_ISSUER: ${{ inputs.firefox-jwt-issuer }}
FIREFOX_JWT_SECRET: ${{ inputs.firefox-jwt-secret }}
- name: Submit to Edge
if: ${{ inputs.edge == 'true' }}
run: $GITHUB_ACTION_PATH/scripts/submit_to_edge.sh "${{ inputs.root-path }}" "${{ inputs.dry-run }}"
shell: bash
env:
EDGE_PRODUCT_ID: ${{ inputs.edge-product-id }}
EDGE_CLIENT_ID: ${{ inputs.edge-client-id }}
EDGE_CLIENT_SECRET: ${{ inputs.edge-client-secret }}
EDGE_ACCESS_TOKEN_URL: ${{ inputs.edge-access-token-url }}