Skip to content

Commit 2802fb5

Browse files
committed
adding the firefox into the workflow action
1 parent c5564b3 commit 2802fb5

1 file changed

Lines changed: 61 additions & 14 deletions

File tree

.github/workflows/deploy-extension.yml

Lines changed: 61 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ on:
77
workflow_dispatch:
88

99
jobs:
10-
# Step 1: Pack Extension
11-
packExtension:
10+
# Step 1: Pack Extension for Chromium
11+
packChromium:
1212
runs-on: ubuntu-latest
1313
outputs:
1414
zip_path: ${{ steps.pack.outputs.zipFilePath }}
@@ -18,6 +18,9 @@ jobs:
1818

1919
- name: Move manifest to root
2020
run: mv platform/chromium/manifest.json .
21+
22+
- name: Rename Chromium manifest
23+
run: mv platform/firefox/manifest.json manifest.json.firefox
2124

2225
- name: Build Extension
2326
id: pack
@@ -32,10 +35,10 @@ jobs:
3235
name: extension-chromium
3336
path: build/extension-chromium.zip
3437

35-
# Step 2: Fetch Google Access Token
36-
fetchToken:
38+
# Step 1.1.1: Fetch Google Access Token
39+
fetchGToken:
3740
runs-on: ubuntu-latest
38-
needs: packExtension
41+
needs: packChromium
3942
outputs:
4043
access_token_path: google-access-token
4144
steps:
@@ -56,10 +59,10 @@ jobs:
5659
name: google-access-token
5760
path: access_token.txt
5861

59-
# Step 3: Upload Extension
60-
uploadExtension:
62+
# Step 1.1.2: Upload Extension to the Chrome Web Store
63+
uploadGoogle:
6164
runs-on: ubuntu-latest
62-
needs: [packExtension, fetchToken]
65+
needs: [packChromium, fetchGToken]
6366
steps:
6467
- name: Download token artifact
6568
uses: actions/download-artifact@v4
@@ -82,10 +85,10 @@ jobs:
8285
extensionId: 'ibnifmdhbaknbkgldmbnebeidephchno'
8386
apiAccessToken: ${{ env.ACCESS_TOKEN }}
8487

85-
# Step 4: Publish Extension
86-
publishExtension:
88+
# Step 1.1.3: Publish Extension to the Chrome Web Store
89+
publishGoogle:
8790
runs-on: ubuntu-latest
88-
needs: uploadExtension
91+
needs: uploadGoogle
8992
steps:
9093
- name: Download token artifact
9194
uses: actions/download-artifact@v4
@@ -102,10 +105,10 @@ jobs:
102105
extensionId: 'ibnifmdhbaknbkgldmbnebeidephchno'
103106
apiAccessToken: ${{ env.ACCESS_TOKEN }}
104107

105-
# Step 5: Upload to Microsoft Edge Add-ons
106-
publishEdge:
108+
# Step 1.2.1: Upload and Publish to the Microsoft Edge Add-ons
109+
uploadAndPublishEdge:
107110
runs-on: ubuntu-latest
108-
needs: packExtension
111+
needs: packChromium
109112
steps:
110113
- name: Download extension artifact
111114
uses: actions/download-artifact@v4
@@ -119,3 +122,47 @@ jobs:
119122
product-id: '676e8faf-4af5-4c0a-aa3c-6f3524472fba'
120123
api-key: ${{ secrets.EDGE_API_KEY }}
121124
client-id: ${{ secrets.EDGE_CLIENT_ID }}
125+
126+
# Step 2: Pack Extension for Firefox
127+
packFirefox:
128+
runs-on: ubuntu-latest
129+
steps:
130+
- name: Checkout code
131+
uses: actions/checkout@v4
132+
133+
- name: Move manifest to root
134+
run: mv platform/firefox/manifest.json .
135+
136+
- name: Rename Chromium manifest
137+
run: mv platform/chromium/manifest.json manifest.json.chromium
138+
139+
- name: Build Firefox Extension
140+
run: chmod +x build.sh && ./build.sh firefox
141+
142+
- name: Rename Firefox zip to standard name
143+
run: mv build/DuoExplained_*.firefox.zip build/extension-firefox.zip
144+
145+
- name: Upload Packed Extension
146+
uses: actions/upload-artifact@v4
147+
with:
148+
name: extension-firefox
149+
path: build/extension-firefox.zip
150+
151+
# Step 2.1: Upload and Publish to the Microsoft Edge Add-ons
152+
uploadAndPublishFirefox:
153+
runs-on: ubuntu-latest
154+
needs: packFirefox
155+
steps:
156+
- name: Download extension artifact
157+
uses: actions/download-artifact@v4
158+
with:
159+
name: extension-firefox
160+
161+
- name: Publish to Firefox Add-ons
162+
uses: wdzeng/firefox-addon@v1
163+
with:
164+
addon-guid: '{2acab3d4-f546-4e70-b325-4f85c9e19093}'
165+
xpi-path: extension-firefox.zip
166+
self-hosted: false
167+
jwt-issuer: ${{ secrets.FIREFOX_JWT_ISSUER }}
168+
jwt-secret: ${{ secrets.FIREFOX_JWT_SECRET }}

0 commit comments

Comments
 (0)