Skip to content

Commit 914b11b

Browse files
committed
Rewrite publish workflow
1 parent 31e03e3 commit 914b11b

File tree

3 files changed

+94
-15
lines changed

3 files changed

+94
-15
lines changed

.github/workflows/main.yml

+36-14
Original file line numberDiff line numberDiff line change
@@ -15,16 +15,30 @@ jobs:
1515

1616
- name: Cleanup
1717
run: |
18-
rm output -rf
18+
rm -rf output
1919
20-
- name: Zip the extension
20+
- name: Prepare output directory
2121
run: |
22-
mkdir output
23-
VERSION=$(jq -r '.version' ./app/manifest.json)
24-
zip -r ./output/ShaderToy-Chrome-Plugin-$VERSION.zip ./app
22+
mkdir -p output
23+
24+
- name: Zip the Chrome extension
25+
run: |
26+
VERSION=$(jq -r '.version' ./app/manifest-chrome.json)
27+
cp ./app/* ./output/
28+
cp ./manifest/manifest-chrome.json ./output/manifest.json
29+
zip -r ./output/ShaderToy-Chrome-Plugin-$VERSION.zip ./output
2530
echo $VERSION >> ./output/version.txt
2631
27-
- name: Upload output as artifact
32+
- name: Zip the Firefox extension
33+
env:
34+
FIREFOX_EXTENSION_ID: ${{ secrets.FIREFOX_EXTENSION_ID }}
35+
run: |
36+
cp ./app/* ./output/
37+
cp ./manifest/manifest-firefox.json ./output/manifest.json
38+
jq --arg id "$FIREFOX_EXT_ID" '.browser_specific_settings.gecko.id = $id' ./output/manifest.json > ./output/manifest.json.tmp && mv ./output/manifest.json.tmp ./output/manifest.json
39+
zip -r ./output/ShaderToy-Firefox-Plugin-$VERSION.zip ./output
40+
41+
- name: Upload output as artifacts
2842
uses: actions/upload-artifact@v4
2943
with:
3044
name: output
@@ -41,17 +55,25 @@ jobs:
4155

4256
- name: Install Dependencies for Publishing
4357
run: |
44-
npm install -g chrome-webstore-upload-cli
58+
npm install --save-dev publish-browser-extension
4559
4660
- name: Upload & Publish Extension to Chrome Store
61+
env:
62+
CHROME_CLIENT_ID: ${{ secrets.CHROME_CLIENT_ID }}
63+
CHROME_CLIENT_SECRET: ${{ secrets.CHROME_CLIENT_SECRET }}
64+
CHROME_REFRESH_TOKEN: ${{ secrets.CHROME_REFRESH_TOKEN }}
65+
CHROME_EXTENSION_ID: ${{ secrets.CHROME_EXTENSION_ID }}
66+
CHROME_PUBLISH_TARGET: trustedTesters
67+
CHROME_SKIP_SUBMIT_REVIEW: true
68+
FIREFOX_EXTENSION_ID: ${{ secrets.FIREFOX_EXTENSION_ID }}
69+
FIREFOX_JWT_ISSUER: ${{ secrets.FIREFOX_JWT_ISSUER }}
70+
FIREFOX_JWT_SECRET: ${{ secrets.FIREFOX_JWT_SECRET }}
71+
4772
run: |
4873
VERSION=$(cat ./output/version.txt)
49-
chrome-webstore-upload upload \\
50-
--source ./output/ShaderToy-Chrome-Plugin-$VERSION.zip \\
51-
--extension-id $APP_ID \\
52-
--client-id $CLIENT_ID \\
53-
--client-secret $CLIENT_SECRET \\
54-
--refresh-token $REFRESH_TOKEN
74+
npx publish-extension \
75+
--chrome-zip ./output/ShaderToy-Chrome-Plugin-$VERSION.zip \
76+
--firefox-zip ./output/ShaderToy-Firefox-Plugin-$VERSION.zip
5577
5678
release:
5779
runs-on: self-hosted
@@ -65,4 +87,4 @@ jobs:
6587
- name: Publish Release on GitHub
6688
run: |
6789
VERSION=$(cat ./output/version.txt)
68-
gh release create $VERSION ./output/ShaderToy-Chrome-Plugin-$VERSION.zip --title "$VERSION" --notes "Release of version $VERSION"
90+
gh release create $VERSION ./output/ShaderToy-Chrome-Plugin-$VERSION.zip --title "$VERSION" --notes "Release of version $VERSION (chrome)"

app/manifest.json manifests/manifest-chrome.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"manifest_version": 3,
33
"name": "Shadertoy unofficial plugin.",
4-
"version": "0.14.271",
4+
"version": "0.14.272",
55
"description": "Shadertoy.com unofficial plugin.",
66
"homepage_url": "https://github.com/patuwwy/ShaderToy-Chrome-Plugin",
77
"background": {

manifests/manifest-firefox.json

+57
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
{
2+
"manifest_version": 3,
3+
"name": "Shadertoy unofficial plugin.",
4+
"version": "0.14.272",
5+
"description": "Shadertoy.com unofficial plugin.",
6+
"homepage_url": "https://github.com/patuwwy/ShaderToy-Chrome-Plugin",
7+
"browser_specific_settings": {
8+
"gecko": {
9+
"id": ""
10+
}
11+
},
12+
"background": {
13+
"scripts": [
14+
"background.js"
15+
]
16+
},
17+
"host_permissions": ["https://www.shadertoy.com/*"],
18+
"icons": {
19+
"128": "assets/icon_active_128.png"
20+
},
21+
"action": {
22+
"default_title": "ShaderToy plugin",
23+
"default_icon": "assets/icon_active_128.png",
24+
"default_popup": "popup.html"
25+
},
26+
"content_scripts": [
27+
{
28+
"matches": ["https://www.shadertoy.com/*"],
29+
"exclude_matches": ["https://www.shadertoy.com/signin"],
30+
"js": ["contentscript.js"],
31+
"css": ["style.css"],
32+
"run_at": "document_end"
33+
}
34+
],
35+
"web_accessible_resources": [
36+
{
37+
"resources": [
38+
"popup.js",
39+
"shadertoy-plugin.js",
40+
"shadertoy-plugin-common.js",
41+
"add-ons/shadertoy-plugin-codemirror.js",
42+
"add-ons/shadertoy-plugin-parameters.js",
43+
"add-ons/shadertoy-plugin-bbcode.js",
44+
"add-ons/monaco/loader.min.js",
45+
"add-ons/monaco/min/vs/editor/editor.main.js",
46+
"add-ons/monaco/min/vs/editor/editor.main.css",
47+
"add-ons/monaco/min/vs/base/worker/workerMain.js",
48+
"shadertoy-plugin-profile.js",
49+
"shadertoy-plugin-home.js",
50+
"scripts/jszip-3.1.5.js",
51+
"scripts/node-sanitize-filename.js"
52+
],
53+
"matches": ["https://www.shadertoy.com/*"]
54+
}
55+
]
56+
57+
}

0 commit comments

Comments
 (0)