-
Notifications
You must be signed in to change notification settings - Fork 3.3k
FlatBuffers release process
Steps to release a new version of FlatBuffers to github:
-
Update version in
include/flatbuffers/base.h
-
Update version in
CMake/Version.cmake
-
Update version-check in generated
include/flatbuffers/reflection_generated.h
This is needed because we have a catch-22 where we use this generated file within flatc, which makes that file. But it will complain that the flatbuffer libraries mismatch.
-
Update version-check in generated
tests/evolution_v1_generated.h
andtests/evolution_v2_generated.h
-
Update version in
pom.xml
-
Update version in
package.json
-
Update version in
net/flatbuffers/Google.FlatBuffers.csproj
-
Update version in
dart/pubspec.yaml
-
Update version in
python/flatbuffers/_version.py
See Python steps below to do it as part of the script
-
Find-Replace globally:
FlatBuffersVersion_Y_Y_Y
withFlatBuffersVersion_X_X_X
-
Find-Replace globally:
FLATBUFFERS_Y_Y_Y()
withFLATBUFFESR_X_X_X()
Note: Skip the one in
android/app/src/main/java
for now. -
Update version in
FlatBuffers.podspec
-
make clean
-
make -j
-
scripts/generated_code.py
-
Update
CHANGELOG.md
-
Make a git commit with a message:
FlatBuffers Version X.X.X
-
Go through the normal PR process to get the commit submitted
-
Generate an annotated tag for the release. Make sure this is done directly in the flatbuffer repo and not via a pull request.
git tag -a -m "Flatbuffers Version X.X.X" vX.X.X
-
Push the tag to github (again not via a PR).
git push origin vX.X.X
-
The result should be a tagged commit at the following: https://github.com/google/flatbuffers/tags
-
cd python
-
Set
VERSION
environment to version.bash:
export VERSION="X.X.X"
fish:
set -g -x VERSION X.X.X
-
python setup.py sdist
-
python setup.py bdist_wheel
-
Ensure twine in installed:
python3 -m pip install --upgrade twine
-
twine upload dist/flatbuffers-X.X.X.tar.gz
This will ask for your credentials for PyPi.
-
twine upload dist/flatbuffers-X.X.X-py2.py3-none-any.whl
-
Output should be on: https://pypi.org/project/flatbuffers/
-
Need
gpg
key installed in local keyring.-
gpg --import private.key
If this times out, its because its asking for a password and doesn't show it to you.
sudo apt install pinentry-tty
sudo update-alternatives --config pinentry
- Select the
pinentry-tty
option.
-
Set up
.m2/settings.xml
with
<settings> <servers> <server> <id>ossrh</id> <username>FILL ME IN</username> <password>FILL ME IN</password> </server> </servers> </settings>
-
-
In root directory run
mvn clean deploy -P release
This will publish the version and you cannot republish the same version. So it might be good to do a "snapshot" deplyoment by appending
-SNAPSHOT
to the version. -
It should prompt for your password during the signing stage.
-
It should eventually complete and show: https://search.maven.org/artifact/com.google.flatbuffers/flatbuffers-java
- Its sometimes advisable to set a
-beta.1
version innet/flatbuffers/Google.FlatBuffers.csproj
first, to make sure everything is working with the published package. Then repeat without the beta tag. cd net/flatbuffers
dotnet build Google.FlatBuffers.csproj -c Release
dotnet pack Google.FlatBuffers.csproj -c Release
dotnet nuget push .\bin\Release\Google.FlatBuffers.XXX.nupkg --api-key <API_KEY> --source https://api.nuget.org/v3/index.json
- Should appear here in a few minutes: https://www.nuget.org/packages/Google.FlatBuffers/
npm login
npm publish
- Should be live here relatively quickly: https://www.npmjs.com/package/flatbuffers
Rust (crates.io)
cd rust/flatbuffers/
- Verify
Cargo.toml
version cargo publish
- Change the version number in base.h, package.json, pom.xml (and various such files in grpc/), CMakeLists.txt (FlatBuffers_Library_SONAME_FULL), CMake/Version.cmake, dart/pubspec.yaml, rust/cargo.toml (not same as FlatBuffers version), Constants.java, FlatBufferConstants.cs, idl_gen_java/csharp/kotlin/swift.cpp
- re-build flatc
- runs generate_code.sh to ensure there's no missing files.
- And also because the version number is in some generated files.
- Also run SwiftTest.sh in tests/FlatBuffers.Test.Swift since it generates code (FIXME)
- ../../../../flatc --swift --grpc greeter.fbs in tests/FlatBuffers.GRPC.Swift/Sources/Model (FIXME)
- (search for 1.12 and 1_12 to be sure).
- push to github.
- Update the documentation remote branch
gh-pages
that hosts what is shown at http://google.github.io/flatbuffers/ using something like (warning, this will go live instantly):cd docs/source
doxygen
cd ../../.. (one up from flatbuffers root)
git clone -b gh-pages --single-branch https://github.com/google/flatbuffers.git gh-pages
cd gh-pages
cp -r ../flatbuffers/docs/html/* .
git add *
git commit
git push
cd ..
rm -rf gh-pages flatbuffers/docs/html
- Tag this release by version number, e.g.:
git tag -a -m "FlatBuffers release 1.0.0" v1.0.0
- git push yourgithubremotename v1.0.0
- On the github releases page, add a release description to this tag, with a description of what changed etc.
- Also add flatc binaries from the last CI run for win/lin/mac
- For JS:
- (version has already been changed in package.json)
- (on npm <4.0):
npm run append-esm-export
npm login
npm publish
- (note
npm adduser
needs a newer node than what's available on my machine?) - Check changes are on: https://www.npmjs.com/package/flatbuffers
- For Java:
- (version already changed in pom.xml)
mvn clean deploy -P release
- Not needed / working?
mvn release:clean release:prepare
mvn release:perform
- (see http://central.sonatype.org/pages/apache-maven.html for details).
- This requires an account with oss.sonatype.org, a gpg key registered with a keyserver, and your user/pass in .m2/settings.xml (Maven) to work, among other mysterious things.
- Note: some of the above commands tend to error out, since it is all some crazy async complex system.. but it will then succeed later anyway (shows up the new version on maven central).
- For gRPC:
- NOTE: since this depends on the main flatbuffers package, typically needs to wait until that is done uploading!
- in dir grpc,
mvn deploy
- May need a
mvn clean
first if it fails: https://github.com/google/flatbuffers/issues/5856
- For Dart:
- Run
cd dart && sh publish.sh
- Results here: https://pub.dev/packages/flat_buffers
- Run
- For Python:
cd python
export VERSION="1.9"
python setup.py sdist
python setup.py bdist_wheel
twine upload dist/flatbuffers-1.9.tar.gz
twine upload dist/flatbuffers-1.9-py2.py3-none-any.whl
rm -rf build
- See release on: https://pypi.org/project/flatbuffers/
- (more detail here: https://github.com/google/flatbuffers/issues/4507#issuecomment-396370441)
- For C#:
- Follow these steps for a first time release: https://docs.microsoft.com/en-us/nuget/quickstart/create-and-publish-a-package-using-the-dotnet-cli
- Then close https://github.com/google/flatbuffers/issues/4162