1
0
mirror of https://github.com/community-scripts/ProxmoxVE.git synced 2025-03-08 13:19:05 +00:00
ProxmoxVE/.github/workflows/github-release.yml

54 lines
1.6 KiB
YAML
Raw Normal View History

2025-03-01 20:20:41 +01:00
name: Create Daily Release
on:
schedule:
2025-03-01 20:20:41 +01:00
- cron: '1 0 * * *' # Runs daily at 00:01 UTC
2025-03-01 13:10:23 +01:00
workflow_dispatch:
jobs:
2025-03-01 20:20:41 +01:00
create-daily-release:
runs-on: runner-cluster-htl-set
permissions:
contents: write
steps:
2025-03-01 20:20:41 +01:00
- name: Checkout repository
uses: actions/checkout@v4
2025-03-01 13:10:23 +01:00
2025-03-01 20:20:41 +01:00
- name: Extract first 5000 characters from CHANGELOG.md
run: head -c 5000 CHANGELOG.md > changelog_cropped.md
- name: Debugging - Show extracted changelog
run: |
echo "=== CHANGELOG EXCERPT ==="
cat changelog_cropped.md
echo "========================="
- name: Extract relevant changelog section
run: |
YESTERDAY=$(date -u --date="yesterday" +%Y-%m-%d)
2025-03-01 20:20:41 +01:00
echo "Checking for changes on: $YESTERDAY"
2025-03-01 13:10:23 +01:00
# Extract relevant section from cropped changelog
2025-03-01 13:10:23 +01:00
awk -v date="## $YESTERDAY" '
2025-03-01 20:20:41 +01:00
$0 ~ date {found=1; next}
found && /^## [0-9]{4}-[0-9]{2}-[0-9]{2}/ {exit}
2025-03-01 13:28:57 +01:00
found
' changelog_cropped.md > changelog_tmp.md
2025-03-01 13:10:23 +01:00
2025-03-01 13:23:44 +01:00
echo "=== Extracted Changelog ==="
cat changelog_tmp.md
echo "==========================="
2025-03-01 13:20:05 +01:00
2025-03-01 20:20:41 +01:00
# Skip if no content was found
2025-03-01 13:10:23 +01:00
if [ ! -s changelog_tmp.md ]; then
echo "No changes found for $YESTERDAY, skipping release."
exit 0
2025-03-01 10:29:07 +01:00
fi
2025-03-01 13:10:23 +01:00
- name: Create GitHub release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
YESTERDAY=$(date -u --date="yesterday" +%Y-%m-%d)
2025-03-01 20:20:41 +01:00
gh release create "$YESTERDAY" -t "$YESTERDAY" -F changelog_tmp.md