forked from iree-org/iree
-
Notifications
You must be signed in to change notification settings - Fork 0
78 lines (69 loc) · 2.57 KB
/
schedule_candidate_release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
name: Schedule candidate release
on:
schedule:
- cron: "0 10 * * *"
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@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # v3.5.0
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: |
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 }}
commitish: ${{ steps.last_green_commit.outputs.release-commit }}
body: |
Automatic candidate release of iree.
draft: true
prerelease: true
- name: "Invoke workflow :: Build Release Packages"
uses: benc-uk/workflow-dispatch@798e70c97009500150087d30d9f11c5444830385 # v1.2.2
with:
workflow: Build 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.release-commit }}"
}