Skip to content
Jean-Christophe Fillion-Robin edited this page Nov 24, 2022 · 22 revisions

This page provides additional details for completing the steps tracked in the release issue template.

Announce release process in progress

In the Development category, create a new topic based on the following template:

  • Title:

    Release of Slicer X.Y in progress
    
  • Content:

    This evening, regular preview and stable builds of Slicer and associated extensions will be disabled in favor of a new stable release.
    
    To track the progress, see https://github.com/Slicer/Slicer/issues/1234
    

replacing

  • 1234 with the pinned release issue
  • X.Y with the major and minor version

Update "Release in progress" post

Update the existing topic in the Development category adding a reply based on the following template:

This evening, regular preview and stable builds of Slicer and associated extensions will be disabled in favor of a **patch** release.

Fixes to be integrated are listed in the [Slicer X.Y.Z](https://github.com/Slicer/Slicer/milestone/NNN?closed=1) milestone.

To track the progress, see https://github.com/Slicer/Slicer/issues/1234

<!--
Notes:
* Thanks to @contributor1, @contributor2 and @contributor3 for identifying and fixing the regressions :pray: 
* To avoid similar regressions, issues [#5678](https://github.com/Slicer/Slicer/issues/5678) has been created.
-->

replacing

  • 1234 with the pinned release issue
  • NNN with the milestone associated with the patch release
  • X.Y.Z with the major, minor and patch version

and uncommenting & updating the Notes section.

Enable or disable regular nightly builds

On each factory machines, regular nightly builds may be disabled or re-enabled through crontab or task scheduler.

CMakeLists.txt: Update the Slicer version information for the release

  • Checkout the branch

    git fetch origin
    
    # for release
    git checkout main
    git reset --hard origin/main
    
    # for patch release
    git checkout ${X}.${Y}
    git reset --hard origin/${X}.${Y}
  • In CMakeLists.txt, update at least one these variables: Slicer_VERSION_MAJOR, Slicer_VERSION_MINOR, Slicer_VERSION_PATCH

  • Re-run CMake with -DSlicer_RELEASE_TYPE:STRING=Stable. This is required to update Utilities/Scripts/SlicerWizard/version.py.

  • Set variables:

    X=<major-version>
    Y=<minor-version>
    Z=<patch-version>
    echo "X.Y.Z is ${X}.${Y}.${Z}"
  • Commit the above changes:

    git add CMakeLists.txt Utilities/Scripts/SlicerWizard/__version__.py
    git commit -m "ENH: Slicer ${X}.${Y}.${Z}"
  • For patch release, verify and push the changes:

    git push origin "${X}.${Y}"

Tag the repository

  • Set variables:

    X=<major-version>
    Y=<minor-version>
    Z=<patch-version>
    echo "X.Y.Z is ${X}.${Y}.${Z}"
    
    GIT_TAG=v${X}.${Y}.${Z}
    echo "GIT_TAG is ${GIT_TAG}"
  • Checkout the branch

    git fetch origin
    
    # for release
    git checkout main
    git reset --hard origin/main
    
    # for patch release
    git checkout ${X}.${Y}
    git reset --hard origin/${X}.${Y}
  • Create and push the tag

    git tag -s -m "ENH: Slicer ${X}.${Y}.${Z}" ${GIT_TAG}
    git push origin ${GIT_TAG}

CMakeLists.txt: Update the Slicer version information for the development

  • In CMakeLists.txt

    • update at least one these variables: Slicer_VERSION_MAJOR, Slicer_VERSION_MINOR, Slicer_VERSION_PATCH
    • update variable _commit_count_offsets allocating revisions for patch releases
  • Re-run CMake with -DSlicer_RELEASE_TYPE:STRING=Experimental. This is required to update Utilities/Scripts/SlicerWizard/version.py.

  • Set variables:

    X=<major-version>
    Y=<minor-version>
    Z=<patch-version>
    echo "X.Y.Z is ${X}.${Y}.${Z}"
  • Commit the above changes:

    git add CMakeLists.txt Utilities/Scripts/SlicerWizard/__version__.py
    git commit -m "ENH: Begin ${X}.${Y}.${Z} development"
  • Verify and push the changes

    git push origin main

Tag and publish SlicerBuildEnvironment docker image

Create maintenance branch

  • Set variables:

    X=<major-version>
    Y=<minor-version>
    echo "X.Y is ${X}.${Y}"
    
    GIT_TAG=v${X}.${Y}.0
    echo "GIT_TAG is ${GIT_TAG}"
  • Create and push the branch:

    git checkout -b ${X}.${Y} ${GIT_TAG}
    git push origin ${X}.${Y}

Update release scripts

See https://github.com/Slicer/DashboardScripts#maintenance-guides

Update ExtensionsIndex

  • Create branch X.Y based on main:

    DEST_VERSION=X.Y
    
    cd /tmp
    git clone git@github.com:Slicer/ExtensionsIndex 
    cd ExtensionsIndex
    git checkout main
    git push origin main:${DEST_VERSION}

Generate application and extension packages

Generate packages running Slicer package scripts on each factory machines. These are the scripts updated in Update release scripts section.

Create release or patch release on slicer-packages.kitware.com

The steps described below applies to both releases and patch releases and are expected to be performed using an API key with scope set to Full access.

  • Install the python client

    cd /tmp
    py=$(which python3 || which python)
    $py -m venv slicer_release
    source slicer_release/bin/activate
    pip install wheel 
    pip install slicer-package-manager-client
    
  • Create release or patch release

    Copy the script below a text editor replacing <placeholder> with their expected value. <revision> corresponds to the revision based on "CommitCount" (e.g 30893 is the revision for release 5.0.3. for list of revisions, see the Release-Details wiki page.)

    GIRDER_TOKEN_SLICER_PACKAGES_KITWARE_COM=<token>
    
    X=<major-version>
    Y=<minor-version>
    Z=<patch-version>
    echo "X.Y.Z is ${X}.${Y}.${Z}"
    
    REVISION=<revision>
    echo "REVISION is ${REVISION}"
    
    GIRDER_API_KEY=${GIRDER_TOKEN_SLICER_PACKAGES_KITWARE_COM} \
    slicer_package_manager_client \
      --api-url https://slicer-packages.kitware.com/api/v1 release create \
        Slicer ${X}.${Y}.${Z} ${REVISION}
    

Copy draft application & extension packages into the new release folder

  • Open the Girder UI, go to Applications/packages/Slicer/draft

  • Look for the specific application revision folder under the draft.

    💡 You may have to Click on Show more folders... until the expected <revision> folder appears.

  • Toggle the checkboxes for the three application packages and the extensions folder.

  • Select all the element contained in this folder by using the Pick all checked resources for Copy or Move action

  • Go to the new release folder and use the Copy picked resources here action.

Upload signed release packages

  • Go to the new release folder.

  • For the relevant Slicer_<os>_<arch>_<revision> items, replace the content by uploading the signed release packages.

    💡 The "Replace file content" action is available in the "Files & links".

Update external websites

  • https://en.wikipedia.org/wiki/3DSlicer
    • Edit page updating version and release date. Consider specifying an Edit Summary like Update latest revision to X.Y.Z. See this page for details: https://github.com/Slicer/Slicer/wiki/Release-Details

      See here for an example.

    • Review page (list of external dependencies, ... ) and edit as needed.

Update ExtensionStats module

  • Checkout SlicerDeveloperToolsForExtensions repository.

    cd /tmp
    git clone git@github.com:Slicer/SlicerDeveloperToolsForExtensions.git
  • Add an entry to the releases_revisions list in ExtensionStats/ExtensionStats.py.

    X=<major-version>
    Y=<minor-version>
    Z=<patch-version>
    echo "X.Y.Z is ${X}.${Y}.${Z}"
    
    REVISION=<revision>
    echo "REVISION is ${REVISION}"
    
    cd /tmp/SlicerDeveloperToolsForExtensions
    sed -i "/^      # NEXT RELEASE REVISION/i \ \ \ \ \ \ '${X}.${Y}.${Z}': '${REVISION}'," ExtensionStats/ExtensionStats.py
    git diff
  • Create the branch and commit.

    git checkout -b add-release-${X}.${Y}.${Z}-revision
    
    git add ExtensionStats/ExtensionStats.py
    
    git commit -m "ExtensionStats: Add Slicer ${X}.${Y}.${Z}
    
    See https://github.com/Slicer/Slicer/wiki/Release-Details#slicer-${X}${Y}${Z}"