-
Notifications
You must be signed in to change notification settings - Fork 0
63 lines (52 loc) · 1.64 KB
/
chart-release.yml
File metadata and controls
63 lines (52 loc) · 1.64 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
name: Publish Helm Chart
on:
push:
branches: [main, dev]
paths:
- chart/**
- .github/workflows/chart-release.yml
pull_request:
paths:
- chart/**
- .github/workflows/chart-release.yml
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: azure/setup-helm@v5
- name: Lint (default values)
run: helm lint chart/
- name: Lint (dev values)
run: helm lint chart/ -f chart/values-dev.yaml
release:
name: Release
needs: lint
if: github.event_name == 'push'
runs-on: ubuntu-latest
permissions:
contents: write # create GitHub Releases and push to gh-pages
steps:
- name: Checkout
uses: actions/checkout@v6
with:
fetch-depth: 0 # chart-releaser needs full history to diff versions
- name: Configure Git
run: |
git config user.name "$GITHUB_ACTOR"
git config user.email "$GITHUB_ACTOR@users.noreply.github.com"
- uses: azure/setup-helm@v5
- name: Stamp dev pre-release version
if: github.ref == 'refs/heads/dev'
run: |
current=$(grep '^version:' chart/Chart.yaml | awk '{print $2}')
sed -i "s/^version:.*/version: ${current}-dev.${{ github.run_number }}/" chart/Chart.yaml
- name: Run chart-releaser
uses: helm/chart-releaser-action@v1.7.0
with:
# chart/ lives at the repo root, so charts_dir=. lets cr find it
# via ./*/Chart.yaml without touching Go source directories.
charts_dir: .
env:
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"