Skip to content

Nightly Staging Release #224

Nightly Staging Release

Nightly Staging Release #224

name: Nightly Staging Release
on:
schedule:
- cron: "0 10 * * *"
workflow_dispatch:
inputs:
permissions:
contents: write
concurrency:
# A PR number if a pull request and otherwise the commit hash. This cancels
# queued and in-progress runs for the same PR (presubmit) or commit
# (postsubmit). The workflow name is prepended to avoid conflicts between
# different workflows.
group: ${{ github.workflow }}-${{ github.event.number || github.sha }}
cancel-in-progress: true
jobs:
setup:
name: Setup
runs-on: ubuntu-latest
outputs:
version_spec: ${{ steps.compute_version.outputs.version_spec }}
package_suffix: ${{ steps.compute_version.outputs.package_suffix }}
package_version: ${{ steps.compute_version.outputs.package_version }}
tag_name: ${{ steps.compute_version.outputs.tag_name }}
release_id: ${{ steps.create_release.outputs.id }}
release_upload_url: ${{ steps.create_release.outputs.upload_url }}
steps:
- name: Checking out repository
uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
fetch-depth: 0
- name: Compute version
id: compute_version
run: |
version_spec="$(printf '%(%Y%m%d)T.${{ github.run_number }}')"
package_suffix="nightly-staging"
package_version="nightly-staging-${version_spec}"
tag_name="${package_version}"
echo "version_spec=${version_spec}" >> $GITHUB_ENV
echo "version_spec=${version_spec}" >> $GITHUB_OUTPUT
echo "package_suffix=${package_suffix}" >> $GITHUB_ENV
echo "package_suffix=${package_suffix}" >> $GITHUB_OUTPUT
echo "package_version=${package_version}" >> $GITHUB_ENV
echo "package_version=${package_version}" >> $GITHUB_OUTPUT
echo "tag_name=${tag_name}" >> $GITHUB_ENV
echo "tag_name=${tag_name}" >> $GITHUB_OUTPUT
- name: Updating release tag
run: |
git tag "${tag_name}"
git push origin "${tag_name}"
- name: Create Release
id: create_release
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ env.tag_name }}
release_name: ${{ env.tag_name }}
body: |
Automatic nightly release of ROCM staging branches.
draft: true
prerelease: true
build_linux_packages:
name: Build Linux Packages
needs: setup
uses: ./.github/workflows/build_linux_packages.yml
with:
package_version: ${{ needs.setup.outputs.package_version }}
build_python_packages:
name: Build Python Packages
needs: setup
uses: ./.github/workflows/build_python_packages.yml
with:
version_spec: ${{ needs.setup.outputs.version_spec }}
package_suffix: ${{ needs.setup.outputs.package_suffix }}
upload_release_assets:
name: Upload Release Assets
needs: [setup, build_linux_packages, build_python_packages]
runs-on: ubuntu-latest
steps:
- name: Checking out repository
uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
fetch-depth: 0
- name: Download Linux Artifacts
uses: actions/download-artifact@v4
with:
path: linux-x86_64
pattern: TheRock-*-linux-x86_64-*
merge-multiple: true
- name: List Files
run: |
ls -l linux-x86_64
- name: Upload Release Assets
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release upload ${{ needs.setup.outputs.tag_name }} \
linux-x86_64/*
# While most testing fans out to various runners, we do some light
# verification that the binaries work at all here. This could be done
# elsewhere but gives a light sanity check that things are well-formed.
- name: Verify Python Packages
run: |
cd linux-x86_64
pip install -f . TheRock-runtime-nightly-staging
python -m therock.test_dist
finalize_release:
name: Finalise Release
# TODO: Add testing jobs to needs
needs: [setup, upload_release_assets]
runs-on: ubuntu-latest
steps:
- name: Checking out repository
uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
fetch-depth: 0
- name: Mark Release Non Draft
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release edit ${{ needs.setup.outputs.tag_name }} --draft=false