Rework helm release process

This was mostly me working around a limitation in chart-releaser where it does not allow for uploading a chart to an existing release.
This commit is contained in:
Shane McDonald
2022-05-02 12:35:39 -04:00
parent 191be7bf3c
commit 46586bd7b6
7 changed files with 81 additions and 57 deletions

View File

@@ -1,43 +0,0 @@
---
name: helm-release
on:
release:
types: [published]
jobs:
release:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Configure Git
run: |
git config user.name "$GITHUB_ACTOR"
git config user.email "$GITHUB_ACTOR@users.noreply.github.com"
- name: Install Helm
uses: azure/setup-helm@v1
with:
version: v3.7.1
- name: Create Helm chart
run: |
echo VERSION: $VERSION
make helm-chart
env:
VERSION: ${{ github.ref_name }}
# Reinventing the wheel if/until https://github.com/helm/chart-releaser-action/pull/96 is merged
- name: Release Helm chart
run: |
echo VERSION: $VERSION
make helm-release
env:
VERSION: ${{ github.ref_name }}
CR_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_REPO_OWNER: ${{ github.repository_owner }}

View File

@@ -8,6 +8,8 @@ jobs:
promote:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Log in to GHCR
run: |
echo ${{ secrets.GITHUB_TOKEN }} | docker login ghcr.io -u ${{ github.actor }} --password-stdin
@@ -23,3 +25,16 @@ jobs:
docker tag ghcr.io/${{ github.repository }}:${{ github.event.release.tag_name }} quay.io/${{ github.repository }}:latest
docker push quay.io/${{ github.repository }}:${{ github.event.release.tag_name }}
docker push quay.io/${{ github.repository }}:latest
- name: Configure git
run: |
git config user.name "$GITHUB_ACTOR"
git config user.email "$GITHUB_ACTOR@users.noreply.github.com"
- name: Release Helm chart
run: |
ansible-playbook ansible/helm-release.yml -v \
-e operator_image=quay.io/${{ github.repository }} \
-e chart_owner=${{ github.repository_owner }} \
-e tag=${{ github.event.release.tag_name }} \
-e gh_token=${{ secrets.GITHUB_TOKEN }}