Skip to content

Commit caac69d

Browse files
authored
refactor: restructure charts structure and release-please artifacts publishing (#47)
* refactor: update location of charts and publishing of artifacts * fix: update missing reaadme template values for release-please * fix: pre-commit updates * fix: remove component in tag and update chart location in tests * fix: remove duplicate runs for prs and pushes
1 parent 1328cdc commit caac69d

30 files changed

+47
-130
lines changed

.github/workflows/build-push-image.yaml

Lines changed: 0 additions & 74 deletions
This file was deleted.

.github/workflows/release-please.yaml

Lines changed: 14 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,14 @@ on:
77
permissions:
88
contents: write
99
pull-requests: write
10-
issues: write
1110

1211
jobs:
1312
release-please:
1413
runs-on: ubuntu-latest
1514
outputs:
1615
releases_created: ${{ steps.release.outputs.releases_created }}
17-
paths_released: ${{ steps.release.outputs.paths_released }}
18-
app_version: ${{ steps.release.outputs.version }}
19-
chart_version: ${{ steps.release.outputs['chart--version'] }}
16+
release_version: ${{ steps.release.outputs.version }}
17+
tag_name: ${{ steps.release.outputs.tag_name }}
2018
steps:
2119
- uses: googleapis/release-please-action@v4
2220
id: release
@@ -25,15 +23,15 @@ jobs:
2523
config-file: release-please-config.json
2624
manifest-file: .release-please-manifest.json
2725

28-
publish-tag-app-artifact:
29-
if: ${{ fromJSON(needs.release-please.outputs.releases_created) && contains(fromJSON(needs.release-please.outputs.paths_released), '.') }}
26+
publish-tag:
27+
if: ${{ fromJSON(needs.release-please.outputs.releases_created) }}
3028
runs-on: ubuntu-latest
3129
needs: [release-please]
3230
permissions:
3331
packages: write
3432
contents: read
3533
steps:
36-
- uses: actions/checkout@v6
34+
- uses: actions/checkout@v4
3735
- name: Set up Docker Buildx
3836
uses: docker/setup-buildx-action@v3
3937
- name: Login to GitHub Container Registry
@@ -48,7 +46,7 @@ jobs:
4846
with:
4947
images: ghcr.io/${{ github.repository }}
5048
tags: |
51-
type=raw,pattern={{version}},value=${{ needs.release-please.outputs.app_version }}
49+
type=raw,pattern={{version}},value=${{ needs.release-please.outputs.tag_name }}
5250
- name: Build and push Docker image tag
5351
uses: docker/build-push-action@v6
5452
with:
@@ -57,35 +55,18 @@ jobs:
5755
file: Dockerfile
5856
push: true
5957
build-args: |
60-
BUILD_VERSION="${{ needs.release-please.outputs.app_version }}"
58+
BUILD_VERSION="${{ needs.release-please.outputs.tag_name }}"
6159
tags: ${{ steps.meta.outputs.tags }}
6260
labels: ${{ steps.meta.outputs.labels }}
63-
64-
publish-tag-chart-artifact:
65-
if: ${{ fromJSON(needs.release-please.outputs.releases_created) && contains(fromJSON(needs.release-please.outputs.paths_released), 'chart') }}
66-
runs-on: ubuntu-latest
67-
needs: [release-please]
68-
permissions:
69-
packages: write
70-
contents: read
71-
steps:
72-
- uses: actions/checkout@v6
73-
- name: Login to GitHub Container Registry
74-
uses: docker/login-action@v3
75-
with:
76-
registry: ghcr.io
77-
username: ${{ github.actor }}
78-
password: ${{ secrets.GITHUB_TOKEN }}
79-
- name: Chart | Push - data-sync-operator-chart
80-
uses: appany/helm-oci-chart-releaser@v0.5.0
61+
- name: Chart | Push
62+
uses: appany/helm-oci-chart-releaser@v0.4.2
8163
with:
82-
name: data-sync-operator-chart
64+
name: data-sync-operator
8365
repository: pelotech/charts
84-
path: chart
85-
tag: ${{ needs.release-please.outputs.chart_version }}
66+
tag: ${{ needs.release-please.outputs.release_version }}
8667
registry: ghcr.io
8768
registry_username: ${{ github.actor }}
88-
registry_password: ${{ secrets.GITHUB_TOKEN }}
69+
registry_password: ${{ secrets.github_token }}
8970

9071
publish-dev:
9172
if: ${{ ! fromJSON(needs.release-please.outputs.releases_created) }}
@@ -95,7 +76,7 @@ jobs:
9576
packages: write
9677
contents: read
9778
steps:
98-
- uses: actions/checkout@v6
79+
- uses: actions/checkout@v4
9980
- name: Set up Docker Buildx
10081
uses: docker/setup-buildx-action@v3
10182
- name: Log in to the Container registry
@@ -110,6 +91,7 @@ jobs:
11091
with:
11192
images: ghcr.io/${{ github.repository }}
11293
tags: |
94+
# set latest tag for default branch
11395
type=raw,value=latest,enable={{is_default_branch}}
11496
- name: sha short
11597
id: sha

.github/workflows/test-chart.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ name: Test Chart
22

33
on:
44
push:
5+
branches:
6+
- main
57
pull_request:
68

79
jobs:
@@ -44,7 +46,7 @@ jobs:
4446

4547
- name: Lint Helm Chart
4648
run: |
47-
helm lint ./chart
49+
helm lint ./charts/data-sync-operator
4850
4951
# TODO: Uncomment if cert-manager is enabled
5052
# - name: Install cert-manager via Helm (wait for readiness)
@@ -67,7 +69,7 @@ jobs:
6769

6870
- name: Install Helm chart for project
6971
run: |
70-
helm install my-release ./chart --create-namespace --namespace data-sync-operator-system
72+
helm install my-release ./charts/data-sync-operator --create-namespace --namespace data-sync-operator-system
7173
7274
- name: Check Helm release status
7375
run: |

.github/workflows/test-e2e.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ name: E2E Tests
22

33
on:
44
push:
5+
branches:
6+
- main
57
pull_request:
68

79
jobs:

.github/workflows/test.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ name: Tests
22

33
on:
44
push:
5+
branches:
6+
- main
57
pull_request:
68

79
jobs:

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ repos:
1414
hooks:
1515
- id: helm-docs-built
1616
args:
17-
- --chart-search-root=chart
17+
- --chart-search-root=charts
1818
- repo: https://github.com/adrienverge/yamllint
1919
rev: v1.37.1
2020
hooks:

.release-please-manifest.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
{
2-
".": "0.0.0",
3-
"chart": "1.0.1"
2+
".": "0.0.1"
43
}
File renamed without changes.
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
apiVersion: v2
2-
name: data-sync-operator-chart
2+
name: data-sync-operator
33
description: A Helm chart to distribute the project data-sync-operator
44
type: application
5-
version: 1.0.1
6-
appVersion: "0.1.0"
5+
# x-release-please-start-version
6+
version: 0.0.1
7+
appVersion: "0.0.1"
8+
# x-release-please-end
79
icon: "https://example.com/icon.png"

0 commit comments

Comments
 (0)