Warning
This manual is intended for OpenTofu core and fork maintainers. If you are looking for the normal contribution guide, see this file.
This manual describes how to create an OpenTofu release. OpenTofu has two kinds of releases. Alpha and Beta releases are created
from the main
branch, while we split off a version (e.g. v1.8
) branch before creating an rc
or stable
release.
- Alpha is an early preview release. This is versioned
X.Y.0-alphaW
, whereX
,Y
andW
are numbers, such as1.2.0-alpha1
. - Beta is a semi-stable preview release. This is versioned
X.Y.0-betaW
, whereX
,Y
andW
are numbers, such as1.2.0-beta1
. - RC is a release candidate which does not have new features over a beta. This is versioned
X.Y.0-rcW
, whereX
,Y
andW
are numbers, such as1.2.0-rc1
. - Stable is a release that has no new features and bug fixes over an RC. This is versioned
X.Y.0
, whereX
andY
are numbers, such as1.2.0
. - Point release is a release that contains bugfixes only on top of a stable release. This is versioned
X.Y.Z
whereX
,Y
andZ
are numbers, such as1.2.3
.
To create a release, make sure you have people on standby with the following credentials:
- Cloudflare
- PackageCloud
- Snapcraft
- X
Before you start creating a release, make sure you have the following marketing collaterals ready to be published:
- Feature Preview video for upcoming flagship features (see https://www.youtube.com/@opentofu for examples)
- "Help us test..." blog post (see https://opentofu.org/blog/ for examples)
- Community Slack announcement
- Linkedin and X posts
- "Get ready for..." blog post (see https://opentofu.org/blog/ for examples)
- Community Slack announcement
- Linkedin and X posts
- Release blog post with the feature and community highlights since the last release (see https://opentofu.org/blog/ for examples)
- Community Slack announcement
- Linkedin and X posts
Before you can create a release, you need to make sure the following files are up to date:
- CHANGELOG.md (Note: do not remove the
(unreleased)
string from the version number before the stable release.) - version/VERSION
Ideally, make sure these changes go in as the last PR before the release.
Now that you have the files up to date, do the following:
- On your computer, make sure you have checked out the correct branch:
main
foralpha
andbeta
releasesvX.Y
for any other releases (assuming you are releasing versionX.Y.Z
)
- Make sure the branch is up-to-date by running
git pull
- Create the correct tag:
git tag -m "X.Y.Z" vX.Y.Z
(assuming you are releasing versionX.Y.Z
)- If you have a GPG key, consider adding the
-s
option to create a GPG-signed tag
- If you have a GPG key, consider adding the
- Push the tag:
git push origin vX.Y.Z
Now comes the big step, creating the actual release.
- Head on over to the Actions tab on the main repository
- Select the
release
workflow on the left side - Click the
Run workflow
button, which opens a popup menu - Select the correct branch:
- For
alpha
releases, select themain
branch - For all other releases, select the appropriate version branch
- For
- Enter the correct git tag name:
vX.Y.Z
- If you are releasing the latest
X.Y
version, check theRelease as latest?
option. - If you are releasing an
alpha
,beta
orrc
version, check theRelease as prerelease?
option. - Click the
Run workflow
button.
Now the release process will commence and create a draft release on GitHub. If you did not check the prerelease option, it will also publish to Snapcraft and PackageCloud.
The release process takes about 30 minutes. When it is complete, head over to the Releases section of the main repository and find the new draft release. Change the following settings
- Edit the text (see the examples below).
- Check
Set as a pre-release
if you are releasing an alpha, beta, or release candidate. - Check
Set as the latest release
if you are releasing a stable or point release for the latest major version. Do not check this checkbox if you are releasing a point release for an older major version. - Check
Create a discussion for this release
if you are releasing a stable (X.Y.0
) version. - Click
Publish release
Create a text highlighting how users can test the new features, for example:
⚠️ Do not use this release for production workloads! ⚠️
It's time for the first prerelease of the 1.9.0 version! This includes a lot of major and minor new features, as well as a ton of community contributions!
The highlights are:
* **`for_each` in provider configuration blocks:** An alternate (aka "aliased") provider configuration can now have multiple dynamically-chosen instances using the `for_each` argument:
```hcl
provider "aws" {
alias = "by_region"
for_each = var.aws_regions
region = each.key
}
```
Each instance of a resource can also potentially select a different instance of the associated provider configuration, making it easier to declare infrastructure that ought to be duplicated for each region.
Create a more elaborate text explaining the flagship features of this release, ideally linking to the blog post and/or video for the release, for example:
We're proud to announce that OpenTofu 1.8.0 is now officially out! 🎉
## What's New?
* Early variable/locals evaluation
* Provider mocking in `tofu test`
* Resource overrides in `tofu test`
* Override files for OpenTofu: keeping compatibility
* Deprecation: `use_legacy_workflow` has been removed from the S3 backend-backend
See the launch post on our blog: https://opentofu.org/blog/opentofu-1-8-0/
For all the features, see the [detailed changelog](https://github.com/opentofu/opentofu/blob/v1.8.0/CHANGELOG.md).
You can find the full diff [here](https://github.com/opentofu/opentofu/compare/v1.7..v1.8.0).
For point releases, simply copy the section from the CHANGELOG.md file.
In order for the installer script to work, you will need to update the https://get.opentofu.org/tofu/api.json file. You can do this by logging in to Cloudflare and go to the opentofu-get
project in Cloudflare Pages. Here click the three dots on the latest production deployment and click Retry deployment
.
Depending on the release type, you will need to update the opentofu.org repository.
Before you begin, make sure that all submodules are up to date by running:
git submodule init
git submodule update
Warning
If you are using Windows, make sure your system supports symlinks by enabling developer mode and enabling symlinks in git.
We do not release documentation for non-stable releases. There is no action needed beyond publishing the blog post.
- Add a submodule for the new release to the website repository:
git submodule add -b vX.Y https://github.com/opentofu/opentofu opentofu-repo/vX.Y
- After you have done this, open the
docusaurus.config.ts
file andpresets
section. - Here, locate the previous latest version:
Change it to:
"vX.Y-1": { label: "X.Y-1.x", path: "", },
"vX.Y-1": { label: "X.Y-1.x", path: "vX.Y-1", banner: "none", },
- Now add the new version you are releasing:
"vX.Y": { label: "X.Y.x", path: "", },
- After this is set, change the
lastVersion
option to point to your version. - Now locate any version that is no longer supported and remove the following line to add a deprecation warning:
banner: "none",
- Finally, locate the
navbar
option andDocs
dropdown to reflect the new version list. It should look something like this:items: [ { label: "vX.Y.x (current)", href: "/docs/" }, { label: "vX.Y-1.x", href: "/docs/vX.Y-1/" }, // ... { label: "Development", href: "/docs/main/" }, ],
For a point release, you merely need to make sure that the submodules for the supported versions are up to date. You can do this by running the following script:
cd opentofu-repo
for ver in $(ls); do
cd "${ver}"
git pull origin "${ver}"
cd ..
git add "${ver}"
done
Now you can commit your changes and open a pull request.
Note: You can safely run the script above anytime you need to update the documentation independently of a release. It's ok for the website to have minor doc fixes that are not in line with OpenTofu releases.
Make sure you have a Linux box with Snapcraft installed and download the installer shell script from https://get.opentofu.org/install-opentofu.sh
.
Now test the following 3 installation methods to make sure all distribution points are up to date.
- Snapcraft (stable and point releases only):
sudo snap install opentofu --classic
tofu --version
sudo snap uninstall opentofu
- Deb (stable and point releases only)
./install-opentofu.sh --install-method deb
tofu --version
apt remove --purge tofu
- Standalone:
./install-opentofu.sh --install-method standalone --opentofu-version X.Y.Z
/usr/local/bin/tofu --version
sudo rm -rf /opt/opentofu /usr/local/bin/tofu
Once you are happy that the release works, post the announcements to the following places:
- Alpha: Community Slack, Linkedin, X, Blog, YouTube
- Beta: Community Slack, Linkedin, X, Blog
- Stable: Community Slack, Linkedin, X, Blog
- Point release: Community Slack