forked from woodpecker-ci/helm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrelease-config.ts
19 lines (19 loc) · 862 Bytes
/
release-config.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
export default {
beforePrepare: async ({ exec, nextVersion }) => {
await exec(`apk add --no-cache helm curl`);
await exec(`sed -i "s/^version:.*$/version: ${nextVersion}/g" Chart.yaml`);
await exec(
`sed -i '' 's/^version:/version: ${nextVersion}/' charts/agent/Chart.yaml`
);
await exec(
`sed -i '' 's/^version:/version: ${nextVersion}/' charts/server/Chart.yaml`
);
await exec(
`export UPSTREAM_VERSION=$(curl -s https://api.github.com/repos/woodpecker-ci/woodpecker/releases/latest | grep tag_name | grep -Eo "([0-9]+(\.[0-9]+)+)") && sed -i "s/^appVersion:.*$/appVersion: $UPSTREAM_VERSION/g" Chart.yaml charts/agent/Chart.yaml charts/server/Chart.yaml`
);
await exec("helm dependency update");
await exec(
"git add Chart.yaml charts/agent/Chart.yaml charts/server/Chart.yaml"
);
},
};