winutil/.github/workflows/createchangelog.yml

43 lines
1.4 KiB
YAML
Raw Normal View History

2024-07-16 05:58:13 -05:00
name: Update update.mb on Release
2024-07-13 10:58:07 -05:00
on:
release:
2024-07-16 10:59:43 -05:00
types: [published, prereleased]
workflow_dispatch: # Add this line to enable manual triggering
2024-07-13 10:58:07 -05:00
jobs:
2024-07-16 05:58:13 -05:00
update-file:
2024-07-13 10:58:07 -05:00
runs-on: ubuntu-latest
2024-07-16 05:58:13 -05:00
2024-07-13 10:58:07 -05:00
steps:
2024-07-16 05:58:13 -05:00
- name: Checkout Repository
uses: actions/checkout@v2
2024-07-16 06:01:15 -05:00
- name: Get all releases and update update.mb file
2024-07-16 05:58:13 -05:00
run: |
2024-07-16 10:59:43 -05:00
# Fetch all releases including pre-releases using GitHub CLI
2024-07-16 14:25:00 -05:00
gh release list --limit 5 > releases.txt
2024-07-16 06:01:15 -05:00
# Extract numeric versions and create update.mb content
echo "" > docs/update.mb
while read -r line; do
tag=$(echo "$line" | awk '{print $1}')
name=$(echo "$line" | awk -F'\t' '{print $2}')
version_numeric=$(echo "$tag" | grep -o -E '[0-9.]+')
body=$(gh release view "$tag" --json body --jq .body)
echo "## $version_numeric" >> docs/update.mb
echo "Release name: $name" >> docs/update.mb
echo "Release body: $body" >> docs/update.mb
echo "" >> docs/update.mb
done < releases.txt
2024-07-16 05:58:13 -05:00
- name: Commit and Push Changes
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git config --global user.name 'github-actions[bot]'
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
git add docs/update.mb
2024-07-16 06:01:15 -05:00
git commit -m "Update update.mb with all releases"
2024-07-16 05:58:13 -05:00
git push