Skip to content

Commit

Permalink
feat: add actions for init release (#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
pantmal authored Oct 25, 2022
1 parent 6fdce50 commit 6fc5ece
Show file tree
Hide file tree
Showing 11 changed files with 929 additions and 9 deletions.
10 changes: 10 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
name: CI

on: pull_request

jobs:
call-lint:
uses: ./.github/workflows/linter.yaml
call-lint-test:
uses: ./.github/workflows/lint-test.yaml

58 changes: 58 additions & 0 deletions .github/workflows/lint-test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: Lint and Test Charts

on:
workflow_call:
inputs:
ct_configfile:
description: location of the ct config file
default: ct.yaml
required: false
type: string
ct_check_version_increment:
description: whether to check for version bump requirement
default: false
required: false
type: boolean
helm_version:
description: version of the helm binary
default: v3.8.2
required: false
type: string

env:
CT_CONFIGFILE: ${{ inputs.ct_configfile }}

jobs:
lint-test:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Set up Helm
uses: azure/setup-helm@v1
with:
version: ${{ inputs.helm_version }}

# Python is required because `ct lint` runs Yamale (https://github.com/23andMe/Yamale) and
# yamllint (https://github.com/adrienverge/yamllint) which require Python
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.7

- name: Set up chart-testing
uses: helm/[email protected]

- name: Run chart-testing (list-changed)
id: list-changed
run: |
changed=$(ct list-changed --config "${CT_CONFIGFILE}")
if [[ -n "$changed" ]]; then
echo "::set-output name=changed::true"
fi
- name: Run chart-testing (lint)
run: ct lint --config "${CT_CONFIGFILE}" --check-version-increment=${{ inputs.ct_check_version_increment }}
42 changes: 42 additions & 0 deletions .github/workflows/linter.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Lint Code Base

# Documentation:
# https://help.github.com/en/articles/workflow-syntax-for-github-actions

on:
workflow_call:
inputs:
filter_regex_include:
description: this sets the scope of the super linter
default: ".*"
required: false
type: string

jobs:
build:
name: Lint Code Base
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v2

- name: Check Docs
run: |
docker run --rm --volume "$(pwd):/helm-docs" -u "$(id -u)" jnorwood/helm-docs:v1.8.1
if ! git diff --exit-code; then
echo "Documentation not up to date. Please run helm-docs and commit changes!" >&2
exit 1
fi
- name: Lint Code Base
uses: docker://github/super-linter:v3.12.0
env:
FILTER_REGEX_EXCLUDE: .*(README\.md|Chart\.yaml|NOTES.txt).*
FILTER_REGEX_INCLUDE: ${{ inputs.filter_regex_include }}
VALIDATE_ALL_CODEBASE: false
VALIDATE_JSCPD: false
VALIDATE_KUBERNETES_KUBEVAL: false
VALIDATE_YAML: false
DEFAULT_BRANCH: main
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

40 changes: 40 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Release Charts

on:
push:
branches:
- main
paths:
- "charts/**"

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

- name: Configure Git
run: |
git config user.name "$GITHUB_ACTOR"
git config user.email "[email protected]"
- name: Install Helm
uses: azure/setup-helm@v1
with:
version: v3.5.2

- name: Add dependency chart repos
run: |
helm repo add grafana https://grafana.github.io/helm-charts
helm repo add prometheus-community https://prometheus-community.github.io/helm-charts
- name: Run chart-releaser
uses: helm/[email protected]
with:
charts_dir: charts
env:
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"

23 changes: 23 additions & 0 deletions .github/workflows/sync-readme.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
on:
push:
branches:
- 'main'
paths:
- 'README.md'
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: |
cp -f README.md ${{ runner.temp }}/README.md
- uses: actions/checkout@v2
with:
ref: gh-pages
- run: |
cp -f ${{ runner.temp }}/README.md .
git config user.name "$GITHUB_ACTOR"
git config user.email "[email protected]"
git add README.md
git commit --signoff -m "Sync README from main"
git push
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Please refer to Helm's [documentation](https://helm.sh/docs/) to get started.
Once Helm is set up properly, add the repo as follows:

```console
helm repo add conduit-platform <link-coming-soon>
helm repo add conduit-platform https://conduitplatform.github.io/helm-charts/
```

You can then run `helm search repo conduit-platform` to see the charts.
2 changes: 1 addition & 1 deletion charts/conduit/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ version: 0.1.0
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
# It is recommended to use it with quotes.
appVersion: "0.14.7"
appVersion: "v0.15.0"

dependencies:
- name: loki
Expand Down
Loading

0 comments on commit 6fc5ece

Please sign in to comment.