Skip to content

[INTERNAL] Log scrape timing #2

[INTERNAL] Log scrape timing

[INTERNAL] Log scrape timing #2

Workflow file for this run

name: release
on:
push:
tags: [ '*' ]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
# GitHub Container Registry
GHCR_REGISTRY: ghcr.io
# github.repository as <account>/<repo>
GHCR_IMAGE_NAME: ${{ github.repository }}
jobs:
prepare:
runs-on: ubuntu-latest
permissions:
contents: read
outputs:
tag: ${{ steps.vars.outputs.tag }}
built_at: ${{ steps.date.outputs.built_at }}
steps:
- name: Get tag name
id: vars
run: echo "tag=${GITHUB_REF:10}" >> $GITHUB_OUTPUT
- name: Set Release Date
id: date
run: |
echo "built_at=$(date --rfc-3339=date)" >> $GITHUB_OUTPUT
release-docker-image:
runs-on: ubuntu-latest
needs: [prepare]
permissions:
contents: read
packages: write
steps:
- name: Checkout code
uses: actions/checkout@v5
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log into GitHub Container Registry ${{ env.GHCR_REGISTRY }}
uses: docker/login-action@v3
with:
registry: ${{ env.GHCR_REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@v5
with:
images: |
${{ env.GHCR_REGISTRY }}/${{ env.GHCR_IMAGE_NAME }}
tags: |
type=ref,event=tag
labels: |
org.opencontainers.image.description=KMinion - Prometheus Exporter for Apache Kafka
- name: Build and push Docker image
uses: docker/build-push-action@v6
with:
context: .
platforms: linux/amd64,linux/arm64
build-args: |
VERSION=${{ fromJSON(steps.meta.outputs.json).labels['org.opencontainers.image.version'] }}
BUILT_AT=${{ needs.prepare.outputs.built_at }}
COMMIT=${{ github.sha }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
annotations: ${{ steps.meta.outputs.annotations }}
push: ${{ startsWith(github.ref, 'refs/tags/') }}
release-helm:
runs-on: ubuntu-latest
needs: [prepare, release-docker-image]
permissions:
contents: read
packages: write
steps:
- name: Checkout code
uses: actions/checkout@v5
- name: Update Chart.yaml version, values.yaml image tag, and README.md
run: |
sed -i "s/^version:.*/version: \"${{ needs.prepare.outputs.tag }}\"/" charts/kminion/Chart.yaml
sed -i "s/^appVersion:.*/appVersion: \"${{ needs.prepare.outputs.tag }}\"/" charts/kminion/Chart.yaml
# Ensure consistent space-based indentation and update tag
sed -i 's/\t/ /g' charts/kminion/values.yaml
sed -i "/^image:/,/^[^[:space:]]/ { /^[[:space:]]*tag:.*/s/tag:.*/tag: \"${{ needs.prepare.outputs.tag }}\"/; }" charts/kminion/values.yaml
# Update README.md version references if README exists
if [ -f charts/kminion/README.md ]; then
sed -i "s/--version [0-9]\+\.[0-9]\+\.[0-9]\+-[a-zA-Z0-9-]\+/--version ${{ needs.prepare.outputs.tag }}/g" charts/kminion/README.md
sed -i "s/\`[0-9]\+\.[0-9]\+\.[0-9]\+-[a-zA-Z0-9-]\+\`/\`${{ needs.prepare.outputs.tag }}\`/g" charts/kminion/README.md
fi
- name: Push Helm Chart to GHCR
uses: appany/[email protected]
with:
name: kminion
repository: ${{ github.repository_owner }}/helm-charts
tag: ${{ needs.prepare.outputs.tag }}
path: charts/kminion
registry: ${{ env.GHCR_REGISTRY }}
registry_username: ${{ github.actor }}
registry_password: ${{ secrets.GITHUB_TOKEN }}
update_dependencies: 'true'