File tree Expand file tree Collapse file tree 6 files changed +68
-21
lines changed Expand file tree Collapse file tree 6 files changed +68
-21
lines changed Original file line number Diff line number Diff line change @@ -2,10 +2,6 @@ name: Build release
2
2
3
3
on :
4
4
push :
5
- tags :
6
- - ' v*'
7
- branches :
8
- - main
9
5
10
6
jobs :
11
7
main :
@@ -32,15 +28,15 @@ jobs:
32
28
run : tools/package
33
29
34
30
# ref: https://github.com/actions/upload-artifact
35
- - name : Upload build artifact
36
- uses : actions/upload-artifact@v2
31
+ - name : Upload build artifacts
32
+ uses : actions/upload-artifact@v4
37
33
with :
38
- name : json-bookmarks.zip
39
- path : out/json-bookmarks-*.zip
34
+ name : json-bookmarks
35
+ path : out/
40
36
41
37
# ref: https://github.com/softprops/action-gh-release
42
38
- name : Create release
43
39
uses : softprops/action-gh-release@v1
44
- if : startsWith(github.ref, 'refs/tags/')
40
+ if : startsWith(github.ref, 'refs/tags/v ')
45
41
with :
46
42
files : out/json-bookmarks-*.zip
Original file line number Diff line number Diff line change 1
- browser . browserAction . onClicked . addListener ( ( tab ) => {
1
+ // Entrypoint for extension in Mozilla which only supports background script in
2
+ // manifest version 3.
3
+ browser . action . onClicked . addListener ( ( tab ) => {
2
4
browser . tabs . create ( { url : "bookmarks.html" } ) ;
3
- } ) ;
5
+ } ) ;
Original file line number Diff line number Diff line change
1
+ {
2
+ "manifest_version": 3,
3
+ "name": "Json Bookmarks",
4
+ "version": "${version}",
5
+ "homepage_url": "https://github.com/1nfiniteloop/json-bookmarks",
6
+ "description": "Import and export bookmarks between browsers with a json file",
7
+ "permissions": ["bookmarks"],
8
+ "action": {
9
+ "default_title": "JSON Bookmarks"
10
+ },
11
+ "icons": {
12
+ "16": "icon/16.png",
13
+ "32": "icon/32.png",
14
+ "48": "icon/48.png",
15
+ "96": "icon/96.png",
16
+ "128": "icon/128.png"
17
+ },
18
+ "background": {
19
+ "service_worker": "service_worker.js",
20
+ "type": "module"
21
+ }
22
+ }
Original file line number Diff line number Diff line change 1
1
{
2
- "manifest_version": 2 ,
2
+ "manifest_version": 3 ,
3
3
"name": "Json Bookmarks",
4
4
"version": "${version}",
5
5
"homepage_url": "https://github.com/1nfiniteloop/json-bookmarks",
6
6
"description": "Import and export bookmarks between browsers with a json file",
7
+ "browser_specific_settings": {
8
+ "gecko": {
9
+ "id": "{c46bac9d-a680-46b9-ab8f-15dc7f5a8c71}"
10
+ }
11
+ },
7
12
"permissions": ["bookmarks"],
8
- "browser_action ": {
13
+ "action ": {
9
14
"default_title": "JSON Bookmarks"
10
15
},
11
16
"icons": {
Original file line number Diff line number Diff line change
1
+ // Entrypoint for extension in Chrome which only supports service workers in
2
+ // manifest version 3.
3
+ import "./third_party/browser-polyfill.min.js" ;
4
+
5
+ browser . action . onClicked . addListener ( ( tab ) => {
6
+ browser . tabs . create ( { url : "bookmarks.html" } ) ;
7
+ } ) ;
Original file line number Diff line number Diff line change 1
1
#! /bin/bash
2
+ set -ue
2
3
3
4
readonly ext_name=" json-bookmarks"
4
5
@@ -13,16 +14,30 @@ get_mainfest_version()
13
14
echo " ${semver# v} "
14
15
}
15
16
16
- create_manifest ()
17
+ create_manifest_for ()
17
18
{
18
- version=" $( get_mainfest_version) " envsubst < manifest.json.in > manifest.json
19
+ browser_vendor=" ${1} "
20
+ version=" $( get_mainfest_version) " envsubst < manifest.${browser_vendor} .json.in > manifest.json
19
21
}
20
22
21
- create_manifest \
22
- && mkdir --parents out/ \
23
- && zip \
23
+ create_package_for ()
24
+ {
25
+ browser_vendor=" ${1} "
26
+ create_manifest_for " ${browser_vendor} "
27
+ mkdir --parents " out/"
28
+ zip \
24
29
--recurse-paths \
25
30
--filesync \
26
- out/${ext_name} -$( get_version) .zip \
27
- * \
28
- --exclude .git icon/src/\* out/\* TODO.md manifest.json.in
31
+ out/${ext_name} -${browser_vendor} -$( get_version) .zip \
32
+ bookmark \
33
+ icon \
34
+ third_party \
35
+ * .js \
36
+ * .html \
37
+ * .css \
38
+ LICENSE \
39
+ manifest.json
40
+ }
41
+
42
+ create_package_for " mozilla"
43
+ create_package_for " chrome"
You can’t perform that action at this time.
0 commit comments