Skip to content

Commit

Permalink
Enable creating patch releases (#19467)
Browse files Browse the repository at this point in the history
* Allow to parameterize the build type
* Add documentation on how to create a patch release

Patch releases are _stable_ releases which can be build via the _Oneshot
candidate release_ workflow.

If the build version to produce is not `rc`, no `rcYYYYMMDD` suffix is
appended to the version number. Therefore, the version string printed
via `iree-compiler --version` for a `stable` release differs from a
release candidate which is later promoted to a stable release.

Co-authored-by: Scott Todd <[email protected]>
  • Loading branch information
marbre and ScottTodd authored Dec 11, 2024
1 parent 52ce3d3 commit 3c07dce
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 3 deletions.
28 changes: 25 additions & 3 deletions .github/workflows/oneshot_candidate_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@ name: Oneshot candidate release

on:
workflow_dispatch:
inputs:
build_type:
description: The type of build version to produce ("stable", "rc", or "dev")
type: string
default: "rc"

jobs:
tag_release:
Expand All @@ -13,12 +18,29 @@ jobs:
with:
token: ${{ secrets.WRITE_ACCESS_TOKEN }}

# Compute version suffix based on inputs (default to 'rc')
- name: Compute stable version suffix
if: ${{ inputs.build_type == 'stable' }}
run: |
version_suffix=""
echo "version_suffix=${version_suffix}" >> $GITHUB_ENV
- name: Compute rc version suffix
if: ${{ inputs.build_type == 'rc' || inputs.build_type == '' }}
run: |
version_suffix="$(printf 'rc%(%Y%m%d)T')"
echo "version_suffix=${version_suffix}" >> $GITHUB_ENV
- name: Compute dev version suffix
if: ${{ inputs.build_type == 'dev' }}
run: |
version_suffix=".dev0+${{ github.sha }}"
echo "version_suffix=${version_suffix}" >> $GITHUB_ENV
- name: Compute version
run: |
git fetch --depth=1 origin +refs/tags/*:refs/tags/*
# common version + tag
package_version="$(python3 build_tools/python_deploy/compute_common_version.py -rc)"
package_version="$(python3 build_tools/python_deploy/compute_common_version.py --version-suffix=${version_suffix})"
tag_name="iree-${package_version}"
echo "package_version=${package_version}" >> $GITHUB_ENV
echo "tag_name=${tag_name}" >> $GITHUB_ENV
Expand All @@ -28,11 +50,11 @@ jobs:
echo "legacy_package_version=${legacy_package_version}" >> $GITHUB_ENV
# iree-base-compiler version
compiler_package_version="$(python3 build_tools/python_deploy/compute_local_version.py compiler -rc)"
compiler_package_version="$(python3 build_tools/python_deploy/compute_local_version.py compiler --version-suffix=${version_suffix})"
echo "compiler_package_version=${compiler_package_version}" >> $GITHUB_ENV
# iree-base-runtime version
runtime_package_version="$(python3 build_tools/python_deploy/compute_local_version.py runtime -rc)"
runtime_package_version="$(python3 build_tools/python_deploy/compute_local_version.py runtime --version-suffix=${version_suffix})"
echo "runtime_package_version=${runtime_package_version}" >> $GITHUB_ENV
- name: Updating candidate tag
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
34 changes: 34 additions & 0 deletions docs/website/docs/developers/general/release-management.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,3 +81,37 @@ request that some feature make the cut.

3. Complete any remaining checkbox items on the release tracking issue then
close it and open a new one for the next release.

## Creating a patch release

1. Create a new branch.

Checkout the corresponding stable release and create a branch for the patch release:

```shell
git checkout iree-3.0.0
git checkout -b iree-3.0.1
```

2. Apply and commit the patches.

3. Set the patch level:

* Adjust `compiler/version.json` if patches are applied to the compiler.

* Adjust `runtime/version.json` if patches are applied to the runtime.

4. Push all changes to the new branch.

5. Trigger the
[_Oneshot candidate release_ workflow](https://github.com/iree-org/iree/actions/workflows/oneshot_candidate_release.yml)
to create a release.

* Select to run the workflow from the patch branch.

* Set the type of build version to produce to "stable".

![one_shot_patch](./one-shot-patch.png)

6. Follow the documentation above to promote to stable.
The step to create a new tag can be skipped.

0 comments on commit 3c07dce

Please sign in to comment.