mirror of
https://github.com/ChrisTitusTech/winutil.git
synced 2024-11-14 14:45:52 -06:00
parent
8761f3b815
commit
86f8d567b9
36
.github/workflows/createchangelog.yml
vendored
36
.github/workflows/createchangelog.yml
vendored
@ -2,8 +2,7 @@ name: Update update.mb on Release
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
release:
|
release:
|
||||||
types: [published, prereleased]
|
types: [published]
|
||||||
workflow_dispatch: # Add this line to enable manual triggering
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
update-file:
|
update-file:
|
||||||
@ -13,23 +12,22 @@ jobs:
|
|||||||
- name: Checkout Repository
|
- name: Checkout Repository
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Get all releases and update update.mb file
|
- name: Get latest release and update update.mb file
|
||||||
run: |
|
run: |
|
||||||
# Fetch all releases including pre-releases using GitHub CLI
|
# Fetch the latest release using GitHub CLI
|
||||||
gh release list --limit 5 > releases.txt
|
latest_release=$(gh release view --json tagName,name,body --jq '{tag: .tagName, name: .name, body: .body}')
|
||||||
|
|
||||||
# Extract numeric versions and create update.mb content
|
# Extract details
|
||||||
echo "" > docs/update.mb
|
tag=$(echo "$latest_release" | jq -r '.tag')
|
||||||
while read -r line; do
|
name=$(echo "$latest_release" | jq -r '.name')
|
||||||
tag=$(echo "$line" | awk '{print $1}')
|
body=$(echo "$latest_release" | jq -r '.body')
|
||||||
name=$(echo "$line" | awk -F'\t' '{print $2}')
|
version_numeric=$(echo "$tag" | grep -o -E '[0-9.]+')
|
||||||
version_numeric=$(echo "$tag" | grep -o -E '[0-9.]+')
|
|
||||||
body=$(gh release view "$tag" --json body --jq .body)
|
# Append to update.mb
|
||||||
echo "## $version_numeric" >> docs/update.mb
|
echo "## $version_numeric" >> docs/update.mb
|
||||||
echo "Release name: $name" >> docs/update.mb
|
echo "Release name: $name" >> docs/update.mb
|
||||||
echo "Release body: $body" >> docs/update.mb
|
echo "Release body: $body" >> docs/update.mb
|
||||||
echo "" >> docs/update.mb
|
echo "" >> docs/update.mb
|
||||||
done < releases.txt
|
|
||||||
|
|
||||||
- name: Commit and Push Changes
|
- name: Commit and Push Changes
|
||||||
env:
|
env:
|
||||||
@ -38,5 +36,5 @@ jobs:
|
|||||||
git config --global user.name 'github-actions[bot]'
|
git config --global user.name 'github-actions[bot]'
|
||||||
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
|
git config --global user.email 'github-actions[bot]@users.noreply.github.com'
|
||||||
git add docs/update.mb
|
git add docs/update.mb
|
||||||
git commit -m "Update update.mb with all releases"
|
git commit -m "Update update.mb with latest release"
|
||||||
git push
|
git push
|
Loading…
Reference in New Issue
Block a user