Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 18 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,25 @@ jobs:
- name: Build distribution files
run: npm run build

- name: Verify build output
run: |
echo "📁 Contents of dist directory:"
ls -la dist/
echo ""
echo "🔍 Checking subdirectories:"
find dist/ -type f -name "*" | head -20
echo ""
echo "📊 Total files built:"
find dist/ -type f | wc -l

- name: Zip distribution files
uses: montudor/action-zip@v1
with:
args: 'zip -qq astero-admin-${{env.RELEASE_VERSION}}.zip dist'
run: |
echo "🗜️ Creating zip file..."
cd dist
zip -r ../astero-admin-${{env.RELEASE_VERSION}}.zip . -x "*.DS_Store" "*/.DS_Store"
cd ..
echo "✅ Zip file created:"
ls -la astero-admin-${{env.RELEASE_VERSION}}.zip

- name: Generate awesome changelog
id: changelog
Expand Down
119 changes: 119 additions & 0 deletions .github/workflows/update-changelog.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
name: '📝 Update Changelog'

on:
release:
types: [published]
workflow_dispatch:
inputs:
version:
description: 'Version to generate changelog for'
required: false
default: 'latest'

permissions:
contents: write
pull-requests: write

jobs:
update-changelog:
runs-on: ubuntu-latest
steps:
- name: 📥 Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
ref: main
token: ${{ secrets.GITHUB_TOKEN }}

- name: 🏷️ Get release info
id: release_info
run: |
if [ "${{ github.event_name }}" = "release" ]; then
echo "version=${{ github.event.release.tag_name }}" >> $GITHUB_OUTPUT
echo "release_notes<<EOF" >> $GITHUB_OUTPUT
echo "${{ github.event.release.body }}" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
echo "release_date=$(date -d '${{ github.event.release.published_at }}' '+%Y-%m-%d')" >> $GITHUB_OUTPUT
else
LATEST_TAG=$(git describe --tags --abbrev=0)
echo "version=${LATEST_TAG}" >> $GITHUB_OUTPUT
echo "release_date=$(date '+%Y-%m-%d')" >> $GITHUB_OUTPUT
echo "release_notes=Manual changelog update" >> $GITHUB_OUTPUT
fi

- name: 📝 Update CHANGELOG.md
id: update_changelog
run: |
VERSION="${{ steps.release_info.outputs.version }}"
RELEASE_DATE="${{ steps.release_info.outputs.release_date }}"
RELEASE_NOTES="${{ steps.release_info.outputs.release_notes }}"

# Create CHANGELOG.md if it doesn't exist
if [ ! -f CHANGELOG.md ]; then
cat > CHANGELOG.md << 'EOF'
# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

EOF
fi

# Prepare the new entry
NEW_ENTRY=$(cat << EOF

## [${VERSION}] - ${RELEASE_DATE}

${RELEASE_NOTES}

EOF
)

# Check if this version already exists
if grep -q "## \[${VERSION}\]" CHANGELOG.md; then
echo "Version ${VERSION} already exists in changelog"
echo "changes=false" >> $GITHUB_OUTPUT
else
# Insert new entry after the header (before the first ## entry)
if grep -q "^## \[" CHANGELOG.md; then
# Find the first release entry and insert before it
awk -v new_entry="$NEW_ENTRY" '
/^## \[/ && !inserted {
print new_entry
inserted = 1
}
{ print }
' CHANGELOG.md > CHANGELOG.tmp && mv CHANGELOG.tmp CHANGELOG.md
else
# No releases yet, append to end
echo "$NEW_ENTRY" >> CHANGELOG.md
fi
echo "changes=true" >> $GITHUB_OUTPUT
echo "✅ Added ${VERSION} to CHANGELOG.md"
fi

- name: 🔍 Show changelog changes
if: steps.update_changelog.outputs.changes == 'true'
run: |
echo "📄 Updated CHANGELOG.md:"
echo "----------------------------------------"
head -30 CHANGELOG.md

- name: 💾 Commit changes
if: steps.update_changelog.outputs.changes == 'true'
run: |
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git add CHANGELOG.md
git commit -m "📝 Update CHANGELOG.md for ${{ steps.release_info.outputs.version }}" || exit 0
git push

- name: ✅ Summary
run: |
if [ "${{ steps.update_changelog.outputs.changes }}" = "true" ]; then
echo "🎉 Successfully updated CHANGELOG.md with version ${{ steps.release_info.outputs.version }}"
else
echo "ℹ️ No changes needed - version already exists in changelog"
fi
28 changes: 28 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

### Added
- Automatic changelog management with GitHub Actions
- Professional release notes generation
- Enhanced build process with verification steps

### Changed
- Improved zip file packaging for releases
- Updated release workflow with better changelog generation

### Fixed
- Empty dist folder issue in release zip files

## [1.0.8] - 2024-01-XX

### Added
- Initial release of Astero Admin Template
- Bootstrap 5 admin template
- Responsive design
- Modern UI components