Skip to content

Sync latest core release #198

Sync latest core release

Sync latest core release #198

name: Sync latest core release
# We pull from here to prevent too much coupling to the core repo.
on:
workflow_dispatch:
schedule:
- cron: "0 23 * * *"
jobs:
sync-core-release:
runs-on: ubuntu-latest
permissions:
contents: read
# Not required as we use CI_PAT directly so we can trigger workflows
# pull-requests: write
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.CI_PAT }}
- id: get-fb-release
run: |
curl -sSfl -H "Authorization: Bearer $GITHUB_TOKEN" https://api.github.com/repos/calyptia/calyptia-fluent-bit/releases/latest
LATEST_RELEASE_TAG=$(curl -sSfl -H "Authorization: Bearer $GITHUB_TOKEN" https://api.github.com/repos/calyptia/calyptia-fluent-bit/releases/latest|jq -r .tag_name)
echo "Found tag for latest release: $LATEST_RELEASE_TAG"
echo "tag=$LATEST_RELEASE_TAG" >> $GITHUB_OUTPUT
shell: bash
env:
GITHUB_TOKEN: ${{ secrets.CI_PAT }}
# Note we assume a simple version update so no chart version update
- name: Run the sed on the chart file
run: |
if [[ "$NEW_CALYPTIA_FB_VERSION" =~ ^v?([0-9]+\.[0-9]+\.[0-9]+)$ ]] ; then
NEW_CALYPTIA_FB_VERSION=${BASH_REMATCH[1]}
echo "Valid version string: $NEW_CALYPTIA_FB_VERSION"
else
echo "ERROR: Invalid semver string: $NEW_CALYPTIA_FB_VERSION"
exit 1
fi
sed -i "s/^version.*$/version: $NEW_CALYPTIA_FB_VERSION/g" ./charts/aws-fluent-bit/Chart.yaml
sed -i "s/^appVersion.*$/appVersion: v$NEW_CALYPTIA_FB_VERSION/g" ./charts/aws-fluent-bit/Chart.yaml
echo "chart version=$NEW_CALYPTIA_FB_VERSION" >> $GITHUB_OUTPUT
echo "app version=v$NEW_CALYPTIA_FB_VERSION" >> $GITHUB_OUTPUT
env:
NEW_CALYPTIA_FB_VERSION: ${{ steps.get-fb-release.outputs.tag }}
shell: bash
- name: Generate PR
uses: peter-evans/create-pull-request@v5
with:
commit-message: 'ci: update to latest LTS version'
signoff: true
branch: ci_update_lts
delete-branch: true
title: 'ci: update to latest LTS version'
# We need workflows permission so have to use the CI_PAT
token: ${{ secrets.CI_PAT }}
labels: ci,automerge
body: |
Update LTS version
- Created by ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
- Auto-generated by create-pull-request: https://github.com/peter-evans/create-pull-request
draft: false