Skip to content

Commit

Permalink
Merge pull request #193 from ccremer/fix-gh
Browse files Browse the repository at this point in the history
Fix various issues with Helm chart releasing
  • Loading branch information
ccremer authored Oct 5, 2022
2 parents 341441b + f4edf2c commit 737ffb6
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 13 deletions.
8 changes: 2 additions & 6 deletions .github/workflows/chart-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,17 +60,13 @@ jobs:
with:
configuration: ".github/configuration.json"
ignorePreReleases: true
outputFile: .github/release-notes.md
outputFile: charts/${{ env.CHART_NAME}}/CHANGELOG.md
fromTag: chart/${{ env.CHART_NAME }}-${{ env.PREVIOUS_CHART_VERSION }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Package Helm chart
run: |
mkdir -p .cr-index
cr package charts/${CHART_NAME}
cr upload "--release-name-template=chart/{{ .Name }}-{{ .Version }}" --release-notes-file=.github/release-notes.md
cr index "--release-name-template=chart/{{ .Name }}-{{ .Version }}" --push
run: make chart-release
env:
CR_TOKEN: ${{ secrets.GITHUB_TOKEN }}
CR_OWNER: ${{ github.repository_owner }}
Expand Down
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,8 @@
/data/intermediate/**
/data/source/**
/data/target/**

# Chart
/charts/**/CHANGELOG.md
/.cr-index/
/.cr-release-packages/
15 changes: 13 additions & 2 deletions charts/charts.mk
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,16 @@ chart-lint: chart-generate chart-docs ## Lint charts
git diff --exit-code

.PHONY: chart-clean
chart-clean:
rm -f $(helm_docs_bin)
chart-clean: ## Clean the Helm chart artifacts
rm -rf $(helm_docs_bin) .cr-index .cr-release-packages charts/*/CHANGELOG.md

.PHONY: chart-release
chart-release: | .cr-index ## Release the Helm chart to GitHub
# CHART_NAME is given by GH action
# Download 'cr' manually from https://github.com/helm/chart-releaser/releases, 'go install' doesn't work...
cr package charts/$(CHART_NAME)
cr upload "--release-name-template=chart/{{ .Name }}-{{ .Version }}" --release-notes-file=CHANGELOG.md
cr index "--release-name-template=chart/{{ .Name }}-{{ .Version }}" --push

.cr-index:
mkdir -p $@
2 changes: 1 addition & 1 deletion charts/clustercode/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.4.0
version: 0.3.0

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
Expand Down
4 changes: 2 additions & 2 deletions charts/clustercode/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# clustercode

![Version: 0.4.0](https://img.shields.io/badge/Version-0.4.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square)
![Version: 0.3.0](https://img.shields.io/badge/Version-0.3.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square)

Movie and Series conversion Operator with Ffmpeg

Expand All @@ -15,7 +15,7 @@ Edit the README.gotmpl.md template instead.

Install the CRDs:
```bash
kubectl apply -f https://github.com/ccremer/clustercode/releases/download/clustercode-0.4.0/crds.yaml
kubectl apply -f https://github.com/ccremer/clustercode/releases/download/clustercode-0.3.0/crds.yaml
```

To prepare the webhook server, you need `yq`, `openssl`, `base64` tools and run this:
Expand Down
7 changes: 6 additions & 1 deletion docs/docs.mk
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ docs-preview: docs-build ## Preview Antora build in local web server and browser

.PHONY: docs-publish
docs-publish: export ANTORA_OUTPUT_DIR = $(docs_output_dir)
docs-publish: docs-build ## Publishes the documentation in gh-pages
docs-publish: docs-build | $(docs_output_dir) ## Publishes the documentation in gh-pages
touch $(docs_output_dir)/.nojekyll
wget -O $(docs_output_dir)/index.yaml https://raw.githubusercontent.com/$(PROJECT_OWNER)/$(PROJECT_NAME)/gh-pages/index.yaml
npm --prefix ./docs run deploy

.PHONY: .docs-clean
Expand All @@ -24,3 +26,6 @@ docs-publish: docs-build ## Publishes the documentation in gh-pages
# Download node packages
docs/node_modules:
npm --prefix ./docs install

$(docs_output_dir):
mkdir -p $@
1 change: 0 additions & 1 deletion docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
"watch": "watch 'npm run build' modules",
"serve": "reload -d ${ANTORA_OUTPUT_DIR} -b",
"preview": "run-p watch serve",
"predeploy": "touch ${ANTORA_OUTPUT_DIR}/.nojekyll",
"deploy": "gh-pages -d ${ANTORA_OUTPUT_DIR} --dotfiles -m \"Update documentation $(date --utc '+%Y-%m-%d %H:%M')\""
}
}

0 comments on commit 737ffb6

Please sign in to comment.