發佈過程

發布新版本

這些步驟會根據您所推送的發佈類型 (主要、次要或補丁) 的不同而略有變化。

發佈新的補丁版本(例如:從 0.28.1 到 0.28.2)

  1. 挑選所有需要的更新到 -stable 分支(例如:0.28 版本的 0.28-stable
  2. 確認您的本地端位於 -stable 分支
  3. 執行 npm version patch 跳動版本編號,並建立 Git 提交(commit)和標籤
  4. 執行 git push origin 0.xx-stable --follow-tags(將 0.xx-stable 改為正確的分支名稱)

發佈新的主要或次要版本(例如:從 0.28.x 到 0.29.0)

  1. 確保目前的 master 分支通過在 CircleTravisAppVeyor 的測試。
  2. 確認您位於主幹(master),且本地的 Yarn 複本是最新的
  3. 執行 ./scripts/release-branch.sh. 這將會:
    • 建立 0.xx-stable 分支和 0.xx.0 標籤
    • master 跳到下個次要版本(例如:在發佈 0.29.0 之後主幹會跳至 0.30.0
    • 推送所有內容至 origin

To mark an RC release as stable

Once an RC has been tested by the community for a while and all major bugs have been ironed out, it can be marked as stable. To do this, go to https://release.yarnpkg.com/ and click the “Promote RC to stable” button.

Note: There is a whitelist for the users that are able to access this page. If a maintainer is missing from the whitelist, you can modify it here.

Debugging a release

Sometimes things go wrong. Here’s how to debug some common issues:

I’ve committed the tag but the site still points to the old version

Check the GitHub release for any missing artifacts. The release scripts do not bump the version number on the site until both the Linux and the Windows artifacts have been attached to the release.

Linux artifacts (.tar.gz, .deb, etc.) are missing

Check the CircleCI build and re-run it if it has failed. If the build succeeded, check the webhook logs for any errors.

Windows artifacts (.msi) are missing

Check the AppVeyor build and re-run it if it has failed. If the build succeeded, check the webhook logs for any errors.

All artifacts are attached to release, but site still points to old version

Check the yarn-version Jenkins build job and see whether it has failed.


How to do it manually

Most of the release has been automated and is fairly straightforward. Normally, you can just stop reading here. However, if the release tooling ever breaks (or if you like doing things the hard way), you can manually perform the release steps.

Creating a new release

  1. Run yarn build-dist && yarn build-deb to build the release tarball, Debian package, and RPM package
  2. Run yarn build-dist && yarn build-win-installer on Windows to build the Windows installer
  3. GPG sign the .tar.gz and .js artifacts: sh gpg -u 9D41F3C3 –armor –detach-sign yarn-0.xx.xx.tar.gz This will generate

    .asc files that you should also attach to the release

  4. Authenticode sign the .msi artifacts: sh osslsigncode sign -t http://timestamp.digicert.com -n “Yarn Installer” -i https://yarnpkg.com/ -pkcs12 yarn-20161122.pfx -readpass yarn-20161122.key -h sha1 -in yarn-0.xx.xx-unsigned.msi -out yarn-0.xx.xx.msi osslsigncode sign -t http://timestamp.digicert.com -n “Yarn Installer” -i https://yarnpkg.com/ -pkcs12 yarn-20161122.pfx -readpass yarn-20161122.key -nest -h sha2 -in yarn-0.xx.xx.msi -out yarn-0.xx.xx.msi

  5. Create new release on GitHub, and attach all artifacts. For the MSI, ensure you attach the signed version!
  6. Publish the tarball to npm: npm publish ./artifacts/yarn-v0.xx.xx.tar.gz
  7. Perform post-release steps below

Bumping RC to stable

  1. Modify GitHub release to mark it as stable
  2. Run npm dist-tag add yarn@0.xx.xx latest (where 0.xx.xx is the version number being released)
  3. Run post-release steps below

Post-release

  1. Bump version number in _config.yml on the website
  2. Run ./scripts/build-chocolatey.ps1 to push to Chocolatey
  3. Run ./scripts/update-homebrew.sh to push to Homebrew
  4. Debian 和 CentOS 倉庫應該會在5分鐘内自動更新到最新版本(注意the commits