Skip to content

Commit 298e39f

Browse files
add packaging workflow for helm charts
1 parent 2a536ec commit 298e39f

14 files changed

Lines changed: 184 additions & 8 deletions

File tree

.github/workflows/main.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,23 +14,23 @@ permissions:
1414

1515
jobs:
1616
check-formatting:
17-
uses: ./.github/workflows/check-formatting.yml
17+
uses: ./.github/workflows/main/check-formatting.yml
1818

1919
unit-tests:
20-
uses: ./.github/workflows/unit-tests.yml
20+
uses: ./.github/workflows/main/unit-tests.yml
2121
needs: check-formatting
2222

2323
build-image:
24-
uses: ./.github/workflows/build-image.yml
24+
uses: ./.github/workflows/main/build-image.yml
2525
secrets: inherit
2626
needs: unit-tests
2727

2828
vulnerability-scan:
29-
uses: ./.github/workflows/vulnerability-scan.yml
29+
uses: ./.github/workflows/main/vulnerability-scan.yml
3030
secrets: inherit
3131
needs: build-image
3232

3333
# smoke-tests:
34-
# uses: ./.github/workflows/smoke-tests.yml
34+
# uses: ./.github/workflows/main/smoke-tests.yml
3535
# secrets: inherit
3636
# needs: vulnerability-scan
File renamed without changes.
File renamed without changes.

.github/workflows/pre-release.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: Pre-Release Workflow
2+
on:
3+
workflow_dispatch:
4+
inputs:
5+
old_operator_version:
6+
description: 'OLD OPERATOR VERSION'
7+
required: true
8+
new_operator_version:
9+
description: 'NEW OPERATOR VERSION'
10+
required: true
11+
12+
permissions:
13+
contents: write
14+
pull-requests: write
15+
16+
jobs:
17+
update-versions:
18+
uses: ./.github/workflows/pre-release/update-versions.yml
19+
with:
20+
old_operator_version: ${{ github.event.inputs.old_operator_version }}
21+
new_operator_version: ${{ github.event.inputs.new_operator_version }}
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: Update Versions
2+
on:
3+
workflow_call:
4+
5+
jobs:
6+
package:
7+
runs-on: ubuntu-latest
8+
permissions:
9+
# Need the write permission because this job commits changes to some folders like dist
10+
contents: write
11+
pull-requests: write
12+
steps:
13+
- name: Checkout code
14+
uses: actions/checkout@v2
15+
- name: Deep Fetch
16+
run: |
17+
git fetch --prune --unshallow
18+
- name: Create ChangeLog since last release
19+
run: |
20+
git log $(git describe --tags --abbrev=0)..HEAD --oneline >> docs/ChangeLog-NEW.md
21+
- name: Dotenv Action
22+
uses: falti/dotenv-action@d4d12eaa0e1dd06d5bdc3d7af3bf4c8c93cb5359
23+
id: dotenv
24+
- name: Setup Go
25+
uses: actions/setup-go@v2
26+
with:
27+
go-version: ${{ steps.dotenv.outputs.GO_VERSION }}
28+
- name: Update Helm Version
29+
if: github.event.inputs.old_operator_version != github.event.inputs.new_operator_version
30+
uses: jacobtomlinson/gha-find-replace@v3
31+
with:
32+
find: "${{ github.event.inputs.old_operator_version }}"
33+
replace: "${{ github.event.inputs.new_operator_version }}"
34+
include: "helm-chart/**.yaml"
35+
- name: Update Operator Version in DOCS
36+
if: github.event.inputs.old_operator_version != github.event.inputs.new_operator_version
37+
uses: jacobtomlinson/gha-find-replace@v3
38+
with:
39+
find: "${{ github.event.inputs.old_operator_version }}"
40+
replace: "${{ github.event.inputs.new_operator_version }}"
41+
include: "**.md"
42+
- name: Create Pull Request
43+
uses: peter-evans/create-pull-request@v3.10.1
44+
with:
45+
branch: "release/${{ github.event.inputs.new_operator_version }}"
46+
title: "Splunk AI Operator ${{ github.event.inputs.new_operator_version }} release"
47+
reviewers: "${{ steps.dotenv.outputs.REVIEWERS }}"
48+
body: |
49+
### Automated Pull Request for Splunk AI Operator Release ${{ github.event.inputs.new_operator_version }}
50+
* Changes added to docs/ChangeLog-NEW.md. Please filter and update ChangeLog.md
51+
* Delete ChangeLog-New.md

.github/workflows/release.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
name: Pre-Release Workflow
2+
on:
3+
workflow_dispatch:
4+
inputs:
5+
old_operator_version:
6+
description: 'OLD OPERATOR VERSION'
7+
required: true
8+
new_operator_version:
9+
description: 'NEW OPERATOR VERSION'
10+
required: true
11+
12+
permissions:
13+
contents: write
14+
15+
jobs:
16+
package-helm:
17+
uses: ./.github/workflows/release/package-helm.yml
18+
with:
19+
old_operator_version: ${{ github.event.inputs.old_operator_version }}
20+
new_operator_version: ${{ github.event.inputs.new_operator_version }}
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Package Helm Chart
2+
on:
3+
workflow_call:
4+
5+
jobs:
6+
package:
7+
runs-on: ubuntu-latest
8+
permissions:
9+
# Need the write permission because this job commits changes to some folders like dist
10+
contents: write
11+
pull-requests: write
12+
steps:
13+
- name: Checkout code
14+
uses: actions/checkout@v2
15+
- name: Dotenv Action
16+
uses: falti/dotenv-action@d4d12eaa0e1dd06d5bdc3d7af3bf4c8c93cb5359
17+
id: dotenv
18+
- name: Setup Go
19+
uses: actions/setup-go@v2
20+
with:
21+
go-version: ${{ steps.dotenv.outputs.GO_VERSION }}
22+
- name: Run helm chart package creation
23+
run: |
24+
helm package helm-chart/splunk-ai-operator
25+
cp splunk-ai-operator-${{ github.event.inputs.new_operator_version }}.tgz docs/
26+
mv splunk-ai-operator-${{ github.event.inputs.new_operator_version }}.tgz helm-chart/splunk-enterprise/charts
27+
helm package helm-chart/splunk-enterprise
28+
mv splunk-enterprise-${{ github.event.inputs.new_operator_version }}.tgz docs/
29+
helm repo index --url https://splunk.github.io/splunk-ai-operator/ docs/

0 commit comments

Comments
 (0)