Description
The current workflow for releasing the extension properly builds Chrome, but does not properly build Firefox in a way that can be submitted for review (as the Chrome version can):
- The built extension asset for Firefox must be the
.zip
file generated insideapps/extension/build/firefox
, and not a zip archive of the entire folder (e.g., decompressing this archive should not place files inside of a folder; this is a requirement for submission) - The source code should be packaged with only the dependencies needed to build the extension
- The source code archive should have the following injected into the
apps/extension/.env
folder before zipping, replacing the hash with the current git revision in the build:
NAMADA_INTERFACE_REVISION=8916680a2bcd43f1ef54b47e2d0213d1d02abbfb
This is provided so that Firefox reviewers can build an exact copy of the Firefox add-on, which will contain this hash (Settings->Revision). The packaged source will not be a .git
repo, therefore this is the simplest way for them to get an equivalent build.
See current example release: https://github.com/anoma/namada-interface/releases/tag/v0.3.6-8916680
The current workflow bundles source as:
Source code (zip)
Source code (tar.gz)
It would be better if this was simply the extension source + dependencies (remove .git
, .github
, apps/namadillo
& apps/faucet
mainly). I think this is important to do because we do not want them to waste time reviewing code that is irrelevant to the extension. Eventually this won't be an issue when the extension is moved to its own repo!
Caveat
It may be difficult to fully verify this change until we have a valid submission to Firefox, as there may be more changes to account for. At least we can now get started on packaging and adding the .env
- that is a very good start!
Exact steps to submit to Firefox, before we have this in CI
NOTE I always package source before producing a build. I think this is a good practice when building manually as it ensures all dependencies are in place in the source archive that we submit. Any issues should be fixed in the source archive before re-building!
NOTE Replace 0.3.x
with correct version. This should basically be what is handled by CI in the future.
git clone https://github.com/anoma/namada-interface.git namada-keychain-firefox-0.3.x-source
cd namada-keychain-firefox-0.3.x-source
# The extension must have the git revision specified in a .env
# In the actual namada-interface repo, get the latest commit hash
cd /path/to/namada-interface
git checkout main
git pull
echo "NAMADA_INTERFACE_REVISION=$(git rev-parse HEAD)" > \
/path/to/namada-keychain-firefox-0.3.x-source/apps/extension/.env
# Clean up unneeded sources & folders to reduce file size
rm -rf apps/namadillo
rm -rf apps/faucet
rm -rf .git*
rm -rf e2e
rm -rf storybook
rm -rf audit
# Create zip archive
zip -r namada-keychain-firefox-0.3.x-source.zip namada-keychain-firefox-0.3.x-source
# Build namada-keychain-firefox-0.3.x-source.zip using Docker, once finished provide the zip, along with the source code zip
/path/to/namada-keychain-firefox-0.3.x-source/apps/extension/build/firefox/namada-keychain-0.3.x.zip