@@ -15,16 +15,36 @@ jobs:
15
15
16
16
- name : Cleanup
17
17
run : |
18
- rm output -rf
18
+ rm -rf output
19
19
20
- - name : Zip the extension
20
+ - name : Prepare output directory
21
21
run : |
22
- mkdir output
23
- VERSION=$(jq -r '.version' ./app/manifest.json)
24
- zip -r ./output/ShaderToy-Chrome-Plugin-$VERSION.zip ./app
25
- echo $VERSION >> ./output/version.txt
22
+ mkdir -p output
23
+ mkdir -p output/chrome
24
+ mkdir -p output/firefox
25
+ VERSION=$(awk '{printf "%s", $0}' ./manifests/version.txt)
26
+ echo $VERSION
26
27
27
- - name : Upload output as artifact
28
+ - name : Zip the Chrome extension
29
+ run : |
30
+ VERSION=$(awk '{printf "%s", $0}' ./manifests/version.txt)
31
+ cp ./app/* ./output/chrome -r
32
+ cp ./manifests/manifest-chrome.json ./output/chrome/manifest.json
33
+ jq --arg version "$VERSION" '.version = $version' ./output/chrome/manifest.json > ./output/chrome/manifest.json.tmp && mv ./output/chrome/manifest.json.tmp ./output/chrome/manifest.json
34
+ zip -r ./output/ShaderToy-Chrome-Plugin-$VERSION.zip ./output/chrome
35
+
36
+ - name : Zip the Firefox extension
37
+ env :
38
+ FIREFOX_EXTENSION_ID : ${{ secrets.FIREFOX_EXT_ID }}
39
+ run : |
40
+ VERSION=$(awk '{printf "%s", $0}' ./manifests/version.txt)
41
+ cp ./app/* ./output/firefox -r
42
+ cp ./manifests/manifest-firefox.json ./output/firefox/manifest.json
43
+ jq --arg id "$FIREFOX_EXT_ID" '.browser_specific_settings.gecko.id = $id' ./output/firefox/manifest.json > ./output/firefox/manifest.json.tmp && mv ./output/firefox/manifest.json.tmp ./output/firefox/manifest.json
44
+ jq --arg version "$VERSION" '.version = $version' ./output/firefox/manifest.json > ./output/firefox/manifest.json.tmp && mv ./output/firefox/manifest.json.tmp ./output/firefox/manifest.json
45
+ zip -r ./output/ShaderToy-Firefox-Plugin-$VERSION.zip ./output/firefox
46
+
47
+ - name : Upload output as artifacts
28
48
uses : actions/upload-artifact@v4
29
49
with :
30
50
name : output
@@ -41,17 +61,25 @@ jobs:
41
61
42
62
- name : Install Dependencies for Publishing
43
63
run : |
44
- npm install -g chrome-webstore-upload-cli
64
+ npm install --save-dev publish-browser-extension
45
65
46
66
- name : Upload & Publish Extension to Chrome Store
67
+ env :
68
+ CHROME_CLIENT_ID : ${{ secrets.CHROME_CLIENT_ID }}
69
+ CHROME_CLIENT_SECRET : ${{ secrets.CHROME_CLIENT_SECRET }}
70
+ CHROME_REFRESH_TOKEN : ${{ secrets.CHROME_REFRESH_TOKEN }}
71
+ CHROME_EXTENSION_ID : ${{ secrets.CHROME_EXTENSION_ID }}
72
+ CHROME_PUBLISH_TARGET : trustedTesters
73
+ CHROME_SKIP_SUBMIT_REVIEW : true
74
+ FIREFOX_EXTENSION_ID : ${{ secrets.FIREFOX_EXT_ID }}
75
+ FIREFOX_JWT_ISSUER : ${{ secrets.FIREFOX_JWT_ISSUER }}
76
+ FIREFOX_JWT_SECRET : ${{ secrets.FIREFOX_JWT_SECRET }}
77
+
47
78
run : |
48
- 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
79
+ VERSION=$(awk '{printf "%s", $0}' ./manifests/version.txt)
80
+ npx publish-extension \
81
+ --chrome-zip ./output/ShaderToy-Chrome-Plugin-$VERSION.zip \
82
+ --firefox-zip ./output/ShaderToy-Firefox-Plugin-$VERSION.zip
55
83
56
84
release :
57
85
runs-on : self-hosted
64
92
65
93
- name : Publish Release on GitHub
66
94
run : |
67
- VERSION=$(cat ./output/version.txt)
68
- gh release create $VERSION ./output/ShaderToy-Chrome-Plugin-$VERSION.zip --title "$VERSION" --notes "Release of version $VERSION"
95
+ VERSION=$(awk '{printf "%s", $0}' ./manifests/version.txt)
96
+ gh release create $VERSION ./output/ShaderToy-Chrome-Plugin-$VERSION.zip ./output/ShaderToy-Firefox-Plugin-$VERSION.zip --title "$VERSION" --notes "Release of version $VERSION (Chrome)"
97
+
0 commit comments