Schedule candidate release #1042
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Schedule candidate release | |
on: | |
# Scheduled for 10:00 PM PST | |
schedule: | |
- cron: "0 5 * * *" | |
workflow_dispatch: | |
inputs: | |
release-commit: | |
description: "Explicit commit to release at (overrides green commit check)" | |
required: false | |
default: "" | |
jobs: | |
tag_release: | |
name: "Tag candidate release" | |
runs-on: ubuntu-20.04 | |
steps: | |
- name: Checking out repository | |
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | |
with: | |
token: ${{ secrets.WRITE_ACCESS_TOKEN }} | |
fetch-depth: 0 | |
- name: Checkout the most recent green commit | |
id: last_green_commit | |
env: | |
GH_TOKEN: ${{ github.token }} | |
run: | | |
if [ -z "${{ github.event.inputs.release-commit }}" ]; then | |
release_commit="$(./build_tools/scripts/get_latest_green.sh)" | |
else | |
release_commit="${{ github.event.inputs.release-commit }}" | |
fi | |
git checkout "${release_commit}" | |
echo "release-commit=${release_commit}" >> "${GITHUB_OUTPUT}" | |
- name: Compute version | |
run: | | |
# common version + tag | |
package_version="$(python3 build_tools/python_deploy/compute_common_version.py -rc)" | |
tag_name="iree-${package_version}" | |
echo "package_version=${package_version}" >> $GITHUB_ENV | |
echo "tag_name=${tag_name}" >> $GITHUB_ENV | |
# legacy package version (for iree-tools-{tf,tflite}) | |
legacy_package_version="$(printf '%(%Y%m%d)T.${{ github.run_number }}')" | |
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)" | |
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)" | |
echo "runtime_package_version=${runtime_package_version}" >> $GITHUB_ENV | |
- name: Updating candidate tag | |
run: | | |
git tag "${tag_name}" | |
- name: Pushing changes | |
run: git push origin "${tag_name}" | |
- name: Create Release | |
id: create_release | |
uses: ncipollo/release-action@2c591bcc8ecdcd2db72b97d6147f871fcd833ba5 # v1.14.0 | |
with: | |
tag: ${{ env.tag_name }} | |
name: iree candidate ${{ env.tag_name }} | |
commit: ${{ steps.last_green_commit.outputs.release-commit }} | |
body: | | |
Automatic candidate release of iree. | |
draft: true | |
prerelease: true | |
token: ${{ secrets.WRITE_ACCESS_TOKEN }} | |
- name: "Invoke workflow :: Build Release Packages" | |
uses: benc-uk/workflow-dispatch@e2e5e9a103e331dad343f381a29e654aea3cf8fc # v1.2.4 | |
with: | |
workflow: Build Release Packages | |
token: ${{ secrets.WRITE_ACCESS_TOKEN }} | |
ref: "${{ env.tag_name }}" | |
inputs: | | |
{ | |
"package_suffix": "", | |
"legacy_package_version": "${{ env.legacy_package_version }}", | |
"package_version": "${{ env.package_version }}", | |
"compiler_package_version": "${{ env.compiler_package_version }}", | |
"runtime_package_version": "${{ env.runtime_package_version }}", | |
"release_id": "${{ steps.create_release.outputs.id }}", | |
"commit": "${{ steps.last_green_commit.outputs.release-commit }}" | |
} |