Skip to content

Merge pull request #6 from kilnfi/renovate/github.com-spf13-cobra-1.x #2

Merge pull request #6 from kilnfi/renovate/github.com-spf13-cobra-1.x

Merge pull request #6 from kilnfi/renovate/github.com-spf13-cobra-1.x #2

Workflow file for this run

name: Release
on:
push:
tags:
- '*'
permissions:
contents: write
packages: write
env:
CHART_NAME: cardano-validator-watcher
CHART_DIRECTORY: charts
REGISTRY: oci://ghcr.io/kilnfi/charts
jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
fetch-tags: true
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: 1.22
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v6
with:
distribution: goreleaser
version: '~> v2'
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
helm-release:
runs-on: ubuntu-latest
needs: goreleaser
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Helm
uses: azure/setup-helm@v4.2.0
with:
version: v3.16.4
- name: Verify Chart Version
run: |
TAG=$(echo ${{ github.ref_name }} | sed 's/v//')
CHART_VERSION=$(yq -r .version ${{ env.CHART_DIRECTORY }}/${{ env.CHART_NAME }}/Chart.yaml)
if [ "$TAG" != "${CHART_VERSION}" ]; then
echo "Version mismatch: release tag ${TAG} does not match Chart.yaml version ${CHART_VERSION}"
exit 1
fi
echo "CHART_VERSION=$CHART_VERSION" >> $GITHUB_ENV
- name: Helm Registry Login
run: |
echo ${{ secrets.GITHUB_TOKEN }} | helm registry login ghcr.io --username ${{ env.USERNAME }} --password-stdin
env:
USERNAME: kilnfi
- name: 'Helm Package'
id: helm-package
run: |
helm package ${{ env.CHART_DIRECTORY }}/${{ env.CHART_NAME }} --version $CHART_VERSION
- name: 'Helm Push'
run: |
helm push ./cardano-validator-watcher-$CHART_VERSION.tgz ${{ env.REGISTRY }}