-
-
Notifications
You must be signed in to change notification settings - Fork 1
68 lines (64 loc) · 1.87 KB
/
Copy pathrelease.yml
File metadata and controls
68 lines (64 loc) · 1.87 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
name: "Publish chart"
on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'
jobs:
build-chart:
name: "Build chart"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set chart version
run: |
VERSION="${GITHUB_REF/refs\/tags\//}"
VERSION="${VERSION/v/}"
sed -i "s|^version:.*|version:\ \"${VERSION}\"|g" Chart.yaml
- name: Helm tool installer
uses: Azure/setup-helm@v5.0.0
with:
version: "3.16.3"
- name: Build chart
run: |
helm dependency update
helm package .
- uses: actions/upload-artifact@v4
with:
name: charts
path: "*.tgz"
publish-chart:
name: "Publish chart to owner repository"
runs-on: ubuntu-latest
needs: build-chart
steps:
- uses: actions/checkout@v4
with:
repository: '${{ github.repository_owner }}/charts'
ref: 'charts'
token: '${{ secrets.CHARTS_REPO_TOKEN }}'
- uses: actions/download-artifact@v4
with:
name: charts
- name: Push chart
run: |
git config --global user.name "${{ github.actor }}"
git config --global user.email "${{ github.actor_id }}+${{ github.actor }}@users.noreply.github.com"
git add *.tgz
export CHART_FILENAMES="$(git --no-pager diff --name-only --cached -- '*.tgz' | tr '\n' ' ')"
git commit -m "Add ${CHART_FILENAMES}"
git push origin charts
create-release:
name: "Create release on GitHub"
runs-on: ubuntu-latest
needs: build-chart
permissions:
contents: write
steps:
- uses: actions/download-artifact@v4
with:
name: charts
- uses: softprops/action-gh-release@v2
with:
files: "*.tgz"
generate_release_notes: true
make_latest: true