mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2025-03-08 13:19:05 +00:00
Update github-release.yml
This commit is contained in:
parent
134741f681
commit
53b30e5f15
39
.github/workflows/github-release.yml
vendored
39
.github/workflows/github-release.yml
vendored
@ -1,33 +1,45 @@
|
||||
name: Create new release
|
||||
name: Create Daily Release
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: '1 0 * * *' # Runs nightly
|
||||
- cron: '1 0 * * *' # Runs daily at 00:01 UTC
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
create-new-release:
|
||||
create-daily-release:
|
||||
runs-on: runner-cluster-htl-set
|
||||
permissions:
|
||||
contents: write
|
||||
steps:
|
||||
- name: Checkout code
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Parse CHANGELOG.md for yesterday's entries and create a new release
|
||||
- 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: Parse CHANGELOG.md and create release
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: |
|
||||
YESTERDAY=$(date -u --date="yesterday" +%Y-%m-%d)
|
||||
echo "Checking for changes on: $YESTERDAY"
|
||||
|
||||
# Crop the changelog first (keep first 20,000 characters)
|
||||
MAX_SIZE=20000
|
||||
head -c "$MAX_SIZE" CHANGELOG.md > changelog_cropped.md
|
||||
# Ensure yesterday's date exists in the changelog
|
||||
if ! grep -q "## $YESTERDAY" changelog_cropped.md; then
|
||||
echo "No entry found for $YESTERDAY, skipping release."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Extract exactly the section for YESTERDAY, stopping at the next date
|
||||
# Extract section for yesterday's date
|
||||
awk -v date="## $YESTERDAY" '
|
||||
$0 ~ date {found=1}
|
||||
found && /^## [0-9]{4}-[0-9]{2}-[0-9]{2}/ && $0 != date {exit}
|
||||
$0 ~ date {found=1; next}
|
||||
found && /^## [0-9]{4}-[0-9]{2}-[0-9]{2}/ {exit}
|
||||
found
|
||||
' changelog_cropped.md > changelog_tmp.md
|
||||
|
||||
@ -35,10 +47,11 @@ jobs:
|
||||
cat changelog_tmp.md
|
||||
echo "==========================="
|
||||
|
||||
# Skip if no content was found
|
||||
if [ ! -s changelog_tmp.md ]; then
|
||||
echo "No changes found for $YESTERDAY, skipping release."
|
||||
exit 0
|
||||
fi
|
||||
|
||||
echo "Creating GitHub release for $YESTERDAY..."
|
||||
gh release create "$YESTERDAY" -t "$YESTERDAY" -F changelog_tmp.md
|
||||
# Create GitHub release
|
||||
gh release create "$YESTERDAY" -t "$YESTERDAY" -F changelog_tmp.md
|
||||
|
Loading…
x
Reference in New Issue
Block a user