Skip to content

Commit

Permalink
consolidating firefox and chrome versions
Browse files Browse the repository at this point in the history
  • Loading branch information
evandor committed Aug 31, 2024
1 parent 2494b9b commit 5abb577
Show file tree
Hide file tree
Showing 6 changed files with 176 additions and 13 deletions.
65 changes: 65 additions & 0 deletions .github/workflows/publish-firefox.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
#run locally:
#carstengraef@Carstens-MBP tabsets % act -W '.github/workflows/publish.yml' -P ubuntu-latest=ghcr.io/catthehacker/ubuntu:js-latest \
# --secret-file act.secrets.txt --container-architecture linux/amd64


name: Publish
#on:
# push:
# branches: [ firefox-extension ]
on:
push:
tags:
- 'v*.*.*-firefox'

jobs:
build:
name: Publish webextension
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
with:
submodules: 'true'
- uses: actions/setup-node@v1
with:
node-version: 18
- name: 'Create env file'
run: |
touch .env
echo STAGE=PRD >> .env
echo BACKEND_URL="https://tabsets-72089.web.app" >> .env
echo TABSETS_PWA_URL="https://pwa.tabsets.net" >> .env
- name: Build
run: |
yarn install
npm run "build bex (publish)"
- name: "web-ext build"
id: web-ext-build
uses: kewisch/action-web-ext@v1
with:
cmd: build
source: dist/bex
# filename: "{name}-{version}.xpi"
filename: "{name}.xpi"
ignoreFiles: '[ "package.json","package-lock.json","yarn.lock" ]'

- uses: trmcnvn/firefox-addon@v1
with:
# uuid is only necessary when updating an existing addon,
# omitting it will create a new addon
uuid: '{5809ba95-274e-4fd3-a92d-5baf03026290}'
xpi: web-ext-artifacts/tabsets.net.xpi
manifest: dist/bex/manifest.json
api-key: ${{ secrets.FIREFOX_API_KEY }}
api-secret: ${{ secrets.FIREFOX_API_SECRET }}

