Skip to content

Schedule candidate release #390

Schedule candidate release

Schedule candidate release #390

name: Schedule candidate release
on:
schedule:
- cron: "0 10 * * *"
workflow_dispatch:
jobs:
tag_release:
name: "Tag candidate release"
runs-on: ubuntu-18.04
# Don't run this in everyone's forks.
if: github.repository == 'iree-org/iree'
steps:
- name: Get the last green commit
id: last_green_commit
uses: talentpair/last-green-commit-action@8b4b3bcd4ab5d9ab16875ce20ae012c4ce47ae68
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Checking out repository
uses: actions/checkout@7884fcad6b5d53d10323aee724dc68d8b9096a2e # v2
with:
token: ${{ secrets.WRITE_ACCESS_TOKEN }}
ref: ${{ steps.last_green_commit.outputs.result }}
- name: Compute version
run: |
git fetch --depth=1 origin +refs/tags/*:refs/tags/*
package_version="$(printf '%(%Y%m%d)T.${{ github.run_number }}')"
tag_name="candidate-${package_version}"
echo "package_version=${package_version}" >> $GITHUB_ENV
echo "tag_name=${tag_name}" >> $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: actions/create-release@0cb9c9b65d5d1901c1f53e5e66eaf4afd303e70e # v1
env:
GITHUB_TOKEN: ${{ secrets.WRITE_ACCESS_TOKEN }}
with:
tag_name: ${{ env.tag_name }}
release_name: iree candidate ${{ env.tag_name }}
body: |
Automatic candidate release of iree.
draft: true
prerelease: true
- name: "Invoke workflow :: Build Native Release Packages"
uses: benc-uk/workflow-dispatch@4c044c1613fabbe5250deadc65452d54c4ad4fc7 # v1
with:
workflow: Build Native Release Packages
token: ${{ secrets.WRITE_ACCESS_TOKEN }}
ref: "${{ env.tag_name }}"
inputs: '{"package_suffix": "", "package_version": "${{ env.package_version }}", "release_id": "${{ steps.create_release.outputs.id }}", "commit": "${{ steps.last_green_commit.outputs.result }}"}'