Skip to content

Commit 4b375fa

Browse files
authored
Add automated release job (#3)
Create a new release daily as a heartbeat monitor for downstream syncs and automations. <!-- TODO list --> TODO: - [ ] Write new tests or update the old ones to cover new functionality. - [ ] Update doc-strings where appropriate. - [ ] Update or write new documentation in `packit/packit.dev`. - [ ] ‹fill in› <!-- notes for reviewers --> <!-- Links to other issues or pull requests, for cross-repository links use: ‹namespace›/‹repository›#‹ID of issue› (‹namespace›/‹repository›!‹ID of PR› respectively) --> Fixes Related to Merge before/after <!-- release notes footer --> RELEASE NOTES BEGIN Packit now supports automatic ordering of ☕ after all checks pass. RELEASE NOTES END
2 parents fecc97d + 1c331d4 commit 4b375fa

1 file changed

Lines changed: 37 additions & 0 deletions

File tree

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Daily Release
2+
# Release a new version daily as a heartbeat for downstream automation.
3+
4+
on:
5+
schedule:
6+
# Run every day at 23:00 UTC
7+
- cron: '0 23 * * *'
8+
workflow_dispatch: # Allow manual trigger for testing
9+
10+
jobs:
11+
release:
12+
runs-on: ubuntu-latest
13+
permissions:
14+
contents: write # Required to create releases
15+
steps:
16+
- uses: actions/checkout@v4
17+
with:
18+
fetch-depth: 0
19+
20+
- name: Get next version
21+
id: version
22+
run: |
23+
git fetch --tags
24+
LATEST=$(git tag -l '0.*' 'v0.*' 2>/dev/null | sed 's/^v//' | sort -V | tail -n 1)
25+
PATCH=$(echo "$LATEST" | cut -d. -f3)
26+
NEW_PATCH=$((PATCH + 1))
27+
MAJOR=$(echo "$LATEST" | cut -d. -f1)
28+
MINOR=$(echo "$LATEST" | cut -d. -f2)
29+
echo "version=${MAJOR}.${MINOR}.${NEW_PATCH}" >> $GITHUB_OUTPUT
30+
31+
- name: Create Release
32+
env:
33+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
34+
run: |
35+
gh release create ${{ steps.version.outputs.version }} \
36+
--title "Daily Release ${{ steps.version.outputs.version }}" \
37+
--generate-notes

0 commit comments

Comments
 (0)