Skip to content

Releases

JZ edited this page Dec 13, 2024 · 29 revisions

Release process, dogfooding and then release

These notes need some revision, but the idea is there. Some of the points from the lutev2 making_a_release.md need to be pulled in here as well.

NOTE: go through the beta steps, even if not releasing a beta, as there may be important things to double-check.


Part 1: release beta from develop

On the develop branch

inv db.reset
inv db.export.baseline
git add lute/db/schema/baseline.sql
git commit -m "Re-baseline."

inv full   # If necessary
git push origin develop

Ensure all tests pass:

gh run list -b develop -L 5   # check branch status, last 5 runs only

Determine if need to bump minor version number

Lute versions are x.y.z format. y should change if there is a db schema change. To check:

git diff $OLD_VERSION...HEAD --stat -- lute/db/schema/migrations

create beta commit x.y.z.b1 and tag (no changelog), push to pypi

Still on develop:

VERSION=$(python -c "import lute; print(lute.__version__)")
if [[ "$VERSION" == *"b"* ]]; then
   echo "$VERSION  (beta confirmed)"
else
   echo "MISSING b, please fix"
   exit 1
fi
git add lute/__init__.py
git commit -m "Beta release ${VERSION}"
git tag $VERSION HEAD
git push origin $VERSION
git push origin develop

flit publish --repository pypi

echo "Pushed beta:"
echo $VERSION

pull pypi into prod environment, dogfood

Go to prod environment:

# Ctl-C prod env -

# Set the version to beta
VERSION=

# Update
echo "Pulling version ${VERSION}"
pip install lute3==${VERSION}
python -m lute.main --config ./config.yml

Part 2: release from beta or develop tag

Check out the beta tag as a release branch?

BETATAG=
git checkout $BETATAG -b release_${BETATAG}
git log HEAD..master --oneline    # check for hotfixes

Determine next version number.

Lute versions are x.y.z format. y should change if there is a db schema change. To check:

git tag --list | tail -n 2
OLD_VERSION=?

git diff $OLD_VERSION...HEAD --stat -- lute/db/schema/migrations

Bump version (don't commit), generate the change log

Version is in lute/__init__.py

VERSION=$(python -c "import lute; print(lute.__version__)")
if [[ "$VERSION" == *"b"* ]]; then
   echo "STILL HAS b(eta), please fix"
   exit 1
else
   echo "Version ${VERSION}"
fi

./utils/dump_changelog.sh $OLD_VERSION

Edit the change log, then

git add docs/CHANGELOG.md
git commit -m "Changelog."

Commit, make pypi releases

git add -u
git commit -m "Version ${VERSION}"

git tag $VERSION HEAD
git push origin $VERSION
flit publish --repository pypi

git checkout master
git merge $VERSION
git push origin master

git checkout develop
git merge master
git push origin develop

# Done.

You may also need to release some plugins

Build Docker images

Docker images are built using source code (and flit dependency installs).

Start Docker Desktop (need for buildx), then:

./docker/build_all.sh

Verifying releases (optional??)

Pip

NOTE this pip test will use the default database (as determined by PlatformDirs).

deactivate

mkdir -p ../lute-v3-${VERSION}
pushd ../lute-v3-${VERSION}
python3 -m venv .venv
source .venv/bin/activate

echo
echo "Pulling version ${VERSION}"
pip install lute3
python -m lute.main
# check
# Ctl-C
deactivate

popd
source .venv/bin/activate

Docker

In a testing folder, create the following docker-compose.yml:

version: '3.9'
services:
  lute:
    image: jzohrab/lute3:latest
    # image: testlocal:latest
    ports:
      - 5000:5000
    volumes:
      - ./data:/lute_data
      - ./backups:/lute_backup

Then

docker compose pull
docker compose up
# verify, then Ctl-C

Publicize and wrap up