crystal-lang / distribution-scripts

40 stars 24 forks source link

Release Crystal 1.13.0 #316

Closed straight-shoota closed 3 months ago

straight-shoota commented 5 months ago

Release preparation

  1. [x] Announce expected release date and time span for feature freeze
    • Feature freeze is about two weeks before release
    • Set date on milestone
  2. [x] Ensure distribution-scripts are up to date (./scripts/update-distribution-scripts.sh)
  3. [x] Prepare the changelog entry: crystal:scripts/github-changelog.cr
  4. [x] Start preparing release notes
  5. [x] Start feature freeze period
    • Either no merging of features into master or split off release branch for backporting bugfixes.
  6. [x] Publish release PR draft
    • It should contain the expected date of the release.
    • It should be populated with updates to CHANGELOG.md, src/VERSION and shard.yml.
  7. [x] Ensure documentation for language and compiler changes and other relevant changes is up to date.
  8. [x] Ensure that test-ecosystem functions and succeeeds on master

Release process

Source release

  1. [x] Finalize the release PR
    • Make sure all changes are mentioned in the changelog
    • Check release date
    • Un-draft the PR
  2. [x] Split off release branch (release/x.y)
  3. [x] Verify Maintenance CI workflow succeeds on the HEAD of the release branch
  4. [ ] Smoke test with test-ecosystem
  5. [x] Merge the release PR
  6. [x] Make the release and publish it on GitHub: ../distribution-scripts/processes/scripts/make-crystal-release.sh (run from crystallang/crystal@$VERSION work tree). This performs these steps:
    1. Tag & annotate the commit with the changelog using <M.m.p> pattern as version
      • git tag -s -a -m $VERSION $VERSION
      • git push --tags
    2. Publish Github release (https://github.com/crystal-lang/crystal/releases/new)
      • Copy the changelog section as description
      • Binaries are added later
  7. [x] Close milestone (https://github.com/crystal-lang/crystal/milestones)
  8. [x] Wait for the release build in circle CI (https://app.circleci.com/pipelines/github/crystal-lang/crystal)

Binary releases

  1. Publish build artifacts from CircleCI and GitHub Actions to GitHub release. For URL_TO_CIRCLECI_ARTIFACT grab the URL of any of the build artifacts in circleCI (doesn't matter which).
  2. [x] Push changes to OBS for building linux packages
    1. Checkout https://github.com/crystal-lang/distribution-scripts and go to ./packages
    2. Configure build.opensuse.org credentials in environment variables:
      • export OBS_USER=
      • export OBS_PASSWORD=
    3. Update the crystal package: ./obs-release.sh devel:languages:crystal crystal $VERSION
      • Uses the docker image crystallang/osc to run the CLI client for OBS.
      • The script creates a branch in you home project, updates the version and pushes it back to OBS.
      • You can also run the commands from that file manually and check build locally with
        • osc build xUbuntu_20.04 x86_64
        • osc build Fedora_Rawhide x86_64
    4. Create the crystal${VERSION%.*} package: ./obs-new-minor.sh devel:languages:crystal crystal${VERSION%.*} $VERSION crystal${OLD_VERSION%.*}
    5. Now OBS builds the packages. It’s best to follow the build status in the browser:
      1. open https://build.opensuse.org/project/show/home:$OBS_USER:branches:devel:langauges:crystal/crystal
      2. Wait for all package build jobs to finish and succeed
    6. When everything is green, create a submit request against the original packages (Submit package link in the menu bar on the package in your branch)
    7. Verify package installation
      • OBS_PROJECT=devel:languages:crystal bats test
  3. [x] Tag latest docker images
    • Versioned docker images have been pushed to dockerhub.
    • Now just assign the latest tags:
    • ./docker/apply-latest-tags.sh ${VERSION}
  4. [x] Publish snap package (you can use the docker image snapcore/snapcraft for running the following commands)
    1. docker run --pull=always --rm -it snapcore/snapcraft
    2. You need to logged in via snapcraft login
    3. Recent tagged release is published directly to edge channel. The CI logs the snap revision number. Otherwise the .snap file is in the artifacts.
    4. Check the current status to find the revision of the tagged release otherwise:
    5. snapcraft status crystal
    6. snapcraft release crystal <revision-number> beta
    7. snapcraft release crystal <revision-number> stable
  5. [x] Check PR for homebrew: https://github.com/Homebrew/homebrew-core/pulls?q=is%3Apr+crystal+sort%3Aupdated-desc
    • It should've been automatically created

Publish documentation for the release

  1. [x] Publish API docs
    1. Have AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY env variables defined
    2. Run make -C docs publish_docs dist-redirect_latest CRYSTAL_VERSION=${VERSION} to publish docs to api/${VERSION} and apply redirect from api/latest to api/${VERSION}
  2. [x] Publish Crystal book
    1. Create release/${VERSION%.*} branch and push it to crystal-lang/crystal-book (deployment happens automatically in GHA)
    2. Verify that deployment was successfull

Release announcements

  1. [x] Publish release notes on the website: https://github.com/crystal-lang/crystal-website/pull/801
  2. [x] Post announcement in https://forum.crystal-lang.org/c/news/official
  3. [x] Announce on social media accounts (via Buffer; credentials are in Passbolt) and pin release posts
  4. [ ] Update https://github.com/crystal-lang/crystal-book/blob/master/crystal-version.txt
  5. [x] Post the release in https://opencollective.com/crystal-lang

Post-release

  1. [ ] Update crystal master branch to use released version: crystal:scripts/release-update.sh ${VERSION}
    • Edit PREVIOUS_CRYSTAL_BASE_URL in .circleci/config.yml
    • Edit DOCKER_TEST_PREFIX in bin/ci
    • Edit prepare_build on_osx download package and folder
    • Edit .github/workflows/*.yml to point to docker image
    • Edit shell.nix latestCrystalBinary using nix-prefetch-url --unpack <url>
  2. [ ] Increment src/VERSION and shard.yml to the next minor with -dev suffix
  3. [ ] Perform uncomment/todos left in the repo
  4. [ ] Update default base version in test-ecosystem: test-ecosystem:scripts/release-update.sh ${VERSION}
  5. [ ] Merge release/${VERSION%.*} branch into master (if the two have diverged)
    • This needs to be a merge commit. Those are disabled in the GitHub UI.
    • git switch master && git pull && git merge release/${VERSION%.*}; git checkout master src/VERSION && git add src/VERSION && git commit
    • Double check merge commit history is as expected
    • git push (GitHub branch protection rules normally prevent direct pushes to master. This needs to be deactivated for this purpose, which can be on a per-user basis.)