Skip to content

Commit

Permalink
[50] Add github release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
hiddenmarten committed Mar 31, 2024
1 parent 114e511 commit c03800f
Show file tree
Hide file tree
Showing 3 changed files with 70 additions and 2 deletions.
68 changes: 68 additions & 0 deletions .github/workflows/helm-publish.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: Docker publish

# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.

on:
push:
# Publish semver tags as releases.
tags: [ 'v*.*.*' ]

env:
# Use docker.io for Docker Hub if empty
REGISTRY: ghcr.io
# github.repository as <account>/<repo>
CHARTS_REGISTRY: ${{ github.repository_owner }}/charts
CHART_NAME: etcd-operator


jobs:
build:
runs-on: ubuntu-22.04
permissions:
contents: read
packages: write
# This is used to complete the identity challenge
# with sigstore/fulcio when running outside of PRs.
id-token: write

steps:
- name: Checkout repository
uses: actions/checkout@v4.1.1

- name: Install Helm
uses: azure/setup-helm@v4.1.0
with:
version: 'v3.14.3'

- name: Get latest tag
run: |
git fetch --tags
TAG=$(git describe --tags `git rev-list --tags --max-count=1`)
echo "Latest tag on current commit is $TAG"
echo "LATEST_TAG=${TAG}" >> $GITHUB_ENV
echo "LATEST_TAG_TRIMMED_V=${TAG#v}" >> $GITHUB_ENV
- name: Helm login registry
working-directory: charts
run: |
helm registry login \
--username ${{ github.actor }} \
--password ${{ secrets.GITHUB_TOKEN }} \
${{ env.CHARTS_REGISTRY }}
- name: Helm package chart
working-directory: charts
run: |
helm package ${{ env.CHART_NAME }} \
--version ${LATEST_TAG_TRIMMED_V} \
--app-version ${LATEST_TAG} \
--dependency-update
- name: Helm push chart
working-directory: charts
run: |
helm push ${{ env.CHART_NAME }}-${LATEST_TAG_TRIMMED_V}.tgz \
oci://${{ env.CHARTS_REGISTRY }}
2 changes: 1 addition & 1 deletion charts/etcd-operator/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ apiVersion: v2
name: etcd-operator
type: application
version: 0.0.1
appVersion: "0.0.1"
appVersion: "v0.0.1"
2 changes: 1 addition & 1 deletion charts/etcd-operator/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# etcd-operator

![Version: 0.0.1](https://img.shields.io/badge/Version-0.0.1-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.0.1](https://img.shields.io/badge/AppVersion-0.0.1-informational?style=flat-square)
![Version: 0.0.1](https://img.shields.io/badge/Version-0.0.1-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: v0.0.1](https://img.shields.io/badge/AppVersion-v0.0.1-informational?style=flat-square)

## Values

Expand Down

0 comments on commit c03800f

Please sign in to comment.