Skip to content

Commit 6aa0d34

Browse files
Revert "Add xpi-template and a package.json to build the XPIs"
This reverts commit b228993.
1 parent b228993 commit 6aa0d34

38 files changed

Lines changed: 253 additions & 623 deletions

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
*.pyc
21
*.xpi

.taskcluster.yml

Lines changed: 0 additions & 307 deletions
This file was deleted.

Makefile

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
ARCHS=linux linux64 mac64 win32
2+
3+
EXTENSION_NAME=adb-extension
4+
VERSION=0.0.6pre
5+
XPI_NAME=$(EXTENSION_NAME)-$(VERSION)
6+
7+
ROOT_PATH=pub/labs/devtools/$(EXTENSION_NAME)
8+
ROOT_UPDATE_URL=https://ftp.mozilla.org/$(ROOT_PATH)
9+
S3_BASE_URL=s3://net-mozaws-prod-delivery-contrib/$(ROOT_PATH)
10+
11+
define build-xpis
12+
pushd extension; \
13+
for arch in $(ARCHS); do \
14+
echo "[release-$$arch] Create manifest.json"; \
15+
sed \
16+
-e "s#@@UPDATE_URL@@#$(ROOT_UPDATE_URL)/$$arch/update.json#" \
17+
-e "s#@@VERSION@@#$(VERSION)#" \
18+
template-manifest.json > manifest.json; \
19+
echo "[release-$$arch] ZIP to $(XPI_NAME)-$$arch.xpi"; \
20+
zip ../dist/$(XPI_NAME)-$$arch.xpi -r $$arch adb.json manifest.json; \
21+
echo "[release-$$arch] Delete temporary manifest.json"; \
22+
rm manifest.json; \
23+
done; \
24+
popd
25+
endef
26+
27+
define clean
28+
echo "Remove previous xpi files"; \
29+
rm -f **/*.xpi
30+
endef
31+
32+
define release
33+
pushd dist; \
34+
for arch in $(ARCHS); do \
35+
echo "[release-$$arch] Sign .xpi"; \
36+
../sign.sh $(XPI_NAME)-$$arch.xpi; \
37+
echo "[release-$$arch] Upload .xpi"; \
38+
aws s3 cp \
39+
$(XPI_NAME)-$$arch.xpi \
40+
$(S3_BASE_URL)/$$arch/$(XPI_NAME)-$$arch.xpi; \
41+
echo "[release-$$arch] Copy to 'latest' .xpi"; \
42+
aws s3 cp \
43+
$(S3_BASE_URL)/$$arch/$(XPI_NAME)-$$arch.xpi \
44+
$(S3_BASE_URL)/$$arch/adb-extension-latest-$$arch.xpi; \
45+
echo "[release-$$arch] Create update.json"; \
46+
sed \
47+
-e "s#@@UPDATE_LINK@@#$(ROOT_UPDATE_URL)/$$arch/$(XPI_NAME)-$$arch.xpi#" \
48+
-e "s#@@VERSION@@#$(VERSION)#" \
49+
../template-update.json > update.json; \
50+
echo "[release-$$arch] Upload update.json"; \
51+
aws s3 cp --cache-control max-age=3600 \
52+
update.json \
53+
$(S3_BASE_URL)/$$arch/update.json; \
54+
echo "[release-$$arch] Delete temporary update.json"; \
55+
rm update.json; \
56+
done; \
57+
popd
58+
endef
59+
60+
package:
61+
@$(call clean)
62+
@$(call build-xpis)
63+
64+
clean:
65+
@$(call clean)
66+
67+
release:
68+
@$(call release)

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,14 @@
33
This is a Firefox extension that supports remote debugging in Firefox DevTools.
44
It provides ADB binaries used by DevTools to connect to Firefox/GeckoView products on Android devices via USB.
55

6-
### Development
6+
### Releases
77

8-
Do not edit the JSON files manually, modify `scripts/generate-files` and re-run it to have all the JSON files updated for all the extension variants at once.
8+
For documentation about releases check out [RELEASE.md](./RELEASE.md)
99

1010
### Discussion
1111

12-
For questions and issues specific to this extension, you can use the [GitHub issue tracker](https://github.com/mozilla-extensions/devtools-adb-extension/issues).
12+
For questions and issues specific to this extension, you can use the [GitHub issue tracker](https://github.com/mozilla/devtools-adb-extension/issues).
1313

1414
For more general questions about remote debugging in DevTools or DevTools in general, you can:
15-
- come chat with us on Matrix (#devtools:mozilla.org)
15+
- come chat with us on [Slack](https://devtools-html-slack.herokuapp.com/) or IRC (#devtools at irc.mozilla.org)
1616
- file bugs on [Bugzilla](https://bugzilla.mozilla.org/enter_bug.cgi?product=DevTools)

RELEASE.md

Lines changed: 127 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
1+
# Release a new version
2+
3+
1) Update extension version
4+
5+
The current version on github should already be `${YOUR_VERSION}pre`.
6+
The version is set in `Makefile` header, in a `VERSION` variable.
7+
So your first task will be to remove the `pre` suffix.
8+
For example, if we were about to release 0.12.1, Makefile should already be set to:
9+
```
10+
VERSION=0.12.1pre
11+
```
12+
And, while releasing, you have to update that variable to:
13+
```
14+
VERSION=0.12.1
15+
```
16+
17+
2) Commit that change
18+
19+
```
20+
$ git commit -m "Release 0.12.1" Makefile
21+
```
22+
23+
3) Get AWS keys to sign *and* upload the extension
24+
25+
For all the informations about how to sign the extension, and get keys, see:
26+
https://mana.mozilla.org/wiki/display/SVCOPS/Sign+a+Mozilla+Internal+Extension
27+
To get keys used for uploading the extension, please use this bug as a template for you:
28+
https://bugzilla.mozilla.org/show_bug.cgi?id=1481123
29+
30+
4) Build the extension
31+
32+
This step is simple, just do:
33+
```
34+
$ make
35+
```
36+
It will create under the dist/ folder:
37+
- `adb-extension-0.12.1-linux.xpi`
38+
- `adb-extension-0.12.1-linux64.xpi`
39+
- `adb-extension-0.12.1-win32.xpi`
40+
- `adb-extension-0.12.1-mac64.xpi`.
41+
42+
5) Setup `sign-xpi` tool, used to sign the extension
43+
44+
```
45+
git clone https://github.com/mozilla-services/sign-xpi/
46+
# We need to checkout this revision since we are currently updating and testing a new implementation
47+
cd sign-xpi/cli
48+
git checkout 291a3e22ddb100772a452264c2827daaf4ac5774
49+
virtualenv venv
50+
source venv/bin/activate
51+
pip install -e .
52+
```
53+
54+
After that, you can verify that `sign-xpi` is in your path by running it:
55+
```
56+
$ sign-xpi
57+
Traceback (most recent call last):
58+
File "/home/alex/adbhelper/sign-xpi/cli/venv/bin/sign-xpi", line 11, in <module>
59+
...
60+
raise NoRegionError()
61+
botocore.exceptions.NoRegionError: You must specify a region.
62+
```
63+
(`sign-xpi` throws when no arguments are given, but it means it is in your path!)
64+
65+
You may also want to install amazon AWS cli tool, if you don't have it installed yet:
66+
```
67+
$ pip install awscli --upgrade
68+
```
69+
(Note that it will install it in the virtualenv, and will only be available from it)
70+
71+
You might need to first uninstall it
72+
73+
```
74+
$ pip uninstall awscli
75+
```
76+
77+
If you get dependency issues with botocore, try uninstalling and reinstalling it as well
78+
79+
```
80+
$ pip uninstall botocore boto3 && pip install boto3
81+
```
82+
83+
84+
6) Test your extension
85+
86+
In step 3, you should have received two set of signing keys.
87+
One for "production", and another for "stage".
88+
You can use the stage one in order to test your extension.
89+
Pick the xpi file related to your operating system and do:
90+
```
91+
$ SIGN_AWS_SECRET_ACCESS_KEY=xxx SIGN_AWS_ACCESS_KEY_ID=xxx ./sign.sh adb-extension-0.12.1-linux64.xpi
92+
Signing adb-extension-0.12.1-linux64.xpi
93+
{"uploaded": {"bucket": "net-mozaws-prod-addons-signxpi-output", "key": "adb-extension-0.12.1-linux64.xpi"}}
94+
download: s3://net-mozaws-prod-addons-signxpi-output/adb-extension-0.12.1-linux64.xpi to ./adb-extension-0.12.1-linux64.xpi
95+
```
96+
The xpi file should now be signed and be installable in Firefox.
97+
Please test your extension now.
98+
99+
7) Release the extension
100+
101+
If the extension works fine after testing it, you can release it via:
102+
```
103+
SIGN_AWS_SECRET_ACCESS_KEY=xxx SIGN_AWS_ACCESS_KEY_ID=xxx AWS_SECRET_ACCESS_KEY=xxx AWS_ACCESS_KEY_ID=xxx make release
104+
```
105+
106+
SIGN_AWS_SECRET_ACCESS_KEY and SIGN_AWS_ACCESS_KEY_ID are the credential to sign the extension,
107+
while AWS_SECRET_ACCESS_KEY and AWS_ACCESS_KEY_ID are the one to upload it.
108+
109+
8) Push the release to github
110+
111+
```
112+
$ git tag 0.12.1
113+
$ git push upstream 0.12.1
114+
```
115+
116+
9) Update master's current version
117+
118+
Go edit Makefile again to bump to the next "pre" version:
119+
```
120+
VERSION=0.12.2pre
121+
```
122+
And commit and push that change to master branch:
123+
```
124+
$ git commit -m "Bump to 0.12.2pre" Makefile
125+
$ git push upstream HEAD:master
126+
```
127+

dist/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
This folder contains the built XPIs for the adb extension.

0 commit comments

Comments
 (0)