2020-11-04 19:51:48 -05:00
# OnionShare Release Process
Unless you're a core OnionShare developer making a release, you'll probably never need to follow it.
## Changelog, version, docs, and signed git tag
Before making a release, you must update the version in these places:
- [ ] `cli/pyproject.toml`
- [ ] `cli/setup.py`
- [ ] `cli/onionshare_cli/resources/version.txt`
2020-11-08 23:53:08 -05:00
- [ ] `desktop/pyproject.toml` (under `version` and **don't forget** the `./onionshare_cli-$VERSION-py3-none-any.whl` dependency)
2020-11-04 19:51:48 -05:00
- [ ] `desktop/src/setup.py`
2021-09-10 16:45:36 -04:00
- [ ] `desktop/src/org.onionshare.OnionShare.appdata.xml`
2021-02-22 23:00:27 -05:00
- [ ] `docs/source/conf.py` (`version` at the top, and the `versions` list too)
2020-11-08 23:45:54 -05:00
- [ ] `snap/snapcraft.yaml`
2021-05-31 13:36:07 -04:00
If you update `flask-socketio` , ensure that you also update the [socket.io.min.js ](https://github.com/micahflee/onionshare/blob/develop/cli/onionshare_cli/resources/static/js/socket.io.min.js ) file to a version that is [supported ](https://flask-socketio.readthedocs.io/en/latest/#version-compatibility ) by the updated version of `flask-socketio` .
2021-05-06 15:53:11 -04:00
2021-05-04 23:26:21 -04:00
Use tor binaries from the latest Tor Browser:
- [ ] `desktop/scripts/get-tor-osx.py`
- [ ] `desktop/scripts/get-tor-windows.py`
2020-11-08 23:45:54 -05:00
Update the documentation:
- [ ] Update all of the documentation in `docs` to cover new features, including taking new screenshots if necessary
2021-02-21 13:55:08 -05:00
Finalize localization:
- [ ] Merge all the translations from weblate
2021-05-31 13:36:07 -04:00
- [ ] In `docs` run `poetry run ./check-weblate.py [API_KEY]` to see which translations are >90% in the app and docs
2021-02-21 13:55:08 -05:00
- [ ] Edit `cli/onionshare_cli/settings.py` , make sure `self.available_locales` lists only locales that are >90% translated
- [ ] Edit `docs/source/conf.py` , make sure `languages` lists only languages that are >90% translated
2021-02-22 23:00:27 -05:00
- [ ] Edit `docs/build.sh` and make sure `LOCALES=` lists the same languages as above, in `docs/source/conf.py`
2021-02-21 13:55:08 -05:00
- [ ] Make sure the latest documentation is built and committed:
```
cd docs
poetry install
poetry run ./build.sh
```
2020-11-08 23:45:54 -05:00
You also must edit these files:
2021-09-10 16:45:36 -04:00
- [ ] `desktop/src/org.onionshare.OnionShare.appdata.xml` should have the correct release date, and links to correct screenshots
2020-11-08 23:45:54 -05:00
- [ ] `CHANGELOG.md` should be updated to include a list of all major changes since the last release
2020-11-04 19:51:48 -05:00
2020-11-08 15:07:17 -05:00
Make sure snapcraft packaging works. In `snap/snapcraft.yaml` :
- [ ] The `tor` , `libevent` , and `obfs4` parts should be updated if necessary
- [ ] All python packages should be updated to match `cli/pyproject.toml` and `desktop/pyproject.toml`
- [ ] Test the snap package, ensure it works
2021-09-17 17:08:10 -04:00
- [ ] Change `grade: devel` to `grade: stable`
2020-11-08 15:07:17 -05:00
Finally:
2020-11-04 19:51:48 -05:00
- [ ] There must be a PGP-signed git tag for the version, e.g. for OnionShare 2.1, the tag must be `v2.1`
The first step for the Linux, macOS, and Windows releases is the same.
Verify the release git tag:
```sh
git fetch
git tag -v v$VERSION
```
If the tag verifies successfully, check it out:
```sh
git checkout v$VERSION
```
## Linux Snapcraft release
You must have `snap` and `snapcraft` (`snap install snapcraft --classic`) installed.
Build and test the snap before publishing:
```sh
snapcraft
2020-11-08 17:49:24 -05:00
snap install --devmode ./onionshare_$VERSION_amd64.snap
2020-11-04 19:51:48 -05:00
```
2020-11-24 00:20:29 -05:00
This will create `onionshare_$VERSION_amd64.snap` .
Run the OnionShare snap locally:
2020-11-04 19:51:48 -05:00
```sh
2020-11-24 00:20:29 -05:00
/snap/bin/onionshare # desktop version
2020-11-04 19:51:48 -05:00
/snap/bin/onionshare.cli # CLI version
```
2021-09-17 17:08:10 -04:00
Login to snapcraft.io, wait for the CI builds to finish, and then in the Releases tab promote the release to stable.
2020-11-08 17:49:24 -05:00
2020-11-04 19:51:48 -05:00
## Linux AppImage release
_Note: AppImage packages are currently broken due to [this briefcase bug ](https://github.com/beeware/briefcase/issues/504 ). Until it's fixed, OnionShare for Linux will only be available in Flatpak and Snapcraft._
2020-11-08 15:07:17 -05:00
Set up the development environment described in `README.md` .
2020-11-04 19:51:48 -05:00
2020-11-08 15:07:17 -05:00
Make sure your virtual environment is active:
2020-11-04 19:51:48 -05:00
```sh
2020-11-08 15:07:17 -05:00
. venv/bin/activate
2020-11-04 19:51:48 -05:00
```
2020-11-08 15:07:17 -05:00
Run the AppImage build script:
2020-11-04 19:51:48 -05:00
```sh
2020-11-08 15:07:17 -05:00
./package/linux/build-appimage.py
2020-11-04 19:51:48 -05:00
```
2021-02-21 13:55:08 -05:00
## Windows
2020-11-04 19:51:48 -05:00
2020-11-06 16:24:43 -05:00
Set up the development environment described in `README.md` . And install the [Windows 10 SDK ](https://developer.microsoft.com/en-us/windows/downloads/windows-10-sdk ) and add `C:\Program Files (x86)\Windows Kits\10\bin\10.0.19041.0\x86` to your path.
2020-11-04 19:51:48 -05:00
2020-11-06 16:24:43 -05:00
Make sure your virtual environment is active:
2020-11-04 19:51:48 -05:00
```
2020-11-06 16:24:43 -05:00
venv\Scripts\activate.bat
2020-11-04 19:51:48 -05:00
```
2020-11-06 16:24:43 -05:00
Run the Windows build script:
2020-11-04 19:51:48 -05:00
2020-11-06 16:24:43 -05:00
```
python package\windows\build.py
2020-11-04 19:51:48 -05:00
```
2020-11-08 17:49:24 -05:00
This will create `desktop/windows/OnionShare-$VERSION.msi` , signed.
2020-11-04 19:51:48 -05:00
2021-02-21 13:55:08 -05:00
## macOS
2020-11-04 19:51:48 -05:00
2020-11-06 16:24:43 -05:00
Set up the development environment described in `README.md` . And install `create-dmg` :
```sh
brew install create-dmg
```
2020-11-06 11:54:53 -05:00
Make sure your virtual environment is active:
2020-11-04 19:51:48 -05:00
```sh
2020-11-06 11:54:53 -05:00
. venv/bin/activate
2020-11-04 19:51:48 -05:00
```
2020-11-06 16:24:43 -05:00
Run the macOS build script:
2020-11-04 19:51:48 -05:00
```sh
2020-11-06 11:54:53 -05:00
./package/macos/build.py --with-codesign
2020-11-04 19:51:48 -05:00
```
2020-11-04 20:34:00 -05:00
Now, notarize the release. You must have an app-specific Apple ID password saved in the login keychain called `onionshare-notarize` .
2020-11-06 12:33:37 -05:00
- Notarize it: `xcrun altool --notarize-app --primary-bundle-id "com.micahflee.onionshare" -u "micah@micahflee.com" -p "@keychain:onionshare-notarize" --file macOS/OnionShare.dmg`
2020-11-04 20:34:00 -05:00
- Wait for it to get approved, check status with: `xcrun altool --notarization-history 0 -u "micah@micahflee.com" -p "@keychain:onionshare-notarize"`
2020-11-06 12:33:37 -05:00
- After it's approved, staple the ticket: `xcrun stapler staple macOS/OnionShare.dmg`
2020-11-04 20:34:00 -05:00
2020-11-08 17:49:24 -05:00
This will create `desktop/macOS/OnionShare.dmg` , signed and notarized.
2020-11-04 20:34:00 -05:00
2021-02-21 13:55:08 -05:00
## Source package
2020-11-04 20:34:00 -05:00
2020-11-08 15:07:17 -05:00
To make a source package, run `./build-source.sh $TAG` , where `$TAG` is the the name of the signed git tag, e.g. `v2.1` .
This will create `dist/onionshare-$VERSION.tar.gz` .
2020-11-04 20:34:00 -05:00
2021-02-21 13:55:08 -05:00
## Publishing the release
2020-11-04 20:34:00 -05:00
2021-02-22 23:00:27 -05:00
### PGP signatures
2020-11-08 17:49:24 -05:00
After following all of the previous steps, gather these files:
2020-11-04 20:34:00 -05:00
2020-11-08 17:49:24 -05:00
- `onionshare_$VERSION_amd64.snap`
- `OnionShare-$VERSION.msi`
- `OnionShare.dmg` (rename it to `OnionShare-$VERSION.dmg` )
- `onionshare-$VERSION.tar.gz`
Create a PGP signature for each of these files, e.g:
```sh
2021-08-20 17:13:44 -04:00
gpg -a --detach-sign OnionShare-$VERSION.tar.gz
2020-11-08 17:49:24 -05:00
gpg -a --detach-sign [... and so on]
```
2021-02-22 23:00:27 -05:00
### Create a release on GitHub:
2020-11-08 17:49:24 -05:00
- Match it to the version tag, put the changelog in description of the release
2021-02-22 23:00:27 -05:00
- Upload all 8 files (binary and source packages and their `.asc` signatures)
2020-11-08 17:49:24 -05:00
2021-02-22 23:00:27 -05:00
### Update onionshare-cli on PyPi
2020-11-08 17:49:24 -05:00
2021-02-22 23:00:27 -05:00
```sh
cd cli
poetry install
poetry publish --build
```
2020-11-08 17:49:24 -05:00
2021-02-22 23:00:27 -05:00
### Update Flathub
2021-02-21 13:55:08 -05:00
2021-02-22 23:00:27 -05:00
After there's a new release tag, make the Flathub package work here: https://github.com/flathub/org.onionshare.OnionShare
2021-02-21 13:55:08 -05:00
2021-02-22 23:00:27 -05:00
You must have `flatpak` and `flatpak-builder` installed, with flathub remote added (`flatpak remote-add --if-not-exists --user flathub https://flathub.org/repo/flathub.flatpakrepo`).
2020-11-08 17:49:24 -05:00
2021-06-01 22:39:34 -04:00
- [ ] Change the tag (for both `onionshare` and `onionshare-cli` ) to match the new git tag
2021-02-22 23:00:27 -05:00
- [ ] Update `tor` , `libevent` , and `obfs4` dependencies, if necessary
- [ ] Built the latest python dependencies using [this tool ](https://github.com/flatpak/flatpak-builder-tools/blob/master/pip/flatpak-pip-generator ) (see below)
- [ ] Test the Flatpak package, ensure it works
2020-11-08 17:49:24 -05:00
2021-02-22 23:00:27 -05:00
```
# you may need to install toml
pip3 install --user toml
# clone flatpak-build-tools
git clone https://github.com/flatpak/flatpak-builder-tools.git
# get onionshare-cli dependencies
2021-06-01 22:39:34 -04:00
cd poetry
./flatpak-poetry-generator.py ../../onionshare/cli/poetry.lock
cd ..
2021-02-22 23:00:27 -05:00
# get onionshare dependencies
2021-06-01 22:39:34 -04:00
cd pip
2021-02-22 23:00:27 -05:00
./flatpak-pip-generator $(python3 -c 'import toml; print("\n".join(toml.loads(open("../../onionshare/desktop/pyproject.toml").read())["tool"]["briefcase"]["app"]["onionshare"]["requires"]))' |grep -v "./onionshare_cli" |grep -v -i "pyside2" |tr "\n" " ")
mv python3-modules.json onionshare.json
# use something like https://www.json2yaml.com/ to convert to yaml and update the manifest
# add all of the modules in both onionshare-cli and onionshare to the submodules of "onionshare"
2021-06-01 22:39:34 -04:00
# - poetry/generated-poetry-sources.json (onionshare-cli)
# - pip/python3-modules.json (onionshare)
2021-02-22 23:00:27 -05:00
```
Build and test the Flatpak package before publishing:
2020-11-08 17:49:24 -05:00
```sh
2021-02-22 23:00:27 -05:00
flatpak-builder build --force-clean --install-deps-from=flathub --install --user org.onionshare.OnionShare.yaml
flatpak run org.onionshare.OnionShare
2020-11-08 17:49:24 -05:00
```
2021-08-20 16:13:39 -04:00
Create a [single-file bundle ](https://docs.flatpak.org/en/latest/single-file-bundles.html ):
```sh
2021-08-20 17:13:44 -04:00
flatpak build-bundle ~/.local/share/flatpak/repo OnionShare-$VERSION.flatpak org.onionshare.OnionShare --runtime-repo=https://flathub.org/repo/flathub.flatpakrepo
2021-08-20 16:13:39 -04:00
```
2021-08-20 17:13:44 -04:00
Create a PGP signature for the flatpak single-file bundle:
```sh
gpg -a --detach-sign OnionShare-$VERSION.flatpak
```
Upload this `.flatpak` and its sig to the GitHub release as well.
2021-02-22 23:00:27 -05:00
### Update Homebrew
- Make a PR to [homebrew-cask ](https://github.com/homebrew/homebrew-cask ) to update the macOS version
### Update onionshare.org
- Upload all 10 files to https://onionshare.org/dist/$VERSION/
- Update the [onionshare-website ](https://github.com/micahflee/onionshare-website ) repo:
- Edit `latest-version.txt` to match the latest version
- Update the version number and download links
- Deploy to https://onionshare.org/
### Update docs.onionshare.org
- Upload everything from `docs/build/docs` to https://docs.onionshare.org/
### Update the community
2020-11-08 17:49:24 -05:00
- Upload all 10 files to the OnionShare team Keybase filesystem
- Email the [onionshare-dev ](https://lists.riseup.net/www/subscribe/onionshare-dev ) mailing list announcing the release
2021-02-22 23:00:27 -05:00
- Blog, tweet, toot, etc.