From c035b66445aac1f922d90d55db98294388d29226 Mon Sep 17 00:00:00 2001 From: Azad Shaikh Date: Wed, 4 Jun 2025 22:32:57 +0530 Subject: [PATCH 1/2] Update version to 1.0.9 in package.json and enhance GitHub Actions workflow with build output verification and improved zip file creation process. --- .github/workflows/release.yml | 21 ++++++++++++++++++--- package.json | 2 +- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index bf1c3263..56e98f77 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -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 diff --git a/package.json b/package.json index 2a907280..4c35d67e 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "asteroadmin", "description": "Free Bootstrap 5 Admin Template.", - "version": "1.0.8", + "version": "1.0.9", "license": "MIT", "author": "AsteroDigital ", "type": "module", From 7aea61f82cd884af93a2fbc740332d7951cc0b01 Mon Sep 17 00:00:00 2001 From: Azad Shaikh Date: Wed, 4 Jun 2025 22:39:19 +0530 Subject: [PATCH 2/2] Refactor GitHub Actions workflow to streamline build process and enhance output verification --- .github/workflows/update-changelog.yml | 119 +++++++++++++++++++++++++ CHANGELOG.md | 28 ++++++ 2 files changed, 147 insertions(+) create mode 100644 .github/workflows/update-changelog.yml create mode 100644 CHANGELOG.md diff --git a/.github/workflows/update-changelog.yml b/.github/workflows/update-changelog.yml new file mode 100644 index 00000000..7a23023b --- /dev/null +++ b/.github/workflows/update-changelog.yml @@ -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<> $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 diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 00000000..d522f197 --- /dev/null +++ b/CHANGELOG.md @@ -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