Skip to content

github-release

github-release #227

Workflow file for this run

name: github-release
on:
workflow_dispatch:
inputs:
chart:
description: The chart to release
required: true
type: choice
options:
- foundryvtt
- ddb-proxy
- node-red
- home-assistant-matter-server
- home-assistant-otbr
- garage
- yas3p
- linkwarden
- memos
- paperless-ngx
version:
default: "auto"
description: Can be used to set a specific version. Use 'auto' for automatic version calculation
type: string
required: false
preview:
description: Suffix for a preview version
default: ""
type: string
required: false
jobs:
conventional-compliance:
uses: wittdennis/pipelines/.github/workflows/cog-validate.yaml@ec4833e22f9ab030d5c1393bc538c7fbe41885b0 # 2.0.24
release:
runs-on: ubuntu-24.04
needs: conventional-compliance
steps:
- uses: actions/checkout@df4cb1c069e1874edd31b4311f1884172cec0e10 # v6.0.3
with:
fetch-depth: 0
token: ${{ secrets.RELEASE_TOKEN }}
- name: setup git config
run: |
git config user.name github-actions
git config user.email github-actions@github.com
- name: install cocogitto
uses: cocogitto/cocogitto-action@52d0023b4396897f1815648e553db2ab8d782f3a # v4.2.0
with:
command: help
- name: install helm-docs
run: |
GOBIN=/usr/local/bin/ go install github.com/norwoodj/helm-docs/cmd/helm-docs@$HELM_DOCS_VERSION
env:
HELM_DOCS_VERSION: v1.14.2 # renovate: datasource=github-releases depName=norwoodj/helm-docs versioning=semver
- name: bump version
id: release
run: |
set -euo pipefail
COG_BUMP_ARGS=()
if [ "${VERSION}" = "auto" ]; then
COG_BUMP_ARGS+=(--auto)
else
COG_BUMP_ARGS+=(--version "$VERSION")
fi
COG_BUMP_ARGS+=(--package "$CHART")
PREVIEW=false
if [ -n "${PRE_RELEASE:-}" ]; then
COG_BUMP_ARGS+=(--pre "$PRE_RELEASE")
PREVIEW=true
fi
cog bump "${COG_BUMP_ARGS[@]}"
GIT_VERSION="$(git describe --tags "$(git rev-list --tags --max-count=1)")"
{
echo "preview=$PREVIEW"
echo "version=$GIT_VERSION"
} >> "$GITHUB_OUTPUT"
env:
CHART: ${{ inputs.chart }}
PRE_RELEASE: ${{ inputs.preview }}
VERSION: ${{ inputs.version }}
- name: generate changelog
run: cog changelog --at ${{ steps.release.outputs.version }} > GITHUB_CHANGELOG.md
- uses: softprops/action-gh-release@b4309332981a82ec1c5618f44dd2e27cc8bfbfda # v3.0.0
name: create release
with:
body_path: GITHUB_CHANGELOG.md
tag_name: ${{ steps.release.outputs.version }}
token: ${{ secrets.RELEASE_TOKEN }}
prerelease: ${{ steps.release.outputs.preview == 'true' }}