Skip to content

Commit

Permalink
Reviewing the logic to release using manual triggering of the flow
Browse files Browse the repository at this point in the history
Signed-off-by: cmoulliard <cmoulliard@redhat.com>
  • Loading branch information
cmoulliard committed Sep 21, 2023
1 parent d333bb5 commit 5ba4cae
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 14 deletions.
28 changes: 15 additions & 13 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
name: Release Godaddy Webhook Helm Chart
on:
push:
tags: [ v* ]
workflow_dispatch:
inputs:
version:
description: 'The version you want to release (e.g 0.2.0).'
required: true

jobs:
release:
runs-on: ubuntu-latest
Expand All @@ -24,29 +28,27 @@ jobs:
- name: Install Helm
uses: azure/setup-helm@v3

- name: Create release branch
run: git checkout -b release/${{ github.event.inputs.version }}

- name: Tag chart and image version
id: tag-chart
run: |
TAG_NAME="${{ github.ref_name }}"
echo "Tag Name: ${TAG_NAME}"
export TAG_VERSION=${TAG_NAME:1}
export TAG_VERSION=${{ github.event.inputs.version }}
echo "Tag version: ${TAG_VERSION}"
yq '.appVersion = env(TAG_VERSION)' -i ./deploy/charts/godaddy-webhook/Chart.yaml
yq '.image.tag = env(TAG_VERSION)' -i ./deploy/charts/godaddy-webhook/values.yaml
git config user.email "github-actions@github.com"
git config user.name "GitHub Actions"
git add ./deploy/charts/godaddy-webhook/Chart.yaml
git add ./deploy/charts/godaddy-webhook/values.yaml
git commit -m "Update Helm chart version to $TAG_VERSION"
echo "TAG_VERSION=${TAG_VERSION}" >> "${GITHUB_OUTPUT}"
git commit -asm "Update Helm chart version to $TAG_VERSION"
git push origin release/${TAG_VERSION}
git tag v${TAG_VERSION}
git push origin v${TAG_VERSION}
#TODO: Find a better way to psuh on a tag OR to not push a commit on a tag
git tag -f ${TAG_NAME}
git push origin --force ${TAG_NAME}
echo "TAG_VERSION=${TAG_VERSION}" >> "${GITHUB_OUTPUT}"
- name: Login to Quay.io Hub
uses: docker/login-action@v1
Expand Down
2 changes: 1 addition & 1 deletion deploy/charts/godaddy-webhook/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ apiVersion: v1
appVersion: "0.1.0"
description: Cert Manager godaddy webhook Helm chart
name: godaddy-webhook
version: 0.1.1
version: "0.1.0"

0 comments on commit 5ba4cae

Please sign in to comment.