| 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: | |
| name: "Tag candidate release" | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - name: Checking out repository | |
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| 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 --version-suffix=${version_suffix})" | |
| 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 --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 --version-suffix=${version_suffix})" | |
| echo "runtime_package_version=${runtime_package_version}" >> $GITHUB_ENV | |
| - name: Updating candidate tag | |
| run: | | |
| git tag "${tag_name}" | |
| - name: Pushing changes | |
| uses: ad-m/github-push-action@881a6320fdb16eb5318c5054f31c218aec2b324c # v1.3.0 | |
| with: | |
| github_token: ${{ secrets.WRITE_ACCESS_TOKEN }} | |
| branch: ${{ github.ref_name }} | |
| tags: true | |
| - name: Create Release | |
| id: create_release | |
| uses: ncipollo/release-action@339a81892b84b4eeb0f6e744e4574d79d0d9b8dd # v1.21.0 | |
| with: | |
| tag: ${{ env.tag_name }} | |
| name: iree candidate ${{ env.tag_name }} | |
| 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@31e2b3319479a63f0ab15bf800eff9e913504e26 # v1.3.2 | |
| 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 }}" | |
| } |