Skip to content

Commit

Permalink
Helm and Operator Release Improvements (#890)
Browse files Browse the repository at this point in the history
### Description
Coming from initial PR
#872.

Fix the error
https://github.com/opensearch-project/opensearch-k8s-operator/actions/runs/11685891300/job/32540910915
```
Looking up latest tag...
Discovering changed charts since 'v2.6.0'...
WARNING: charts/opensearch-cluster/templates/Chart.yaml is missing, assuming that 'charts/opensearch-cluster/templates' is not a Helm chart. Skipping.
Nothing to do. No chart changes detected.
```

Since moving from `stefanprodan/helm-gh-pages@master` to
`helm/[email protected]` added `fetch-depth` and
`skip_existing`. The `skip_existing` should not throw an error if the
chart with same `version` is already added to the `gh-pages` branch
`index.yaml` file.

#### Here are some tests done on my fork 
##### Release Helm Charts workflow

https://github.com/prudhvigodithi/opensearch-k8s-operator/actions/workflows/helm-release.yaml

##### Publish Release from tag workflow 

https://github.com/prudhvigodithi/opensearch-k8s-operator/actions/runs/11687219955




### Issues Resolved
Coming from
#830

### Check List
- [ ] Commits are signed per the DCO using --signoff 
- [ ] Unittest added for the new/changed functionality and all unit
tests are successful
- [ ] Customer-visible features documented
- [ ] No linter warnings (`make lint`)

If CRDs are changed:
- [ ] CRD YAMLs updated (`make manifests`) and also copied into the helm
chart
- [ ] Changes to CRDs documented

Please refer to the [PR
guidelines](https://github.com/opensearch-project/opensearch-k8s-operator/blob/main/docs/developing.md#submitting-a-pr)
before submitting this pull request.

By submitting this pull request, I confirm that my contribution is made
under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and
signing off your commits, please check
[here](https://github.com/opensearch-project/OpenSearch/blob/main/CONTRIBUTING.md#developer-certificate-of-origin).

Signed-off-by: Prudhvi Godithi <[email protected]>
  • Loading branch information
prudhvigodithi authored Nov 5, 2024
1 parent 8fda148 commit beaf4fb
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 8 deletions.
13 changes: 8 additions & 5 deletions .github/workflows/helm-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,12 @@ on:

jobs:
release:
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v3
with:
fetch-depth: 0

Expand All @@ -21,13 +23,14 @@ jobs:
git config user.email "[email protected]"
- name: Install Helm
uses: azure/setup-helm@v1
with:
version: v3.14.3
uses: azure/setup-helm@v4
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"

- name: Run chart-releaser for opensearch-cluster
uses: helm/[email protected]
with:
charts_dir: charts/opensearch-cluster
skip_existing: true
mark_as_latest: false
env:
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
17 changes: 14 additions & 3 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,18 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Setup go
uses: actions/setup-go@v5
with:
go-version-file: 'go.work'
cache: false

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: set Env
id: github-ver
run: |
Expand All @@ -29,15 +34,21 @@ jobs:
sed -i -e 's/^appVersion:.*/appVersion: '$RELEASE_VERSION'/' charts/opensearch-operator/Chart.yaml
sed -i -e 's/^version:.*/version: '$RELEASE_VERSION'/' charts/opensearch-operator/Chart.yaml
- name: Configure Git
run: |
git config user.name "$GITHUB_ACTOR"
git config user.email "[email protected]"
- name: Install Helm
uses: azure/setup-helm@v4
with:
version: v3.14.3
env:
GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"

- name: Run chart-releaser for opensearch-operator
uses: helm/[email protected]
with:
charts_dir: charts/opensearch-operator
skip_existing: true
mark_as_latest: false
env:
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"

Expand Down

0 comments on commit beaf4fb

Please sign in to comment.