Repository navigation
65 lines (60 loc) · 2.53 KB
/
Copy pathcut_new_release_candidate.yml
File metadata and controls
65 lines (60 loc) · 2.53 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
55
56
57
58
59
60
61
62
63
64
65
# 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
permissions:
contents: write # create_release.yml pushes the release branch/tag and creates and uploads the GitHub release; a reusable-workflow caller must grant everything its callee declares
id-token: write # create_release.yml federates its OIDC token to GCP and Octo STS
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
permissions:
id-token: write # octo-sts/action exchanges the job's OIDC token for a scoped GitHub token
steps:
- name: Mint channel-versions token
id: app_token
uses: octo-sts/action@f603d3be9d8dd9871a265776e625a27b00effe05 # v1.1.1
with:
scope: warpdotdev/channel-versions
identity: warp-internal-dispatch
- name: Invoke update workflow in channel-versions repository
uses: peter-evans/repository-dispatch@28959ce8df70de7be546dd1250a005dd32156697 # v4.0.1
with:
repository: warpdotdev/channel-versions
token: ${{ steps.app_token.outputs.token }}
event-type: update-channel-versions