-
Notifications
You must be signed in to change notification settings - Fork 9
88 lines (78 loc) · 2.97 KB
/
release-charts.yaml
File metadata and controls
88 lines (78 loc) · 2.97 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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
name: Bump remotedialer-proxy in rancher/charts
on:
workflow_dispatch:
inputs:
charts_ref:
description: "Submit PR against the following rancher/charts branch (eg: dev-v2.14)"
required: true
default: "dev-v2.14"
prev_remotedialer:
description: "Previous remotedialer version (eg: v0.7.0-rc.1)"
required: true
default: ""
new_remotedialer:
description: "New remotedialer-proxy version (eg: v0.7.0-rc.2)"
required: true
default: ""
env:
CHARTS_REF: ${{ github.event.inputs.charts_ref }}
REMOTEDIALER_REF: "${{ github.ref_name }}"
PREV_REMOTEDIALER: ${{ github.event.inputs.prev_remotedialer }}
NEW_REMOTEDIALER: ${{ github.event.inputs.new_remotedialer }}
CHARTS_REPO: rancher/charts
jobs:
create-charts-pr:
runs-on: ubuntu-latest
permissions:
contents: read
# Required for vault
id-token: write
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
ref: "${{ env.REMOTEDIALER_REF }}"
path: remotedialer-proxy
- uses: rancher-eio/read-vault-secrets@main
id: read_token
with:
secrets: |
github/token/rancher--charts--pull_requests--write token | GH_TOKEN
- name: Checkout charts repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
with:
repository: ${{ env.CHARTS_REPO }}
ref: "${{ env.CHARTS_REF }}"
token: ${{ env.GH_TOKEN }}
path: charts
# Allow making git push request later on
persist-credentials: true
- name: Configure the committer
run: |
cd charts
git config --global user.name "$APP_USER"
git config --global user.email "${APP_USER}@users.noreply.github.com"
env:
GH_TOKEN: ${{ env.GH_TOKEN }}
APP_USER: "rancher-pr-and-push-remotedialer-proxy[bot]"
- name: Install dependencies
run: sudo snap install yq --channel=v4/stable
- name: Run release script
run: |
cd charts
BRANCH="bump-remotedialer-${GITHUB_RUN_ID}-${GITHUB_RUN_ATTEMPT}"
echo "BRANCH=${BRANCH}" >> $GITHUB_ENV
git checkout -b "$BRANCH" "$CHARTS_REF"
../remotedialer-proxy/.github/workflows/scripts/release-against-charts.sh . "$PREV_REMOTEDIALER" "$NEW_REMOTEDIALER"
- name: Push and create pull request
env:
GH_TOKEN: ${{ env.GH_TOKEN }}
run: |
cd charts
git push origin "$BRANCH"
body=$(../remotedialer-proxy/.github/workflows/scripts/release-message.sh "$PREV_REMOTEDIALER" "$NEW_REMOTEDIALER")
gh pr create \
--title "[$CHARTS_REF] Bump remotedialer-proxy to $NEW_REMOTEDIALER" \
--body "$body" \
--repo ${{ github.repository_owner }}/charts \
--head "${{ github.repository_owner }}:$BRANCH" \
--base "$CHARTS_REF"