From e6f20674ecd1e7ed38d35450bb8c4078036283dd Mon Sep 17 00:00:00 2001 From: Dario Tranchitella Date: Fri, 25 Jul 2025 16:14:27 +0200 Subject: [PATCH] chore(gh): weekly release (#892) Signed-off-by: Dario Tranchitella --- .github/release-template.md | 10 ++++++++ .github/workflows/release.yml | 46 +++++++++++++++++++++++++++++++++++ 2 files changed, 56 insertions(+) create mode 100644 .github/release-template.md create mode 100644 .github/workflows/release.yml diff --git a/.github/release-template.md b/.github/release-template.md new file mode 100644 index 0000000..89331dc --- /dev/null +++ b/.github/release-template.md @@ -0,0 +1,10 @@ +This edge release can be pulled from Docker Hub as follows: + +``` +docker pull clastix/kamaji:$TAG +``` + +> As from the v1.0.0 release, CLASTIX no longer provides stable release artefacts. +> +> Stable release artefacts are offered on a subscription basis by CLASTIX, the main Kamaji project contributor. +> Learn more from CLASTIX's [Support](https://clastix.io/support/) section. diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..6d95243 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,46 @@ +name: Weekly Edge Release + +on: + schedule: + - cron: '0 7 * * 1' # Every Monday at 9 AM CET + workflow_dispatch: + +permissions: + contents: write + +jobs: + release: + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: generating date metadata + id: date + run: | + CURRENT_DATE=$(date -u +'%Y-%m-%d') + YY=$(date -u +'%y') + M=$(date -u +'%_m' | sed 's/ //g') + FIRST_OF_MONTH=$(date -u -d "$CURRENT_DATE" +%Y-%m-01) + WEEK_NUM=$(( (($(date -u +%s) - $(date -u -d "$FIRST_OF_MONTH" +%s)) / 86400 + $(date -u -d "$FIRST_OF_MONTH" +%u) - 1) / 7 + 1 )) + + echo "yy=$YY" >> $GITHUB_OUTPUT + echo "month=$M" >> $GITHUB_OUTPUT + echo "week=$WEEK_NUM" >> $GITHUB_OUTPUT + echo "date=$CURRENT_DATE" >> $GITHUB_OUTPUT + - name: generating tag metadata + id: tag + run: | + TAG="edge-${{ steps.date.outputs.yy }}.${{ steps.date.outputs.month }}.${{ steps.date.outputs.week }}" + echo "tag=$TAG" >> $GITHUB_OUTPUT + - name: generate release notes from template + run: | + export TAG="${{ steps.tag.outputs.tag }}" + envsubst < .github/release-template.md > release-notes.md + - name: create GitHub release + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + gh release create "${{ steps.tag.outputs.tag }}" \ + --title "${{ steps.tag.outputs.tag }}" \ + --notes-file release-notes.md