-
Notifications
You must be signed in to change notification settings - Fork 4
104 lines (99 loc) · 5.04 KB
/
update-chart.yaml
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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
name: Update app in chart
on:
registry_package:
types:
- published
jobs:
update-chart:
if: ${{ github.event.registry_package.name == 'pipeline-controller' && github.event.registry_package.package_version.container_metadata.tag.name != '' }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Import GPG key for signing commits
run: |
echo -n "$GPG_SIGNING_KEY" | gpg --import
key_id=$(echo -n "$GPG_SIGNING_KEY" | gpg --dry-run --import --verbose 2>&1 | awk '/^gpg: sec/ { print $3 }' | cut -d '/' -f 2)
git config user.signingkey "${key_id}"
git config commit.gpgsign true
env:
GPG_SIGNING_KEY: ${{ secrets.GPG_SIGNING_KEY }}
- name: bump app version
uses: mikefarah/yq@a198f72367ce9da70b564a2cc25399de8e27bf37 # v4.35.2
with:
cmd: yq -i '.appVersion = "${{ github.event.registry_package.package_version.container_metadata.tag.name }}"' charts/pipeline-controller/Chart.yaml
- name: get chart version
id: get_chart_version
uses: mikefarah/yq@a198f72367ce9da70b564a2cc25399de8e27bf37 # v4.35.2
with:
cmd: yq '.version' charts/pipeline-controller/Chart.yaml
- name: increment chart version
id: inc_chart_version
run: echo NEW_CHART_VERSION=$(echo ${{ steps.get_chart_version.outputs.result }} | awk -F. -v OFS=. '{print $1,++$2,0}') >> $GITHUB_OUTPUT
- name: update chart version
uses: mikefarah/yq@a198f72367ce9da70b564a2cc25399de8e27bf37 # v4.35.2
with:
cmd: yq -i '.version = "${{ steps.inc_chart_version.outputs.NEW_CHART_VERSION }}"' charts/pipeline-controller/Chart.yaml
- name: Create Pull Request
id: cpr
uses: peter-evans/create-pull-request@153407881ec5c347639a548ade7d8ad1d6740e38 # v5.0.2
with:
token: ${{ secrets.GHCR_TOKEN }}
commit-message: |
Update app version in chart
committer: wge-build-bot <[email protected]>
author: wge-build-bot <[email protected]>
branch: update-chart
title: Update app version to ${{ github.event.registry_package.package_version.container_metadata.tag.name }} in chart
body: |
This PR bumps the minor chart version by default. If it is more appropriate to bump the major or the patch versions, please amend the commit accordingly.
The workflow that this PR was created from is "${{ github.workflow }}".
- name: Check output
run: |
echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}"
echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}"
update-wge-chart:
if: ${{ github.event.registry_package.name == 'charts/pipeline-controller' }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
repository: weaveworks/weave-gitops-enterprise
token: ${{ secrets.GHCR_TOKEN }}
- name: Setup Helm
uses: azure/setup-helm@5119fcb9089d432beecbf79bb2c7915207344b78 # v3.5
with:
version: v3.10.1
- name: Debug
run: echo '${{ toJSON(github.event) }}'
- name: Update pipeline-controller chart version
uses: mikefarah/yq@a198f72367ce9da70b564a2cc25399de8e27bf37 # v4.35.2
with:
cmd: yq -i '(.dependencies[] | select(.name=="pipeline-controller") | .version) |= "${{ github.event.registry_package.package_version.container_metadata.tag.name }}"' charts/mccp/Chart.yaml
- name: Login to GitHub Container Registry
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.0
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GHCR_TOKEN }}
- name: Update chart dependencies
run: cd ./charts/mccp && helm dependency update
- name: Create Pull Request
id: cpr
uses: peter-evans/create-pull-request@153407881ec5c347639a548ade7d8ad1d6740e38 # v5.0.2
with:
token: ${{ secrets.GHCR_TOKEN }}
commit-message: |
Update pipeline-controller version in WGE chart
committer: wge-build-bot <[email protected]>
author: wge-build-bot <[email protected]>
branch: update-chart
title: Update pipeline-controller version to ${{ github.event.registry_package.package_version.container_metadata.tag.name }} in WGE chart
body: |
This PR bumps the pipeline-controller chart version.
The workflow that this PR was created from is "${{ github.workflow }}".
- name: Check output
run: |
echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}"
echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}"