# - name: Upload & release
# uses: mnao305/[email protected]
# with:
# file-path: dist/bex/Packaged.tabsets.net.zip
# extension-id: afkknkdbgondbbfjehipnjmojndnjhjg
# client-id: ${{ secrets.CLIENT_ID }}
# client-secret: ${{ secrets.CLIENT_SECRET }}
# refresh-token: ${{ secrets.REFRESH_TOKEN }}
# publish: false
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -78,3 +78,4 @@ docs/.vitepress/cache
/.tabsets-backend-prd.env
/.env.tmp
/docs/submodules/build/
/src-bex/manifest.tmp
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,16 @@
"private": true,
"scripts": {
"dev": "quasar dev -m bex",
"dev-firefox": "mv src-bex/manifest.json src-bex/manifest.tmp && cp src-bex/manifest-firefox.json src-bex/manifest.json && quasar dev -m bex && mv src-bex/manifest.tmp src-bex/manifest.json",
"dev spa (only for testing)": "quasar dev -m spa",
"dev pwa": "quasar dev -m pwa",
"dev ssr": "quasar dev -m ssr",
"dev stage prod": "stage=production quasar dev -m bex",
"dev electron": "quasar dev -m electron",
"dev capacitor": "quasar dev -m capacitor -T ios",
"dev cordova": "quasar dev -m cordova -T ios",
"web-ext run": "cd dist/bex && web-ext run --verbose",
"web-ext build": "quasar build -m bex && zip dist/tabset.src.zip -r src/ src-bex/ package.json && cd dist/bex && web-ext build",
"build bex (dev)": "mv .env .env.tmp && cp .dev.env .env && quasar build -m bex && mv .env.tmp .env",
"build bex (prd)": "mv .env .env.tmp && cp .prd.env .env && quasar build -m bex && mv .env.tmp .env",
"build bex (publish)": "quasar build -m bex",
Expand Down
92 changes: 92 additions & 0 deletions src-bex/manifest-firefox.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
{
"manifest_version": 3,
"browser_specific_settings": {
"gecko": {
"id": "{5809ba95-274e-4fd3-a92d-5baf03026290}"
}
},
"icons": {
"16": "icons/icon-16x16.png",
"48": "icons/icon-48x48.png",
"128": "icons/icon-128x128.png"
},
"permissions": [
"storage",
"tabs",
"activeTab",
"alarms",
"scripting",
"sidePanel",
"contextMenus",
"bookmarks"
],
"optional_permissions": [
"pageCapture",
"notifications",
"webRequest"
],
"host_permissions": [
"<all_urls>",
"*://*/*"
],
"background": {
"scripts": ["background.js"]
},
"content_scripts": [
{
"matches": [
"*://*/*"
],
"js": [
"tabsets-content-script.js"
]
}
],
"content_security_policy": {
"extension_pages": "script-src 'self'; object-src 'self';"
},
"web_accessible_resources": [
{
"resources": [
"*"
],
"matches": [
"*://*/*"
]
}
],
"omnibox": { "keyword": "ts" },
"sidebar_action": {
"default_icon": "icons/icon-48x48.png",
"default_title" : "Tabsets",
"default_panel": "www/index.html#/sidepanel"
},
"commands": {
"_execute_sidebar_action": {
"suggested_key": {
"default": "Ctrl+Shift+Period"
}
},
"search": {
"suggested_key": {
"default": "Ctrl+K",
"mac": "Command+K"
},
"description": "Open Search Box"
},
"tabHistoryBack": {
"suggested_key": {
"default": "Alt+Left",
"mac": "Alt+Left"
},
"description": "Open last open tab"
},
"tabHistoryForward": {
"suggested_key": {
"default": "Alt+Right",
"mac": "Alt+Right"
},
"description": "Forward to next tab (if available)"
}
}
}
26 changes: 15 additions & 11 deletions src-bex/manifest.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"manifest_version": 3,
"browser_specific_settings": {
"gecko": {
"id": "{5809ba95-274e-4fd3-a92d-5baf03026290}"
}
},
"icons": {
"16": "icons/icon-16x16.png",
"48": "icons/icon-48x48.png",
Expand All @@ -18,18 +23,14 @@
"optional_permissions": [
"pageCapture",
"notifications",
"webRequest",
"tabGroups"
"webRequest"
],
"host_permissions": [
"<all_urls>",
"*://*/*"
],
"side_panel": {
"default_path": "www/sidepanel.html"
},
"background": {
"service_worker": "background.js"
"scripts": ["background.js"]
},
"content_scripts": [
{
Expand All @@ -55,11 +56,15 @@
}
],
"omnibox": { "keyword": "ts" },
"sidebar_action": {
"default_icon": "icons/icon-48x48.png",
"default_title" : "Tabsets",
"default_panel": "www/index.html#/sidepanel"
},
"commands": {
"_execute_action": {
"_execute_sidebar_action": {
"suggested_key": {
"default": "Ctrl+B",
"mac": "Command+B"
"default": "Ctrl+Shift+Period"
}
},
"search": {
Expand All @@ -83,6 +88,5 @@
},
"description": "Forward to next tab (if available)"
}
},
"options_page": "www/index.html#/mainpanel/settings"
}
}
2 changes: 0 additions & 2 deletions src/services/IndexedDbPersistenceService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ import {Suggestion, SuggestionState, SuggestionType} from "src/suggestions/model
import {useUiStore} from "src/ui/stores/uiStore";
import {RequestInfo} from "src/models/RequestInfo";
import {useSuggestionsStore} from "src/suggestions/stores/suggestionsStore";
import {Message} from "src/models/Message";
import {Account} from "src/models/Account";
import {useTabsetsStore} from "src/tabsets/stores/tabsetsStore";

class IndexedDbPersistenceService implements PersistenceService {
Expand Down

0 comments on commit 5abb577

Please sign in to comment.