Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added support for PRs in chartReleaser workflow #42

Merged
merged 15 commits into from
Jul 16, 2024
Merged
Show file tree
Hide file tree
Changes from 14 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .github/workflows/buildTestPublishContainerDeploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@ on:
types:
- published
pull_request:
paths:
- 'src/**'
- 'client/**'
- 'server/**'
- 'test/**'
- 'package-lock.json'
- 'Dockerfile'
workflow_dispatch:
jobs:
install-build-lint-and-test:
Expand Down
12 changes: 9 additions & 3 deletions .github/workflows/chartReleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,28 +4,34 @@ on:
release:
types:
- published
pull_request:
paths:
- 'helm/**'
workflow_dispatch:
inputs:
chart_version:
description: 'The chart version to create. Must be a valid semver string and should indicate that it is not a release chart version (eg. 5.1.2-pr36).'
description: 'The chart version to create. Will be appended to the current version from helm/Chart.yaml (eg. "pr36" on Chart.yaml version: 5.1.2 produces "5.1.2-pr36").'

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't the most clearly worded (although the example is very useful). This is a sub-version or suffix essentially, right?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah reading it back it wasn't very clear. How does this one read?

required: true

jobs:
release:
# depending on default permission settings for your org (contents being read-only or read-write for workloads), you will have to add permissions
# see: https://docs.github.com/en/actions/security-guides/automatic-token-authentication#modifying-the-permissions-for-the-github_token
env:
CHART_VERSION: "${{ github.event_name == 'workflow_dispatch' && github.event.inputs.chart_version || null }}"
CHART_VERSION: "${{ (github.event_name == 'workflow_dispatch' && format('-{0}', github.event.inputs.chart_version)) || (github.event_name == 'pull_request' && format('-pr{0}', github.event.pull_request.number)) }}"
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Get helm chart version
id: chart
run: "echo \"version=$(helm show chart helm | grep 'version:' | tail -1 | cut -f2 -d' ')\" >> $GITHUB_OUTPUT"
- name: Publish Helm charts
uses: stefanprodan/helm-gh-pages@master
with:
token: ${{ secrets.GITHUB_TOKEN }}
charts_dir: ./
branch: gh-pages
target_dir: helm
chart_version: ${{ env.CHART_VERSION }}
chart_version: ${{ format('{0}{1}', steps.chart.outputs.version, env.CHART_VERSION || '') }}
2 changes: 1 addition & 1 deletion helm/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,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: 5.1.2
version: 5.1.3

# 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
Loading