-
Notifications
You must be signed in to change notification settings - Fork 4.2k
54 lines (49 loc) · 1.92 KB
/
cut_new_release_candidate.yml
File metadata and controls
54 lines (49 loc) · 1.92 KB
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
# A workflow to cut a new release candidate (i.e.: .stable_01) on the current
# release branch.
#
# The channel will be automatically determined from the branch name (i.e.: when
# run on a stable_release/* branch, it will assume it is building a new "stable"
# channel candidate).
name: Cut New Release Candidate
on:
workflow_dispatch:
jobs:
compute_channel:
name: Compute release channel
runs-on: ubuntu-latest
outputs:
channel: ${{ steps.compute-channel.outputs.channel }}
steps:
- name: "Compute release channel"
id: compute-channel
run: |
# Check whether the current branch name starts with "some_release/",
# and if so, extract the value of "some" into the CHANNEL variable,
# discarding the rest of the branch name.
CHANNEL="$(echo $GITHUB_REF_NAME | sed -r 's|^(\w+)_release/.*$|\1|')"
# If the sed expression doesn't match the input, it will write out the
# input, unmodified.
if [[ $CHANNEL == $GITHUB_REF_NAME ]]; then
echo "::error::Can only create new release candidates on a release branch" && exit 1
fi
echo "channel=$CHANNEL" >> $GITHUB_OUTPUT
shell: bash
create_release_candidate:
name: Create Release Candidate
uses: ./.github/workflows/create_release.yml
needs: compute_channel
with:
channel: ${{ needs.compute_channel.outputs.channel }}
secrets: inherit
update_channel_versions:
name: Update channel_versions.json
needs:
- create_release_candidate
runs-on: ubuntu-latest
steps:
- name: Invoke update workflow in channel-versions repository
uses: peter-evans/repository-dispatch@28959ce8df70de7be546dd1250a005dd32156697 # v4.0.1
with:
repository: warpdotdev/channel-versions
token: ${{ secrets.CHANNEL_VERSIONS_REPOSITORY_DISPATCH_TOKEN }}
event-type: update-channel-versions