Skip to content

Commit e942b6a

Browse files
Update pack workflow. (#841)
* Release on Microsoft Edge Add-ons. * Release on Chrome Web Store with a different action. * Release on Firefox Browser Add-ons with a different action. * Combine upload and publish for Chrome and Edge. * Input to disable Github release.
1 parent 4ded638 commit e942b6a

File tree

1 file changed

+32
-29
lines changed

1 file changed

+32
-29
lines changed

.github/workflows/pack.yml

+32-29
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,21 @@ name: Pack new version
22
on:
33
workflow_dispatch:
44
inputs:
5-
upload_cws:
5+
release_github:
66
type: boolean
7-
description: Upload to CWS
7+
description: Release on Github
88
default: true
99
publish_cws:
1010
type: boolean
11-
description: Publish to CWS
11+
description: Publish to Chrome Web Store
1212
default: true
1313
publish_amo:
1414
type: boolean
15-
description: Publish to AMO
15+
description: Publish to Firefox Browser Add-ons
16+
default: true
17+
publish_mea:
18+
type: boolean
19+
description: Publish to Microsoft Edge Add-ons
1620
default: true
1721
pre_release:
1822
type: boolean
@@ -118,6 +122,7 @@ jobs:
118122
119123
- name: Github Release
120124
uses: ncipollo/release-action@v1
125+
if: ${{ inputs.release_github }}
121126
with:
122127
artifacts: "versions/torntools_${{ env.version }}_chrome.zip,versions/torntools_${{ env.version }}_firefox.zip,${{ steps.web-ext-build.outputs.target }}"
123128
name: "Release: v${{ env.version }}"
@@ -126,35 +131,33 @@ jobs:
126131
token: ${{ secrets.GH_TOKEN }}
127132
prerelease: ${{ inputs.pre_release }}
128133

129-
- name: Upload an extension to Chrome Web Store
130-
uses: cardinalby/[email protected]
131-
if: ${{ inputs.upload_cws }}
132-
with:
133-
zipFilePath: versions/torntools_${{ env.version }}_chrome.zip
134-
extensionId: 'hjpaapdjcgbmeikfnahipphknonhlhib'
135-
apiClientId: ${{ secrets.CHROME_CLIENT_ID }}
136-
apiClientSecret: ${{ secrets.CHROME_SECRET }}
137-
apiRefreshToken: ${{ secrets.CHROME_REFRESH_TOKEN }}
138-
139-
- name: Publish an extension on Chrome Web Store
140-
uses: cardinalby/[email protected]
134+
- name: Release on Chrome Web Store
135+
uses: wdzeng/chrome-extension@v1
141136
if: ${{ inputs.publish_cws }}
142-
id: publish_step
143137
with:
144-
extensionId: 'hjpaapdjcgbmeikfnahipphknonhlhib'
145-
apiClientId: ${{ secrets.CHROME_CLIENT_ID }}
146-
apiClientSecret: ${{ secrets.CHROME_SECRET }}
147-
apiRefreshToken: ${{ secrets.CHROME_REFRESH_TOKEN }}
148-
149-
- name: Release Firefox addon
150-
uses: browser-actions/[email protected]
138+
extension-id: "hjpaapdjcgbmeikfnahipphknonhlhib"
139+
zip-path: versions/torntools_${{ env.version }}_chrome.zip
140+
client-id: ${{ secrets.CHROME_CLIENT_ID }}
141+
client-secret: ${{ secrets.CHROME_SECRET }}
142+
refresh-token: ${{ secrets.CHROME_REFRESH_TOKEN }}
143+
144+
- name: Release on Firefox Browser Add-ons
145+
uses: wdzeng/firefox-addon@v1
151146
if: ${{ inputs.publish_amo }}
152147
with:
153-
addon-id: "{3754707b-1aa4-4c6f-96e7-5b1cdc1de5f9}"
154-
addon-path: versions/torntools_${{ env.version }}_firefox.zip
155-
auth-api-issuer: ${{ secrets.FIREFOX_JWT_ISSUER }}
156-
auth-api-secret: ${{ secrets.FIREFOX_JWT_SECRET }}
157-
release-note: ${{ env.version }}
148+
addon-guid: "{3754707b-1aa4-4c6f-96e7-5b1cdc1de5f9}"
149+
jwt-issuer: ${{ secrets.FIREFOX_JWT_ISSUER }}
150+
jwt-secret: ${{ secrets.FIREFOX_JWT_SECRET }}
151+
xpi-path: versions/torntools_${{ env.version }}_firefox.zip
152+
153+
- name: Release on Microsoft Edge Add-ons
154+
uses: wdzeng/edge-addon@v2
155+
if: ${{ inputs.publish_mea }}
156+
with:
157+
product-id: ${{ secrets.EDGE_PRODUCT_ID }}
158+
client-id: ${{ secrets.EDGE_CLIENT_ID }}
159+
api-key: ${{ secrets.EDGE_API_KEY }}
160+
zip-path: versions/torntools_${{ env.version }}_chrome.zip
158161

159162
- name: Delete temporary files
160163
run: |

0 commit comments

Comments
 (0)