Skip to content

Commit d5a9983

Browse files
committed
chore: fix action
1 parent 4355be3 commit d5a9983

File tree

1 file changed

+75
-61
lines changed

1 file changed

+75
-61
lines changed

.github/workflows/publish-all.yml

Lines changed: 75 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -1,91 +1,105 @@
1-
name: Publish to all stores
1+
name: Publish Extension to All Stores
2+
23
on: [workflow_dispatch]
34

45
jobs:
5-
setup:
6-
name: Setup and build
6+
build:
77
runs-on: ubuntu-latest
8-
outputs:
9-
target-zip: ${{ steps.build.outputs.target-zip }}
10-
firefox-zip: ${{ steps.build.outputs.firefox-zip }}
11-
source-zip: ${{ steps.build.outputs.source-zip }}
128
steps:
13-
- uses: actions/checkout@v4
9+
- name: Checkout repository
10+
uses: actions/checkout@v4
1411
with:
15-
fetch-depth: 0
12+
fetch-depth: 0
1613

17-
- name: Setup NodeJS
14+
- name: Setup Node.js
1815
uses: actions/setup-node@v4
1916
with:
2017
node-version: "v20.11.0"
2118

2219
- name: Install dependencies
2320
run: npm install
2421

25-
- name: Build for all platforms
26-
id: build
27-
run: |
28-
npm run build
29-
npm run build:firefox
30-
echo "target-zip=market_packages/target.zip" >> $GITHUB_OUTPUT
31-
echo "firefox-zip=market_packages/target.firefox.zip" >> $GITHUB_OUTPUT
32-
echo "source-zip=market_packages/target.src.zip" >> $GITHUB_OUTPUT
22+
- name: Build for Chrome and Edge
23+
run: npm run build
24+
25+
- name: Build for Firefox
26+
run: npm run build:firefox
27+
28+
- name: Upload Chrome/Edge Artifact
29+
uses: actions/upload-artifact@v4
30+
with:
31+
name: chrome-edge-package
32+
path: market_packages/target.zip
33+
34+
- name: Upload Firefox XPI Artifact
35+
uses: actions/upload-artifact@v4
36+
with:
37+
name: firefox-xpi-package
38+
path: market_packages/target.firefox.zip
39+
40+
- name: Upload Firefox Source Artifact
41+
uses: actions/upload-artifact@v4
42+
with:
43+
name: firefox-source-package
44+
path: market_packages/target.src.zip
3345

3446
publish-chrome:
35-
name: Publish to Chrome Web Store
36-
needs: setup
47+
needs: build
3748
runs-on: ubuntu-latest
3849
steps:
39-
- uses: actions/download-artifact@v4
50+
- name: Download Chrome/Edge Artifact
51+
uses: actions/download-artifact@v4
4052
with:
41-
name: build-artifacts
42-
path: market_packages
53+
name: chrome-edge-package
4354

44-
- name: Publish to Chrome Web Store
55+
- name: Upload to Chrome Web Store
4556
uses: mnao305/chrome-extension-upload@v5.0.0
4657
with:
47-
file-path: ${{ needs.setup.outputs.target-zip }}
48-
extension-id: dkdhhcbjijekmneelocdllcldcpmekmm
49-
client-id: ${{ secrets.CHROME_CLIENT_ID }}
50-
client-secret: ${{ secrets.CHROME_CLIENT_SECRET }}
51-
refresh-token: ${{ secrets.CHROME_REFRESH_TOKEN }}
52-
publish: true
58+
file-path: target.zip
59+
extension-id: dkdhhcbjijekmneelocdllcldcpmekmm
60+
client-id: ${{ secrets.CHROME_CLIENT_ID }}
61+
client-secret: ${{ secrets.CHROME_CLIENT_SECRET }}
62+
refresh-token: ${{ secrets.CHROME_REFRESH_TOKEN }}
63+
publish: true
5364

5465
publish-edge:
55-
name: Publish to Edge Addons
56-
needs: setup
66+
needs: build
5767
runs-on: ubuntu-latest
5868
steps:
59-
- uses: actions/download-artifact@v4
60-
with:
61-
name: build-artifacts
62-
path: market_packages
63-
64-
- name: Publish to Edge Addons
65-
uses: wdzeng/edge-addon@v2
66-
with:
67-
zip-path: ${{ needs.setup.outputs.target-zip }}
68-
product-id: 2a99ae83-5ec8-4ad2-aa63-9a276fc708ce
69-
client-id: ${{ secrets.EDGE_CLIENT_ID }}
70-
api-key: ${{ secrets.EDGE_API_KEY }}
71-
upload-only: false
69+
- name: Download Chrome/Edge Artifact
70+
uses: actions/download-artifact@v4
71+
with:
72+
name: chrome-edge-package
73+
74+
- name: Upload to Edge Add-on Store
75+
uses: wdzeng/edge-addon@v2
76+
with:
77+
zip-path: target.zip
78+
product-id: 2a99ae83-5ec8-4ad2-aa63-9a276fc708ce
79+
client-id: ${{ secrets.EDGE_CLIENT_ID }}
80+
api-key: ${{ secrets.EDGE_API_KEY }}
81+
upload-only: false
7282

7383
publish-firefox:
74-
name: Publish to Firefox Addons
75-
needs: setup
84+
needs: build
7685
runs-on: ubuntu-latest
7786
steps:
78-
- uses: actions/download-artifact@v4
79-
with:
80-
name: build-artifacts
81-
path: market_packages
82-
83-
- name: Publish to Firefox Addons
84-
uses: wdzeng/firefox-addon@v1.2.0-alpha.0
85-
with:
86-
addon-guid: "{a8cf72f7-09b7-4cd4-9aaa-7a023bf09916}"
87-
xpi-path: ${{ needs.setup.outputs.firefox-zip }}
88-
source-file-path: ${{ needs.setup.outputs.source-zip }}
89-
compatibility: firefox, android
90-
jwt-issuer: ${{ secrets.FIREFOX_JWD_ISSUER }}
91-
jwt-secret: ${{ secrets.FIREFOX_JWD_SECRET }}
87+
- name: Download Firefox XPI Artifact
88+
uses: actions/download-artifact@v4
89+
with:
90+
name: firefox-xpi-package
91+
92+
- name: Download Firefox Source Artifact
93+
uses: actions/download-artifact@v4
94+
with:
95+
name: firefox-source-package
96+
97+
- name: Upload to Firefox Add-on Store
98+
uses: wdzeng/firefox-addon@v1.2.0-alpha.0
99+
with:
100+
addon-guid: "{a8cf72f7-09b7-4cd4-9aaa-7a023bf09916}"
101+
xpi-path: target.firefox.zip
102+
source-file-path: target.src.zip
103+
compatibility: firefox, android
104+
jwt-issuer: ${{ secrets.FIREFOX_JWD_ISSUER }}
105+
jwt-secret: ${{ secrets.FIREFOX_JWD_SECRET }}

0 commit comments

Comments
 (0)