Skip to content

Commit e6f2067

Browse files
authored
chore(gh): weekly release (#892)
Signed-off-by: Dario Tranchitella <[email protected]>
1 parent 0990317 commit e6f2067

File tree

2 files changed

+56
-0
lines changed

2 files changed

+56
-0
lines changed

.github/release-template.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
This edge release can be pulled from Docker Hub as follows:
2+
3+
```
4+
docker pull clastix/kamaji:$TAG
5+
```
6+
7+
> As from the v1.0.0 release, CLASTIX no longer provides stable release artefacts.
8+
>
9+
> Stable release artefacts are offered on a subscription basis by CLASTIX, the main Kamaji project contributor.
10+
> Learn more from CLASTIX's [Support](https://clastix.io/support/) section.

.github/workflows/release.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Weekly Edge Release
2+
3+
on:
4+
schedule:
5+
- cron: '0 7 * * 1' # Every Monday at 9 AM CET
6+
workflow_dispatch:
7+
8+
permissions:
9+
contents: write
10+
11+
jobs:
12+
release:
13+
runs-on: ubuntu-22.04
14+
steps:
15+
- uses: actions/checkout@v4
16+
with:
17+
fetch-depth: 0
18+
- name: generating date metadata
19+
id: date
20+
run: |
21+
CURRENT_DATE=$(date -u +'%Y-%m-%d')
22+
YY=$(date -u +'%y')
23+
M=$(date -u +'%_m' | sed 's/ //g')
24+
FIRST_OF_MONTH=$(date -u -d "$CURRENT_DATE" +%Y-%m-01)
25+
WEEK_NUM=$(( (($(date -u +%s) - $(date -u -d "$FIRST_OF_MONTH" +%s)) / 86400 + $(date -u -d "$FIRST_OF_MONTH" +%u) - 1) / 7 + 1 ))
26+
27+
echo "yy=$YY" >> $GITHUB_OUTPUT
28+
echo "month=$M" >> $GITHUB_OUTPUT
29+
echo "week=$WEEK_NUM" >> $GITHUB_OUTPUT
30+
echo "date=$CURRENT_DATE" >> $GITHUB_OUTPUT
31+
- name: generating tag metadata
32+
id: tag
33+
run: |
34+
TAG="edge-${{ steps.date.outputs.yy }}.${{ steps.date.outputs.month }}.${{ steps.date.outputs.week }}"
35+
echo "tag=$TAG" >> $GITHUB_OUTPUT
36+
- name: generate release notes from template
37+
run: |
38+
export TAG="${{ steps.tag.outputs.tag }}"
39+
envsubst < .github/release-template.md > release-notes.md
40+
- name: create GitHub release
41+
env:
42+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
43+
run: |
44+
gh release create "${{ steps.tag.outputs.tag }}" \
45+
--title "${{ steps.tag.outputs.tag }}" \
46+
--notes-file release-notes.md

0 commit comments

Comments
 (0)