Skip to content

chore: update CHANGELOG.md for zmNinjaNG-1.1.4 #43

chore: update CHANGELOG.md for zmNinjaNG-1.1.4

chore: update CHANGELOG.md for zmNinjaNG-1.1.4 #43

Workflow file for this run

name: Create Release
on:
push:
tags:
- 'zmNinjaNG-*'
permissions:
contents: write
jobs:
create-release:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: '3.3'
- name: Install github_changelog_generator
run: gem install github_changelog_generator
- name: Get previous tag
id: prev_tag
run: |
CURRENT_TAG="${{ github.ref_name }}"
PREV_TAG=$(git tag --sort=-version:refname | grep -A1 "^${CURRENT_TAG}$" | tail -1)
echo "previous_tag=${PREV_TAG}" >> $GITHUB_OUTPUT
echo "Previous tag: ${PREV_TAG}"
- name: Generate changelog
env:
CHANGELOG_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
github_changelog_generator \
--since-tag "${{ steps.prev_tag.outputs.previous_tag }}" \
--output /tmp/changelog-raw.md
# Extract just the latest version section (skip header and footer)
sed -n '/^## \[/,/^\* \*This Changelog/p' /tmp/changelog-raw.md | head -n -2 > /tmp/changelog-section.md
- name: Prepare release notes
run: |
# Add header, changelog content, then append install notes
echo -e "## 📋 Changelog\n" > /tmp/changelog.md
cat /tmp/changelog-section.md >> /tmp/changelog.md
echo -e "\n---\n" >> /tmp/changelog.md
cat .github/workflows/_RELEASE_NOTE_INSERT.md >> /tmp/changelog.md
- name: Create GitHub Release
env:
GH_TOKEN: ${{ github.token }}
run: |
CURRENT_TAG="${{ github.ref_name }}"
# Check if release already exists
if gh release view "$CURRENT_TAG" >/dev/null 2>&1; then
echo "Release $CURRENT_TAG already exists, updating notes"
gh release edit "$CURRENT_TAG" --notes-file /tmp/changelog.md
else
echo "Creating release $CURRENT_TAG"
gh release create "$CURRENT_TAG" \
--title "$CURRENT_TAG" \
--notes-file /tmp/changelog.md \
--draft=false \
--prerelease=false
fi
echo "✅ Release $CURRENT_TAG created with changelog"