# New Release Procedure

The following documents the standard procedure for packaging a new release of
farmOS. It is used by the [maintainers] to ensure that all the necessary steps
are taken.

## Preparation

* Make sure Drupal core version is up-to-date (eg: [farmOS/farmOS@d682318]).
    * Evaluate whether or not any core patches are still necessary, and remove
      them if not (eg: [farmOS/farmOS@028dc18]).
* Make sure all contrib modules are up-to-date (e.g. [farmOS/farmOS@d831fef])
    * If any updated contrib modules are patched in farmOS, evaluate whether or
      not the patch is still necessary (e.g. [farmOS/farmOS@7d2e30a])
* Ensure that the [7.x-1.x Build Test GitHub Action] is building successfully.
* Ensure that the [7.x-1.x Docker Hub image] is building successfully.
* Test all update hooks
* Test fresh Drush make build and installation

## Release procedure

* Create a "Prepare for release of farmOS [version tag]." commit that updates
  the farmOS version references:
    * Update the commented `projects[farm][version]` line in `build-farm.make`.
    * Update the commented `FARMOS_VERSION` line in `docker/Dockerfile`.
    * Update `image` in `docker/docker-compose.production.yml`.
* Create a release commit "farmOS [version tag]." (with period) that does the
  following:
    * In `build-farm.make`:
        * Un-comment `projects[farm][version]`.
        * Comment `projects[farm][download][*]` (3 lines).
    * In `docker/Dockerfile`:
        * Un-comment `FARMOS_VERSION` for the new tag.
        * Comment `FARMOS_VERSION` for the development release.
* Tag the release commit in Git.
* Create a `git revert HEAD` commit that reverts the release commit (swaps the
  commented lines back so that development version are used).
* Push the tag and revert commits to drupal.org and GitHub.
* Create a release node in drupal.org (e.g. [7.x-1.1]) with release notes that
  include:
    * **farmOS updates** - Brief descriptions in HTML list form (copying commit
      messages is a good way to do this, but very minor changes can be
      excluded).
    * **Drupal core updates** - Link(s) to core release notes.
    * **Contrib updates** - Link(s) to project release notes.
    * **Patches** - List any new patches that were applied to core or contrib.
    * **Docker updates** - Any updates that are relevant to hosting farmOS in
      Docker.
    * **Bug fixes** - Brief descriptions of bugs that were fixed.
* Close the roadmap for this release and open a new one. Move any outstanding
  issues to the new one.
* Update Drupal.org [farmOS project page] to point to the new recommended
  release.
* Edit Github release tag (eg: [7.x-1.1 tag]):
    * Add a link to the drupal.org release node (eg: "For full release notes,
      see: https://www.drupal.org/project/farm/releases/7.x-1.1").
    * Upload the packaged tar.gz file generated by drupal.org.
* Update Docker Hub's `latest` image to point to the new release tag.

## Announce

* [farmOS Forum] (eg:
  [https://farmos.discourse.group/t/farmos-1-2-has-been-released/50])
* [Twitter @farmOSorg] (eg:
  [https://twitter.com/farmOSorg/status/1118981883101052929])
* [OpenCollective farmOS] (eg:
  [https://opencollective.com/farmos/updates/farmos-1-1-has-been-released])

[maintainers]: /community/maintainers
[farmOS/farmOS@d682318]: https://github.com/farmOS/farmOS/commit/d682318fa484a9aab7329bd8f9ebd338dd21dac1
[farmOS/farmOS@028dc18]: https://github.com/farmOS/farmOS/commit/028dc18af52fb137617db6bd8df5006238ca9fb6
[farmOS/farmOS@d831fef]: https://github.com/farmOS/farmOS/commit/d831fef9900a75050a4b18e1c8ed9599ef4d82c9
[farmOS/farmOS@7d2e30a]: https://github.com/farmOS/farmOS/commit/7d2e30a9d9e69baa508c3dddb4d79c68b0fc7120
[7.x-1.x Build Test GitHub Action]: https://github.com/farmOS/farmOS/actions
[7.x-1.x Docker Hub image]: https://hub.docker.com/r/farmos/farmos/builds
[7.x-1.1]: https://www.drupal.org/project/farm/releases/7.x-1.1
[farmOS project page]: https://drupal.org/project/farm
[7.x-1.1 tag]: https://github.com/farmOS/farmOS/releases/tag/7.x-1.1
[farmOS Forum]: https://farmOS.discourse.group
[https://farmos.discourse.group/t/farmos-1-2-has-been-released/50]: https://farmos.discourse.group/t/farmos-1-2-has-been-released/50
[Twitter @farmOSorg]: https://twitter.com/farmOSorg
[https://twitter.com/farmOSorg/status/1118981883101052929]: https://twitter.com/farmOSorg/status/1118981883101052929
[https://opencollective.com/farmos/updates/farmos-1-1-has-been-released]: https://opencollective.com/farmos/updates/farmos-1-1-has-been-released
[OpenCollective farmOS]: [https://opencollective.com/farmOS

