Skip to content

Commit 5eb3e25

Browse files
authored
Merge pull request #1 from Xenion1987/cicd/firefox-signing
enable firefox signing
2 parents 86f75f7 + 0ce56ef commit 5eb3e25

File tree

6 files changed

+62
-32
lines changed

6 files changed

+62
-32
lines changed

.github/workflows/build.yml

Lines changed: 25 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Build and Release OpenStack Profile Switcher
1+
name: Build and Release OpenStack Project Switcher
22

33
on:
44
push:
@@ -37,24 +37,37 @@ jobs:
3737
echo "VERSION=$VERSION" >> $GITHUB_ENV
3838
echo "Using version: $VERSION"
3939
40+
- name: Set manifest's version to $VERSION
41+
run: |
42+
if [[ ${VERSION} =~ [1-9][0-9]*\.[0-9]+\.[0-9]+ ]]; then
43+
sed -r -i "s/\"version\": \"[1-9][0-9]*\.[0-9]+\.[0-9]+\"/\"version\": \"${VERSION}\"/" manifest.json
44+
fi
45+
4046
- name: Prepare Chrome extension zip
4147
run: |
42-
mkdir -p dist
43-
zip -r dist/openstack-profile-switcher-chrome-${VERSION}.zip \
48+
mkdir -p upload
49+
zip -r upload/openstack-project-switcher-chrome-${VERSION}.zip \
4450
manifest.json popup/ images/ options/
4551
46-
- name: Prepare Firefox extension xpi
52+
- name: Install web-ext
53+
run: npm install --global web-ext
54+
55+
- name: Sign Firefox Add-on
56+
env:
57+
WEBEXT_API_KEY: ${{ secrets.AMO_JWT_ISSUER }}
58+
WEBEXT_API_SECRET: ${{ secrets.AMO_JWT_SECRET }}
4759
run: |
48-
cd . # root of repository
49-
zip -r -FS dist/openstack-profile-switcher-firefox-${VERSION}.xpi \
50-
manifest.json popup images options \
51-
--exclude '*.git*' --exclude '*.DS_Store*'
60+
web-ext sign --source-dir=./ \
61+
--channel=unlisted \
62+
--artifacts-dir=upload \
63+
--api-key=${WEBEXT_API_KEY} \
64+
--api-secret=${WEBEXT_API_SECRET}
5265
5366
- name: Upload artifacts for debugging
5467
uses: actions/upload-artifact@v4
5568
with:
56-
name: OpenStack-Profile-Switcher-Extensions
57-
path: dist/
69+
name: OpenStack-Project-Switcher-Extensions
70+
path: upload/
5871

5972
release:
6073
needs: build
@@ -64,12 +77,12 @@ jobs:
6477
- name: Download build artifacts
6578
uses: actions/download-artifact@v4
6679
with:
67-
name: OpenStack-Profile-Switcher-Extensions
80+
name: OpenStack-Project-Switcher-Extensions
6881
path: dist
6982

7083
- name: Upload release assets
7184
uses: softprops/action-gh-release@v1
7285
with:
73-
files: dist/*
86+
files: upload/*
7487
env:
7588
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
.env
2+
.envrc
3+
.amo-upload-uuid
4+
5+
upload/

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# OpenStack Profile Switcher
1+
# OpenStack Project Switcher
22

33
A lightweight browser extension that lets you quickly switch between projects in the OpenStack Horizon dashboard.
44
Supports multiple Horizon instances by allowing the user to add domains dynamically.

manifest.json

Lines changed: 27 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,35 @@
11
{
2-
"name": "OpenStack Profile Switcher",
3-
"description": "Switch comfortably between OpenStack Projects.",
4-
"version": "1.0.0",
5-
"manifest_version": 3,
62
"action": {
7-
"default_popup": "popup/popup.html",
8-
"default_icon": "images/ops_logo_128x128.png"
3+
"default_icon": "images/ops_logo_128x128.png",
4+
"default_popup": "popup/popup.html"
95
},
10-
"options_page": "options/options.html",
11-
"permissions": ["storage", "tabs"],
12-
"host_permissions": [],
13-
"optional_host_permissions": ["https://*/"],
146
"browser_specific_settings": {
157
"gecko": {
16-
"id": "openstack-profile-switcher@access-intech.de",
17-
"strict_min_version": "128.0",
188
"data_collection_permissions": {
19-
"required": ["none"]
20-
}
9+
"required": [
10+
"none"
11+
]
12+
},
13+
"id": "openstack-project-switcher@access-intech.de",
14+
"strict_min_version": "128.0"
2115
}
22-
}
16+
},
17+
"description": "Switch comfortably between OpenStack Projects.",
18+
"homepage_url": "https://github.com/Xenion1987/openstack-project-switcher",
19+
"host_permissions": [],
20+
"icons": {
21+
"48": "images/ops_logo_128x128.png",
22+
"128": "images/ops_logo_128x128.png"
23+
},
24+
"manifest_version": 3,
25+
"name": "OpenStack Project Switcher",
26+
"optional_host_permissions": [
27+
"https://*/"
28+
],
29+
"options_page": "options/options.html",
30+
"permissions": [
31+
"storage",
32+
"tabs"
33+
],
34+
"version": "1.0.1"
2335
}

popup/popup.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<html>
33
<head>
44
<meta charset="utf-8">
5-
<title>OpenStack Profile Switcher</title>
5+
<title>OpenStack Project Switcher</title>
66
<link rel="stylesheet" href="popup.css">
77
</head>
88
<body>

popup/popup.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ document.addEventListener("DOMContentLoaded", async () => {
7575
chrome.tabs.update(tab.id, { url: switchUrl });
7676
}
7777
} catch (e) {
78-
console.error("[openstack-profile-switcher] Could not build switch URL:", e);
78+
console.error("[openstack-project-switcher] Could not build switch URL:", e);
7979
}
8080
};
8181

@@ -166,7 +166,7 @@ document.addEventListener("DOMContentLoaded", async () => {
166166
) {
167167
try {
168168
allProjects = JSON.parse(cache);
169-
console.log("[openstack-profile-switcher] Using cached projects.");
169+
console.log("[openstack-project-switcher] Using cached projects.");
170170
renderProjects(searchInput.value);
171171
return;
172172
} catch {
@@ -176,7 +176,7 @@ document.addEventListener("DOMContentLoaded", async () => {
176176

177177
try {
178178
allProjects = await fetchProjects();
179-
console.log("[openstack-profile-switcher] Project list updated.");
179+
console.log("[openstack-project-switcher] Project list updated.");
180180
} catch (err) {
181181
console.error(err);
182182
listContainer.textContent = "Error loading projects.";

0 commit comments

Comments
 (0)