Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update release action to auto release kustomize yaml's as assets #1371

Merged
merged 8 commits into from
Jan 14, 2024
22 changes: 19 additions & 3 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ on:
tags:
- v5.*

permissions:
contents: write

jobs:
helm:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -35,7 +38,11 @@ jobs:
uses: fluxcd/flux2/[email protected]
- name: Clone repo
uses: actions/checkout@v4

- name: Create Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release create --draft --generate-notes "${{ github.ref_name }}"
NissesSenap marked this conversation as resolved.
Show resolved Hide resolved
- name: Prepare
run: |
# OCI standard enforces lower-case paths
Expand All @@ -62,6 +69,15 @@ jobs:
--path="./deploy/kustomize" \
--source="${{ github.event.repository.html_url }}" \
--revision="${GITHUB_REF_NAME}/${GITHUB_SHA}"
- name: update-kustomize-assert
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
kustomize build deploy/kustomize/base > kustomize-base.yaml
NissesSenap marked this conversation as resolved.
Show resolved Hide resolved
for d in deploy/kustomize/overlays/*/ ; do
kustomize build "$d" > kustomize-$(basename "$d").yaml
done
gh release upload "${{ github.ref_name }}" kustomize-*.yaml

image:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -99,7 +115,7 @@ jobs:
- name: Build and push
run: |
declare -a arr=("quay.io/grafana-operator/grafana-operator" "ghcr.io/${{ github.repository }}" )

for i in "${arr[@]}"
do
export KO_DOCKER_REPO=${i}
Expand All @@ -111,4 +127,4 @@ jobs:
--image-label org.opencontainers.image.version=${{ github.ref_name }} \
--image-label org.opencontainers.image.created=${{ env.BUILD_DATE }}
done