Back to Sonic

Packaging

PACKAGING.md

1.6.02.4 KB
Original Source

Packaging

This file contains quick reminders and notes on how to package Sonic.

We consider here the packaging flow of Sonic for Linux.

Requirements

It is highly recommended to install Task as it simplifies all maintenance operations thanks to hand-crafted helper tools. If you really don’t want to install it, we try our best to always provide alternatives. Check Taskfile.dist.yaml to see what task calls internally.

Releasing Sonic core (library)

  1. Make sure core/CHANGELOG.md is up to date (changes should be in the “Unreleased” section).
    • If not up-to-date, run task changelog:prepare -- core1 then follow the instructions.
  2. Run task release:core -- major|minor|path2, following Semantic Versioning.

CD pipelines will then publish the library on crates.io.

Check the “Actions” tab on GitHub to see the progress.

Releasing Sonic server (binary)

  1. If you made changes to the core, release it first. CD pipelines will take 6–10 minutes to run, you have to wait.

    If you don’t, cargo publish -p sonic-server will fail because it cannot find the version of sonic-core the server depends on. This will abort the entire CD pipeline and force you to manually fix your mess. You don’t want that.

  2. Make sure server/CHANGELOG.md is up to date (changes should be in the “Unreleased” section).

    • If not up-to-date, run task changelog:prepare -- server3 then follow the instructions.
  3. Run task release:server -- major|minor|path4, following Semantic Versioning.

CD pipelines will then build and release Sonic (server) on crates.io, GitHub, Docker Hub and Packagecloud.

Check the “Actions” tab on GitHub to see the progress.

Footnotes

  1. Alternative: ./scripts/changelog_prepare.sh core

  2. Alternative: ./scripts/make_release.sh core major|minor|path

  3. Alternative: ./scripts/changelog_prepare.sh server

  4. Alternative: ./scripts/make_release.sh server major|minor|path