2024-07-16 10:55:30 -05:00
|
|
|
name: Update update.mb on Release
|
|
|
|
|
2024-07-13 10:58:07 -05:00
|
|
|
on:
|
|
|
|
release:
|
|
|
|
types: [published]
|
|
|
|
|
|
|
|
jobs:
|
2024-07-16 10:55:30 -05:00
|
|
|
update-file:
|
2024-07-13 10:58:07 -05:00
|
|
|
runs-on: ubuntu-latest
|
2024-07-16 10:55:30 -05:00
|
|
|
|
2024-07-13 10:58:07 -05:00
|
|
|
steps:
|
2024-07-16 10:55:30 -05:00
|
|
|
- name: Checkout Repository
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
|
2024-07-16 13:10:23 -05:00
|
|
|
- name: Get latest release and update update.mb file
|
2024-07-16 10:55:30 -05:00
|
|
|
run: |
|
2024-07-16 13:10:23 -05:00
|
|
|
# Fetch the latest release using GitHub CLI
|
|
|
|
latest_release=$(gh release view --json tagName,name,body --jq '{tag: .tagName, name: .name, body: .body}')
|
2024-07-16 10:55:30 -05:00
|
|
|
|
2024-07-16 13:10:23 -05:00
|
|
|
# Extract details
|
|
|
|
tag=$(echo "$latest_release" | jq -r '.tag')
|
|
|
|
name=$(echo "$latest_release" | jq -r '.name')
|
|
|
|
body=$(echo "$latest_release" | jq -r '.body')
|
|
|
|
version_numeric=$(echo "$tag" | grep -o -E '[0-9.]+')
|
|
|
|
|
|
|
|
# Append to update.mb
|
|
|
|
echo "## $version_numeric" >> docs/update.mb
|
|
|
|
echo "Release name: $name" >> docs/update.mb
|
|
|
|
echo "Release body: $body" >> docs/update.mb
|
|
|
|
echo "" >> docs/update.mb
|
2024-07-16 10:55:30 -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 13:10:23 -05:00
|
|
|
git commit -m "Update update.mb with latest release"
|
2024-07-16 13:14:55 -05:00
|
|
|
git push
|