From b14cf57a9b1d6d73d56cdf32cc649de67fc3c3a0 Mon Sep 17 00:00:00 2001 From: Prashant Adhikari Date: Sat, 19 Jul 2025 01:14:22 +0545 Subject: [PATCH 01/13] Fixes CSS animation property casing Corrects "Infinite" to lowercase "infinite" in CSS animation declarations to ensure proper browser compatibility and adherence to CSS standards. --- crow-bank-app/public/style.css | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crow-bank-app/public/style.css b/crow-bank-app/public/style.css index cda0784..230f18b 100644 --- a/crow-bank-app/public/style.css +++ b/crow-bank-app/public/style.css @@ -1166,11 +1166,11 @@ svg#bank-illustration:not(.animated) .animable { opacity: 0; } svg#bank-illustration.animated #freepik--background-simple--inject-4 { - animation: 3s Infinite linear wind; + animation: 3s infinite linear wind; animation-delay: 0s; } svg#bank-illustration.animated #freepik--Coins--inject-4 { - animation: 3s Infinite linear floating; + animation: 3s infinite linear floating; animation-delay: 0s; } @keyframes wind { From 561e53b6f74963773b4619825309291cad253082 Mon Sep 17 00:00:00 2001 From: Prashant Adhikari Date: Sat, 19 Jul 2025 11:15:00 +0545 Subject: [PATCH 02/13] Add MIT License to the project --- LICENSE | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 LICENSE diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..13fcd82 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2025 ITx-prash + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. From 24c1f3aad61cb43707d8d45d6c62b8754b01999f Mon Sep 17 00:00:00 2001 From: Prashant Adhikari Date: Sat, 19 Jul 2025 11:15:29 +0545 Subject: [PATCH 03/13] Enhance README.md with updated features, quick start instructions, and troubleshooting section --- README.md | 123 ++++++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 97 insertions(+), 26 deletions(-) diff --git a/README.md b/README.md index 906f0d5..6441304 100644 --- a/README.md +++ b/README.md @@ -1,14 +1,22 @@ # đŸĻ SecureBank-CPP +![Build Status](https://github.com/ITx-prash/securebank-cpp/workflows/Build%20and%20Release/badge.svg) +![Release](https://img.shields.io/github/v/release/ITx-prash/securebank-cpp) +![Platform](https://img.shields.io/badge/platform-Linux%20%7C%20Windows-blue) +![C++](https://img.shields.io/badge/C%2B%2B-17-blue.svg) + Modern C++ banking application with CLI and web interfaces. Demonstrates OOP concepts, REST API design, and cross-platform development. -## Features +## 🚀 Features +- **Modern Web Interface**: Responsive HTML/CSS/JavaScript frontend - **CLI Interface**: Complete banking operations with cross-platform support - **Web Interface**: REST API with Crow framework + modern frontend -- **Cross-Platform**: Windows/Linux builds via CMake +- **Cross-Platform**: Windows/Linux builds via CMake with automated releases - **Real-time Updates**: Live transaction stats and history -- **Security**: Session management, input validation, encrypted storage +- **Security First**: Session management, input validation, encrypted storage +- **Account Management**: User registration, login, and account operations +- **Real-time Transactions**: Handle deposits, withdrawals, and transfers ## Tech Stack @@ -17,9 +25,31 @@ Modern C++ banking application with CLI and web interfaces. Demonstrates OOP con - **Build**: CMake - **Storage**: File-based with XOR encryption -## Quick Start +## đŸ“Ļ Quick Start + +### 🚀 Pre-built Releases (Recommended) + +Download the latest release for your platform from [Releases](https://github.com/ITx-prash/securebank-cpp/releases): + +- **🐧 Linux**: Download `securebank-linux.tar.gz` +- **đŸĒŸ Windows**: Download `securebank-windows.zip` + +```bash +# Linux +tar -xzf securebank-linux.tar.gz +cd securebank-linux/ +./crow_bank_app + +# Windows +# Extract securebank-windows.zip +crow_bank_app.exe +``` + +Then open your browser to `http://localhost:8080` + +### đŸ› ī¸ Build from Source -### Simple Build +#### Simple Build ```bash cd crow-bank-app/ @@ -27,7 +57,7 @@ cd crow-bank-app/ ./build.sh windows # For Windows cross-compilation ``` -### Manual Build (CMake) +#### Manual Build (CMake) ```bash cd crow-bank-app/ @@ -37,51 +67,92 @@ make ./crow_bank_app ``` -### Build Options +#### Build Options ```bash ./build.sh --help # See all build options ``` -## Development +## đŸ—ī¸ Development + +### Automated CI/CD + +This project uses GitHub Actions for professional development workflow: + +- **🔄 Continuous Integration**: Every push to `main` triggers automated builds +- **đŸ“Ļ Automated Releases**: Cross-platform builds automatically published +- **🔍 Quality Checks**: Code analysis and security scanning +- **📝 Release Notes**: Auto-generated changelogs and version management ### Project Structure ``` -crow-bank-app/ -├── main.cpp # Entry point + Crow server setup -├── crow_all.h # Crow framework header -├── public/ # Web interface files -│ ├── index.html # Login page -│ ├── register.html # Registration -│ ├── dashboard.html # Main banking interface -│ ├── style.css # Styles -│ └── js/ # JavaScript modules -└── build.sh # Build script +securebank-cpp/ +├── crow-bank-app/ +│ ├── main.cpp # Entry point + Crow server setup +│ ├── crow_all.h # Crow framework header +│ ├── CMakeLists.txt # Build configuration +│ ├── public/ # Web interface files +│ │ ├── index.html # Login page +│ │ ├── register.html # Registration +│ │ ├── dashboard.html # Main banking interface +│ │ ├── style.css # Styles +│ │ └── js/ # JavaScript modules +│ └── build.sh # Build script +├── .github/ +│ └── workflows/ # CI/CD pipelines +│ ├── release.yml # Automated builds and releases +│ ├── quality-check.yml # Code quality checks +│ └── version-bump.yml # Version management +└── README.md # This file ``` +### Prerequisites + +- **Linux**: GCC 8.0+, CMake 3.15+, Make +- **Windows**: MinGW-w64, CMake 3.15+ +- **Memory**: 512MB RAM minimum, 1GB+ recommended +- **Storage**: 50MB free space + ### Testing Environment - Tested on Linux (native & KVM VMs) - Windows cross-compilation support - Lightweight - works well in resource-constrained environments +## 🌐 Usage + ### Web Interface Start server and visit `http://localhost:8080` ### API Endpoints -- `POST /api/register` - User registration -- `POST /api/login` - Authentication -- `GET /api/user` - User data -- `POST /api/deposit` - Deposit funds -- `POST /api/withdraw` - Withdraw funds -- `POST /api/transfer` - Transfer money -- `GET /api/transactions` - Transaction history +| Method | Endpoint | Description | +| ------ | ------------------- | ------------------- | +| `POST` | `/api/register` | User registration | +| `POST` | `/api/login` | Authentication | +| `GET` | `/api/user` | User data | +| `POST` | `/api/deposit` | Deposit funds | +| `POST` | `/api/withdraw` | Withdraw funds | +| `POST` | `/api/transfer` | Transfer money | +| `GET` | `/api/transactions` | Transaction history | + +## 🐛 Troubleshooting + +### Common Issues + +1. **Port already in use**: Application uses port 8080 - ensure it's available +2. **Missing dependencies**: Install C++ development tools and check CMake version +3. **Web assets not loading**: Ensure `public` folder is with the executable +4. **Permission errors**: Check file permissions on Linux/macOS + +## 📄 License + +This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details. --- **Educational project showcasing practical C++ development and modern web integration.** -**Made with â¤ī¸ by ITx-prash** \ No newline at end of file +**Made with â¤ī¸ by ITx-prash** From 7b54ce6aa5758892b7b7ced51f7f2d9909069e2a Mon Sep 17 00:00:00 2001 From: Prashant Adhikari Date: Sat, 19 Jul 2025 19:00:42 +0545 Subject: [PATCH 04/13] Revise README.md for clarity and detail, enhancing features, quick start, and disclaimer sections --- README.md | 148 ++++++++++++++++-------------------------------------- 1 file changed, 42 insertions(+), 106 deletions(-) diff --git a/README.md b/README.md index 6441304..11120f0 100644 --- a/README.md +++ b/README.md @@ -5,36 +5,38 @@ ![Platform](https://img.shields.io/badge/platform-Linux%20%7C%20Windows-blue) ![C++](https://img.shields.io/badge/C%2B%2B-17-blue.svg) -Modern C++ banking application with CLI and web interfaces. Demonstrates OOP concepts, REST API design, and cross-platform development. +**SecureBank-CPP** is a modern C++ banking application with CLI and web interfaces, designed for educational purposes and to demonstrate practical C++ and web integration. + +--- ## 🚀 Features -- **Modern Web Interface**: Responsive HTML/CSS/JavaScript frontend -- **CLI Interface**: Complete banking operations with cross-platform support -- **Web Interface**: REST API with Crow framework + modern frontend -- **Cross-Platform**: Windows/Linux builds via CMake with automated releases -- **Real-time Updates**: Live transaction stats and history -- **Security First**: Session management, input validation, encrypted storage -- **Account Management**: User registration, login, and account operations -- **Real-time Transactions**: Handle deposits, withdrawals, and transfers +- **Web Interface:** Responsive HTML/CSS/JS frontend served by Crow C++ microframework +- **CLI Interface:** Basic banking operations via command line +- **Cross-Platform:** Build and run on Linux and Windows (via MinGW) +- **Automated CI/CD:** GitHub Actions for builds and releases -## Tech Stack +--- -- **Backend**: C++17, Crow micro web framework -- **Frontend**: HTML5/CSS3/Vanilla JS -- **Build**: CMake -- **Storage**: File-based with XOR encryption +## âš ī¸ Disclaimer + +> **This project is for educational and demonstration purposes only.** +> +> It is **not production-ready** and may contain security vulnerabilities. +> **Not recommended for practical application with sensitive data.** + +--- ## đŸ“Ļ Quick Start -### 🚀 Pre-built Releases (Recommended) +### Pre-built Releases -Download the latest release for your platform from [Releases](https://github.com/ITx-prash/securebank-cpp/releases): +Download the latest release from [Releases](https://github.com/ITx-prash/securebank-cpp/releases): -- **🐧 Linux**: Download `securebank-linux.tar.gz` -- **đŸĒŸ Windows**: Download `securebank-windows.zip` +- **🐧 Linux:** `securebank-linux.tar.gz` +- **đŸĒŸ Windows:** `securebank-windows.zip` -```bash +```sh # Linux tar -xzf securebank-linux.tar.gz cd securebank-linux/ @@ -45,114 +47,48 @@ cd securebank-linux/ crow_bank_app.exe ``` -Then open your browser to `http://localhost:8080` +Then open your browser to [http://localhost:8080](http://localhost:8080) -### đŸ› ī¸ Build from Source +--- -#### Simple Build +## đŸ› ī¸ Build from Source -```bash -cd crow-bank-app/ -./build.sh linux # For Linux -./build.sh windows # For Windows cross-compilation -``` +**Requirements:** -#### Manual Build (CMake) +- Linux: GCC 8+, CMake 3.15+, Make +- Windows: MinGW-w64, CMake 3.15+ -```bash +```sh cd crow-bank-app/ -mkdir build && cd build -cmake .. -make -./crow_bank_app -``` - -#### Build Options - -```bash -./build.sh --help # See all build options +./build.sh linux # For Linux +./build.sh windows # For Windows cross-compilation ``` -## đŸ—ī¸ Development - -### Automated CI/CD - -This project uses GitHub Actions for professional development workflow: - -- **🔄 Continuous Integration**: Every push to `main` triggers automated builds -- **đŸ“Ļ Automated Releases**: Cross-platform builds automatically published -- **🔍 Quality Checks**: Code analysis and security scanning -- **📝 Release Notes**: Auto-generated changelogs and version management +--- -### Project Structure +## 📁 Project Structure ``` securebank-cpp/ ├── crow-bank-app/ -│ ├── main.cpp # Entry point + Crow server setup -│ ├── crow_all.h # Crow framework header -│ ├── CMakeLists.txt # Build configuration -│ ├── public/ # Web interface files -│ │ ├── index.html # Login page -│ │ ├── register.html # Registration -│ │ ├── dashboard.html # Main banking interface -│ │ ├── style.css # Styles -│ │ └── js/ # JavaScript modules -│ └── build.sh # Build script +│ ├── main.cpp +│ ├── crow_all.h +│ ├── CMakeLists.txt +│ ├── public/ +│ └── build.sh ├── .github/ -│ └── workflows/ # CI/CD pipelines -│ ├── release.yml # Automated builds and releases -│ ├── quality-check.yml # Code quality checks -│ └── version-bump.yml # Version management -└── README.md # This file +│ └── workflows/ +└── README.md ``` -### Prerequisites - -- **Linux**: GCC 8.0+, CMake 3.15+, Make -- **Windows**: MinGW-w64, CMake 3.15+ -- **Memory**: 512MB RAM minimum, 1GB+ recommended -- **Storage**: 50MB free space - -### Testing Environment - -- Tested on Linux (native & KVM VMs) -- Windows cross-compilation support -- Lightweight - works well in resource-constrained environments - -## 🌐 Usage - -### Web Interface - -Start server and visit `http://localhost:8080` - -### API Endpoints - -| Method | Endpoint | Description | -| ------ | ------------------- | ------------------- | -| `POST` | `/api/register` | User registration | -| `POST` | `/api/login` | Authentication | -| `GET` | `/api/user` | User data | -| `POST` | `/api/deposit` | Deposit funds | -| `POST` | `/api/withdraw` | Withdraw funds | -| `POST` | `/api/transfer` | Transfer money | -| `GET` | `/api/transactions` | Transaction history | - -## 🐛 Troubleshooting - -### Common Issues - -1. **Port already in use**: Application uses port 8080 - ensure it's available -2. **Missing dependencies**: Install C++ development tools and check CMake version -3. **Web assets not loading**: Ensure `public` folder is with the executable -4. **Permission errors**: Check file permissions on Linux/macOS +--- ## 📄 License -This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details. +MIT License – see [LICENSE](LICENSE) for details. --- -**Educational project showcasing practical C++ development and modern web integration.** +*Made for learning and experimentation. Not for production use.* **Made with â¤ī¸ by ITx-prash** From f14637adb8a2edff2a075a8ed7b711175521d79d Mon Sep 17 00:00:00 2001 From: Prashant Adhikari Date: Sat, 19 Jul 2025 19:28:06 +0545 Subject: [PATCH 05/13] Add GitHub Actions workflow for build and release process --- .github/workflows/release.yml | 232 ++++++++++++++++++++++++++++++++++ 1 file changed, 232 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..c66d4e0 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,232 @@ +name: Build and Release +# Comment for testing +on: + push: + branches: [main] + pull_request: + branches: [main] + release: + types: [published] + +env: + APP_NAME: securebank + +jobs: + build: + runs-on: ubuntu-latest # Use Linux for both builds (cross-compile for Windows) + strategy: + fail-fast: false + matrix: + include: + - platform: linux + executable: crow_bank_app + archive_format: tar.gz + - platform: windows + executable: crow_bank_app.exe + archive_format: zip + defaults: + run: + working-directory: crow-bank-app + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Cache dependencies + uses: actions/cache@v4 + with: + path: | + /usr/include/boost + /usr/lib/x86_64-linux-gnu/libboost* + key: ubuntu-boost-${{ hashFiles('**/CMakeLists.txt') }} + restore-keys: | + ubuntu-boost- + + - name: Set up dependencies + run: | + sudo apt-get update + # For Linux builds + sudo apt-get install -y cmake g++ make zip + # For Windows cross-compilation + sudo apt-get install -y mingw-w64 + # Install Boost development headers (this makes them available system-wide) + sudo apt-get install -y libboost-all-dev + # Install MinGW Boost libraries for cross-compilation + sudo apt-get install -y libboost-all-dev:amd64 + # Install Windows-specific Boost libraries + wget -q https://github.com/microsoft/vcpkg/archive/refs/heads/master.zip + unzip -q master.zip + cd vcpkg-master + ./bootstrap-vcpkg.sh + ./vcpkg install boost-algorithm:x64-mingw-static boost-system:x64-mingw-static + cd .. + + # Alternative: Install mingw boost packages + sudo apt-get install -y libboost-dev-mingw-w64 || echo "MinGW Boost not available, using alternative approach" + + # Debug: Check if Boost headers are accessible + echo "Checking Boost installation:" + ls -la /usr/include/boost/ | head -5 + echo "Boost algorithm headers:" + ls -la /usr/include/boost/algorithm/ | head -5 + + # Check MinGW environment + echo "MinGW compiler location:" + which x86_64-w64-mingw32-g++ + echo "MinGW include paths:" + x86_64-w64-mingw32-g++ -v -E -x c++ - < /dev/null 2>&1 | grep -A 20 "search starts here" + + - name: Prepare Boost headers for MinGW (Windows only) + if: matrix.platform == 'windows' + run: | + # Copy Boost headers to MinGW sysroot if not already present + BOOST_SRC=/usr/include/boost + MINGW_INCLUDE=/usr/x86_64-w64-mingw32/include/boost + if [ ! -d "$MINGW_INCLUDE" ]; then + sudo mkdir -p /usr/x86_64-w64-mingw32/include + sudo cp -r $BOOST_SRC /usr/x86_64-w64-mingw32/include/ + fi + + - name: Configure and Build + run: | + if [ "${{ matrix.platform }}" == "linux" ]; then + echo "🐧 Building for Linux..." + mkdir -p build-linux + cd build-linux + cmake .. -DCMAKE_BUILD_TYPE=Release + make -j$(nproc) + # Copy executable to expected location + cp crow_bank_app ../crow_bank_app + else + echo "đŸĒŸ Building for Windows (cross-compilation)..." + mkdir -p win-build + cd win-build + cmake .. -DCMAKE_TOOLCHAIN_FILE=../win-toolchain.cmake -DCMAKE_BUILD_TYPE=Release + make -j$(nproc) + # Copy executable to expected location + cp crow_bank_app.exe ../crow_bank_app.exe + fi + + - name: Verify build output + run: | + ls -la + if [ ! -f "${{ matrix.executable }}" ]; then + echo "Error: Expected executable ${{ matrix.executable }} not found" + exit 1 + fi + + - name: Prepare release package + run: | + mkdir -p out + cp -r public out/public + cp README.md out/README.txt || echo "No README.md found" + cp ${{ matrix.executable }} out/ + + # Create version info + echo "SecureBank C++ Banking Application" > out/README.txt + echo "Version: $(date +%Y.%m.%d-%H%M%S)" >> out/README.txt + echo "Platform: ${{ matrix.platform }}" >> out/README.txt + echo "Built on: $(date)" >> out/README.txt + echo "" >> out/README.txt + echo "Usage:" >> out/README.txt + echo "1. Run the executable: ./${{ matrix.executable }}" >> out/README.txt + echo "2. Open browser to http://localhost:8080" >> out/README.txt + + # Create archive based on platform + if [ "${{ matrix.platform }}" == "windows" ]; then + zip -r ${{ env.APP_NAME }}-${{ matrix.platform }}.zip out/* + else + tar -czf ${{ env.APP_NAME }}-${{ matrix.platform }}.tar.gz -C out . + fi + + - name: Upload build artifacts + uses: actions/upload-artifact@v4 + with: + name: ${{ env.APP_NAME }}-${{ matrix.platform }} + path: crow-bank-app/${{ env.APP_NAME }}-${{ matrix.platform }}.* + retention-days: 30 + + create-release: + if: github.event_name == 'push' && github.ref == 'refs/heads/main' + needs: build + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Get latest version and increment + id: version + run: | + # Get the latest tag, or start with v1.0.0 if no tags exist + if git describe --tags --abbrev=0 2>/dev/null; then + LATEST_TAG=$(git describe --tags --abbrev=0 | sed 's/^v//') + else + LATEST_TAG="1.0.0" + fi + + echo "Latest tag: v$LATEST_TAG" + + # Split version into major.minor.patch + IFS='.' read -r MAJOR MINOR PATCH <<< "$LATEST_TAG" + + # Increment patch version for automatic releases + NEW_PATCH=$((PATCH + 1)) + NEW_VERSION="$MAJOR.$MINOR.$NEW_PATCH" + + echo "New version: v$NEW_VERSION" + echo "version=v$NEW_VERSION" >> $GITHUB_OUTPUT + echo "version_number=$NEW_VERSION" >> $GITHUB_OUTPUT + + - name: Download all artifacts + uses: actions/download-artifact@v4 + with: + path: artifacts + + - name: Prepare release assets + run: | + mkdir -p release-assets + find artifacts -name "*.zip" -o -name "*.tar.gz" | while read file; do + cp "$file" release-assets/ + done + ls -la release-assets/ + + - name: Create Release + uses: softprops/action-gh-release@v2 + with: + tag_name: ${{ steps.version.outputs.version }} + name: SecureBank ${{ steps.version.outputs.version }} + body: | + # SecureBank C++ Banking Application ${{ steps.version.outputs.version }} + + ## đŸ“Ļ Downloads + - **🐧 Linux:** [securebank-linux.tar.gz](https://github.com/${{ github.repository }}/releases/download/${{ steps.version.outputs.version }}/securebank-linux.tar.gz) — Extract and run `./crow_bank_app` + - **đŸĒŸ Windows:** [securebank-windows.zip](https://github.com/${{ github.repository }}/releases/download/${{ steps.version.outputs.version }}/securebank-windows.zip) — Extract and run `crow_bank_app.exe` + + ## đŸ› ī¸ Quick Start + ```sh + # Linux + tar -xzf securebank-linux.tar.gz && cd securebank-linux/ + ./crow_bank_app + + # Windows - Extract zip file then: + crow_bank_app.exe + ``` + Open your browser to [http://localhost:8080](http://localhost:8080) + + ## 🔧 System Requirements + - **Linux:** Ubuntu 18.04+ or equivalent, 64-bit + - **Windows:** Windows 10+ or Windows Server 2019+, 64-bit + - **Memory:** 512MB RAM minimum + - **Storage:** 50MB free space + + --- + *For major releases and new features, see our [release history](https://github.com/ITx-prash/securebank-cpp/releases).* + files: release-assets/* + draft: false + prerelease: false + generate_release_notes: true + make_latest: true + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file From 27e851c07f18c272a2546b57fea6253e82e2b9b8 Mon Sep 17 00:00:00 2001 From: Prashant Adhikari Date: Sun, 20 Jul 2025 20:20:17 +0545 Subject: [PATCH 06/13] Refactor release workflow to improve package structure and README generation --- .github/workflows/release.yml | 38 ++++++++++++++++------------------- 1 file changed, 17 insertions(+), 21 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c66d4e0..c38810c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,12 +1,8 @@ name: Build and Release -# Comment for testing + on: push: branches: [main] - pull_request: - branches: [main] - release: - types: [published] env: APP_NAME: securebank @@ -117,26 +113,27 @@ jobs: - name: Prepare release package run: | - mkdir -p out - cp -r public out/public - cp README.md out/README.txt || echo "No README.md found" - cp ${{ matrix.executable }} out/ + PACKAGE_DIR="${{ env.APP_NAME }}-${{ matrix.platform }}" + mkdir -p "$PACKAGE_DIR" + cp -r public "$PACKAGE_DIR/public" + cp README.md "$PACKAGE_DIR/README.txt" || echo "No README.md found" + cp ${{ matrix.executable }} "$PACKAGE_DIR/" # Create version info - echo "SecureBank C++ Banking Application" > out/README.txt - echo "Version: $(date +%Y.%m.%d-%H%M%S)" >> out/README.txt - echo "Platform: ${{ matrix.platform }}" >> out/README.txt - echo "Built on: $(date)" >> out/README.txt - echo "" >> out/README.txt - echo "Usage:" >> out/README.txt - echo "1. Run the executable: ./${{ matrix.executable }}" >> out/README.txt - echo "2. Open browser to http://localhost:8080" >> out/README.txt + echo "SecureBank C++ Banking Application" > "$PACKAGE_DIR/README.txt" + echo "Version: $(date +%Y.%m.%d-%H%M%S)" >> "$PACKAGE_DIR/README.txt" + echo "Platform: ${{ matrix.platform }}" >> "$PACKAGE_DIR/README.txt" + echo "Built on: $(date)" >> "$PACKAGE_DIR/README.txt" + echo "" >> "$PACKAGE_DIR/README.txt" + echo "Usage:" >> "$PACKAGE_DIR/README.txt" + echo "1. Run the executable: ./${{ matrix.executable }}" >> "$PACKAGE_DIR/README.txt" + echo "2. Open browser to http://localhost:8080" >> "$PACKAGE_DIR/README.txt" # Create archive based on platform if [ "${{ matrix.platform }}" == "windows" ]; then - zip -r ${{ env.APP_NAME }}-${{ matrix.platform }}.zip out/* + zip -r "$PACKAGE_DIR.zip" "$PACKAGE_DIR" else - tar -czf ${{ env.APP_NAME }}-${{ matrix.platform }}.tar.gz -C out . + tar -czf "$PACKAGE_DIR.tar.gz" "$PACKAGE_DIR" fi - name: Upload build artifacts @@ -147,7 +144,6 @@ jobs: retention-days: 30 create-release: - if: github.event_name == 'push' && github.ref == 'refs/heads/main' needs: build runs-on: ubuntu-latest steps: @@ -229,4 +225,4 @@ jobs: generate_release_notes: true make_latest: true env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From c5fafed471dd3d08533f60b41d2cd0ff1d4e1a8c Mon Sep 17 00:00:00 2001 From: Prashant Adhikari Date: Sun, 20 Jul 2025 20:20:30 +0545 Subject: [PATCH 07/13] Add GitHub Actions workflow for building and testing across Linux and Windows --- .github/workflows/build.yml | 117 ++++++++++++++++++++++++++++++++++++ 1 file changed, 117 insertions(+) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..7e85b7b --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,117 @@ +name: Build (Test Only) + +on: + push: + branches: + - "break-and-build" + pull_request: + branches: + - main + +env: + APP_NAME: securebank + +jobs: + build: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + include: + - platform: linux + executable: crow_bank_app + archive_format: tar.gz + - platform: windows + executable: crow_bank_app.exe + archive_format: zip + defaults: + run: + working-directory: crow-bank-app + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Cache dependencies + uses: actions/cache@v4 + with: + path: | + /usr/include/boost + /usr/lib/x86_64-linux-gnu/libboost* + key: ubuntu-boost-${{ hashFiles('**/CMakeLists.txt') }} + restore-keys: | + ubuntu-boost- + + - name: Set up dependencies + run: | + sudo apt-get update + sudo apt-get install -y cmake g++ make zip + sudo apt-get install -y mingw-w64 + sudo apt-get install -y libboost-all-dev + sudo apt-get install -y libboost-all-dev:amd64 + wget -q https://github.com/microsoft/vcpkg/archive/refs/heads/master.zip + unzip -q master.zip + cd vcpkg-master + ./bootstrap-vcpkg.sh + ./vcpkg install boost-algorithm:x64-mingw-static boost-system:x64-mingw-static + cd .. + sudo apt-get install -y libboost-dev-mingw-w64 || echo "MinGW Boost not available, using alternative approach" + echo "Checking Boost installation:" + ls -la /usr/include/boost/ | head -5 + echo "Boost algorithm headers:" + ls -la /usr/include/boost/algorithm/ | head -5 + echo "MinGW compiler location:" + which x86_64-w64-mingw32-g++ + echo "MinGW include paths:" + x86_64-w64-mingw32-g++ -v -E -x c++ - < /dev/null 2>&1 | grep -A 20 "search starts here" + + - name: Prepare Boost headers for MinGW (Windows only) + if: matrix.platform == 'windows' + run: | + BOOST_SRC=/usr/include/boost + MINGW_INCLUDE=/usr/x86_64-w64-mingw32/include/boost + if [ ! -d "$MINGW_INCLUDE" ]; then + sudo mkdir -p /usr/x86_64-w64-mingw32/include + sudo cp -r $BOOST_SRC /usr/x86_64-w64-mingw32/include/ + fi + + - name: Configure and Build + run: | + if [ "${{ matrix.platform }}" == "linux" ]; then + echo "🐧 Building for Linux..." + mkdir -p build-linux + cd build-linux + cmake .. -DCMAKE_BUILD_TYPE=Release + make -j$(nproc) + cp crow_bank_app ../crow_bank_app + else + echo "đŸĒŸ Building for Windows (cross-compilation)..." + mkdir -p win-build + cd win-build + cmake .. -DCMAKE_TOOLCHAIN_FILE=../win-toolchain.cmake -DCMAKE_BUILD_TYPE=Release + make -j$(nproc) + cp crow_bank_app.exe ../crow_bank_app.exe + fi + + - name: Verify build output + run: | + ls -la + if [ ! -f "${{ matrix.executable }}" ]; then + echo "Error: Expected executable ${{ matrix.executable }} not found" + exit 1 + fi + + - name: Prepare test artifact + run: | + PACKAGE_DIR="${{ env.APP_NAME }}-${{ matrix.platform }}" + mkdir -p "$PACKAGE_DIR" + cp -r public "$PACKAGE_DIR/public" + cp README.md "$PACKAGE_DIR/README.txt" || echo "No README.md found" + cp ${{ matrix.executable }} "$PACKAGE_DIR/" + + - name: Upload build artifacts + uses: actions/upload-artifact@v4 + with: + name: ${{ env.APP_NAME }}-${{ matrix.platform }} + path: crow-bank-app/${{ env.APP_NAME }}-${{ matrix.platform }}/* + retention-days: 7 From 6c40152ac017f376738b77f69ca42baa847c4545 Mon Sep 17 00:00:00 2001 From: Prashant Adhikari Date: Sun, 20 Jul 2025 20:53:18 +0545 Subject: [PATCH 08/13] Remove push trigger for "break-and-build" branch from build workflow --- .github/workflows/build.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 7e85b7b..7f4acbd 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,9 +1,6 @@ name: Build (Test Only) on: - push: - branches: - - "break-and-build" pull_request: branches: - main From be703a9179b8898d4999f8e80f43b1bdd9608536 Mon Sep 17 00:00:00 2001 From: Prashant Adhikari Date: Mon, 21 Jul 2025 22:21:29 +0545 Subject: [PATCH 09/13] Fix layout of signup form by adding max-width and margin classes --- crow-bank-app/public/register.html | 2 +- crow-bank-app/public/style.css | 68 ++++++++++++++++++++++++++++++ 2 files changed, 69 insertions(+), 1 deletion(-) diff --git a/crow-bank-app/public/register.html b/crow-bank-app/public/register.html index c66d0cd..d4a6fd3 100644 --- a/crow-bank-app/public/register.html +++ b/crow-bank-app/public/register.html @@ -2203,7 +2203,7 @@

= 64rem) { + margin-left: auto; + } + } .lg\:grid { @media (width >= 64rem) { display: grid; @@ -1121,6 +1158,26 @@ height: calc(var(--spacing) * 114); } } + .lg\:max-w-lg { + @media (width >= 64rem) { + max-width: var(--container-lg); + } + } + .lg\:max-w-md { + @media (width >= 64rem) { + max-width: var(--container-md); + } + } + .lg\:max-w-sm { + @media (width >= 64rem) { + max-width: var(--container-sm); + } + } + .lg\:max-w-xl { + @media (width >= 64rem) { + max-width: var(--container-xl); + } + } .lg\:grid-cols-2 { @media (width >= 64rem) { grid-template-columns: repeat(2, minmax(0, 1fr)); @@ -1131,6 +1188,11 @@ grid-template-columns: repeat(3, minmax(0, 1fr)); } } + .lg\:grid-cols-\[2fr_1fr\] { + @media (width >= 64rem) { + grid-template-columns: 2fr 1fr; + } + } .lg\:gap-16 { @media (width >= 64rem) { gap: calc(var(--spacing) * 16); @@ -1427,6 +1489,11 @@ svg#bank-illustration.animated #freepik--Coins--inject-4 { inherits: false; initial-value: 0 0 #0000; } +@property --tw-outline-style { + syntax: "*"; + inherits: false; + initial-value: solid; +} @property --tw-backdrop-blur { syntax: "*"; inherits: false; @@ -1542,6 +1609,7 @@ svg#bank-illustration.animated #freepik--Coins--inject-4 { --tw-ring-offset-width: 0px; --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 #0000; + --tw-outline-style: solid; --tw-backdrop-blur: initial; --tw-backdrop-brightness: initial; --tw-backdrop-contrast: initial; From 038a184cec9bb91be8812cdf6d76ef2432fc1027 Mon Sep 17 00:00:00 2001 From: Prashant Adhikari Date: Sat, 26 Jul 2025 16:37:13 +0545 Subject: [PATCH 10/13] Remove decorative message from authentication and banking menus --- crow-bank-app/main.cpp | 3 --- 1 file changed, 3 deletions(-) diff --git a/crow-bank-app/main.cpp b/crow-bank-app/main.cpp index bcf385a..1ce2fc4 100644 --- a/crow-bank-app/main.cpp +++ b/crow-bank-app/main.cpp @@ -929,7 +929,6 @@ string read_file(const string &filename) // Main CLI authentication menu void displayAuthMenu() { - cout << "Made with <3\n\n"; cout << "==============================================\n"; cout << " " << getIcon("bank") << " SECURE BANK CLI SYSTEM \n"; cout << "==============================================\n"; @@ -945,7 +944,6 @@ void displayAuthMenu() // Banking dashboard menu (after login) void displayBankingMenu(const string &userName) { - cout << "Made with <3\n\n"; cout << "==============================================\n"; cout << " " << getIcon("bank") << " WELCOME " << userName << "\n"; cout << "==============================================\n"; @@ -1453,7 +1451,6 @@ void runCLI() void displayWelcomeScreen() { - cout << "Made with <3\n\n"; cout << "========================================\n"; cout << " " << getIcon("bank") << " SECURE BANK SYSTEM \n"; cout << "========================================\n"; From 716982e670157308977b683b8ce60802ae1a63ba Mon Sep 17 00:00:00 2001 From: Prashant Adhikari Date: Mon, 21 Jul 2025 22:49:47 +0545 Subject: [PATCH 11/13] Enhance release workflow with manual trigger and versioning logic based on commit analysis --- .github/workflows/release.yml | 141 ++++++++++++++++++++++++++-------- 1 file changed, 111 insertions(+), 30 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c38810c..5014508 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -3,6 +3,17 @@ name: Build and Release on: push: branches: [main] + workflow_dispatch: # Allow manual triggering + inputs: + release_type: + description: "Release type" + required: true + default: "patch" + type: choice + options: + - patch + - minor + - major env: APP_NAME: securebank @@ -167,9 +178,58 @@ jobs: # Split version into major.minor.patch IFS='.' read -r MAJOR MINOR PATCH <<< "$LATEST_TAG" - # Increment patch version for automatic releases - NEW_PATCH=$((PATCH + 1)) - NEW_VERSION="$MAJOR.$MINOR.$NEW_PATCH" + # Determine release type + if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then + # Manual trigger - use selected type + RELEASE_TYPE="${{ github.event.inputs.release_type }}" + echo "Manual release type: $RELEASE_TYPE" + else + # Automatic trigger - analyze commits since last release + echo "Analyzing commits for automatic version detection..." + + # Get commits since last tag + if git describe --tags --abbrev=0 2>/dev/null; then + LAST_TAG=$(git describe --tags --abbrev=0) + COMMITS=$(git log ${LAST_TAG}..HEAD --oneline) + else + COMMITS=$(git log --oneline) + fi + + echo "Commits to analyze:" + echo "$COMMITS" + + # Check for breaking changes (major) + if echo "$COMMITS" | grep -E "(BREAKING CHANGE|!:)" > /dev/null; then + RELEASE_TYPE="major" + echo "🚨 Breaking changes detected → MAJOR release" + # Check for new features (minor) + elif echo "$COMMITS" | grep -E "^[a-f0-9]+ feat(\(.*\))?:" > /dev/null; then + RELEASE_TYPE="minor" + echo "✨ New features detected → MINOR release" + # Default to patch for fixes, docs, chore, etc. + else + RELEASE_TYPE="patch" + echo "🔧 Bug fixes/improvements detected → PATCH release" + fi + fi + + echo "Final release type: $RELEASE_TYPE" + + # Increment version based on type + case $RELEASE_TYPE in + major) + NEW_MAJOR=$((MAJOR + 1)) + NEW_VERSION="$NEW_MAJOR.0.0" + ;; + minor) + NEW_MINOR=$((MINOR + 1)) + NEW_VERSION="$MAJOR.$NEW_MINOR.0" + ;; + patch|*) + NEW_PATCH=$((PATCH + 1)) + NEW_VERSION="$MAJOR.$MINOR.$NEW_PATCH" + ;; + esac echo "New version: v$NEW_VERSION" echo "version=v$NEW_VERSION" >> $GITHUB_OUTPUT @@ -188,41 +248,62 @@ jobs: done ls -la release-assets/ + - name: Generate custom release notes + id: release_notes + run: | + # Get commits since last release + if git describe --tags --abbrev=0 2>/dev/null; then + LAST_TAG=$(git describe --tags --abbrev=0) + COMMITS=$(git log --oneline ${LAST_TAG}..HEAD --pretty=format:"- %s (%h)") + else + COMMITS=$(git log --oneline --pretty=format:"- %s (%h)") + fi + + # Create release notes + cat << EOF > release_notes.md + # SecureBank C++ Banking Application ${{ steps.version.outputs.version }} + + ## 🚀 What's New + ${COMMITS} + + ## đŸ“Ļ Downloads + - **🐧 Linux:** [securebank-linux.tar.gz](https://github.com/${{ github.repository }}/releases/download/${{ steps.version.outputs.version }}/securebank-linux.tar.gz) — Extract and run \`./crow_bank_app\` + - **đŸĒŸ Windows:** [securebank-windows.zip](https://github.com/${{ github.repository }}/releases/download/${{ steps.version.outputs.version }}/securebank-windows.zip) — Extract and run \`crow_bank_app.exe\` + + ## đŸ› ī¸ Quick Start + \`\`\`sh + # Linux + tar -xzf securebank-linux.tar.gz && cd securebank-linux/ + ./crow_bank_app + + # Windows - Extract zip file then: + crow_bank_app.exe + \`\`\` + Open your browser to [http://localhost:8080](http://localhost:8080) + + ## 🔧 System Requirements + - **Linux:** Ubuntu 18.04+ or equivalent, 64-bit + - **Windows:** Windows 10+ or Windows Server 2019+, 64-bit + - **Memory:** 512MB RAM minimum + - **Storage:** 50MB free space + + --- + *For major releases and new features, see our [release history](https://github.com/${{ github.repository }}/releases).* + EOF + + echo "Generated release notes:" + cat release_notes.md + - name: Create Release uses: softprops/action-gh-release@v2 with: tag_name: ${{ steps.version.outputs.version }} name: SecureBank ${{ steps.version.outputs.version }} - body: | - # SecureBank C++ Banking Application ${{ steps.version.outputs.version }} - - ## đŸ“Ļ Downloads - - **🐧 Linux:** [securebank-linux.tar.gz](https://github.com/${{ github.repository }}/releases/download/${{ steps.version.outputs.version }}/securebank-linux.tar.gz) — Extract and run `./crow_bank_app` - - **đŸĒŸ Windows:** [securebank-windows.zip](https://github.com/${{ github.repository }}/releases/download/${{ steps.version.outputs.version }}/securebank-windows.zip) — Extract and run `crow_bank_app.exe` - - ## đŸ› ī¸ Quick Start - ```sh - # Linux - tar -xzf securebank-linux.tar.gz && cd securebank-linux/ - ./crow_bank_app - - # Windows - Extract zip file then: - crow_bank_app.exe - ``` - Open your browser to [http://localhost:8080](http://localhost:8080) - - ## 🔧 System Requirements - - **Linux:** Ubuntu 18.04+ or equivalent, 64-bit - - **Windows:** Windows 10+ or Windows Server 2019+, 64-bit - - **Memory:** 512MB RAM minimum - - **Storage:** 50MB free space - - --- - *For major releases and new features, see our [release history](https://github.com/ITx-prash/securebank-cpp/releases).* + body_path: release_notes.md files: release-assets/* draft: false prerelease: false - generate_release_notes: true + generate_release_notes: false make_latest: true env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 1931abbfce521c1d1038990b627e22f59fc15fb5 Mon Sep 17 00:00:00 2001 From: Prashant Adhikari Date: Sat, 2 Aug 2025 00:49:17 +0545 Subject: [PATCH 12/13] Refactor icon display logic for Windows and remove unnecessary text from menus --- crow-bank-app/main.cpp | 125 +++++++++++------------------------------ 1 file changed, 32 insertions(+), 93 deletions(-) diff --git a/crow-bank-app/main.cpp b/crow-bank-app/main.cpp index 1ce2fc4..a393543 100644 --- a/crow-bank-app/main.cpp +++ b/crow-bank-app/main.cpp @@ -341,99 +341,38 @@ string get_file_path(const string &relative_path) string getIcon(const string &iconType) { #ifdef _WIN32 - // Windows - Smart emoji detection - // Check for Windows Terminal or modern terminal capabilities - static bool useEmojis = []() - { - // Check environment variables that indicate modern terminal - const char *wt_session = getenv("WT_SESSION"); // Windows Terminal - const char *term_program = getenv("TERM_PROGRAM"); // VS Code terminal, etc. - const char *colorterm = getenv("COLORTERM"); // Modern terminals - const char *force_emojis = getenv("FORCE_EMOJIS"); // User override - const char *no_emojis = getenv("NO_EMOJIS"); // User disable - - // User explicitly disabled emojis - if (no_emojis) - return false; - - // User explicitly enabled emojis - if (force_emojis) - return true; - - // Detect modern terminal environment - return (wt_session || term_program || colorterm); - }(); - - if (useEmojis) - { - // Unicode emojis for modern Windows terminals - if (iconType == "bank") - return "đŸĻ"; - if (iconType == "register") - return "📝"; - if (iconType == "login") - return "🔐"; - if (iconType == "help") - return "❓"; - if (iconType == "exit") - return "đŸšĒ"; - if (iconType == "deposit") - return "💰"; - if (iconType == "withdraw") - return "💸"; - if (iconType == "balance") - return "đŸ’ŗ"; - if (iconType == "history") - return "📊"; - if (iconType == "transfer") - return "🔄"; - if (iconType == "settings") - return "âš™ī¸"; - if (iconType == "logout") - return "đŸšĒ"; - if (iconType == "success") - return "✅"; - if (iconType == "error") - return "❌"; - if (iconType == "warning") - return "âš ī¸"; - return "â€ĸ"; - } - else - { - // Windows fallback - basic ASCII characters only - if (iconType == "bank") - return ""; - if (iconType == "register") - return ""; - if (iconType == "login") - return ""; - if (iconType == "help") - return ""; - if (iconType == "exit") - return ""; - if (iconType == "deposit") - return ""; - if (iconType == "withdraw") - return ""; - if (iconType == "balance") - return ""; - if (iconType == "history") - return ""; - if (iconType == "transfer") - return ""; - if (iconType == "settings") - return ""; - if (iconType == "logout") - return ""; - if (iconType == "success") - return "[OK]"; - if (iconType == "error") - return "[ERROR]"; - if (iconType == "warning") - return "[WARNING]"; + // Windows - Clean text without icons for better appearance + if (iconType == "bank") return ""; - } + if (iconType == "register") + return ""; + if (iconType == "login") + return ""; + if (iconType == "help") + return ""; + if (iconType == "exit") + return ""; + if (iconType == "deposit") + return ""; + if (iconType == "withdraw") + return ""; + if (iconType == "balance") + return ""; + if (iconType == "history") + return ""; + if (iconType == "transfer") + return ""; + if (iconType == "settings") + return ""; + if (iconType == "logout") + return ""; + if (iconType == "success") + return "[SUCCESS]"; + if (iconType == "error") + return "[ERROR]"; + if (iconType == "warning") + return "[WARNING]"; + return ""; #else // Linux/Unix - Unicode emojis if (iconType == "bank") @@ -1552,7 +1491,7 @@ int main(int argc, char *argv[]) case 3: { // Exit clearScreen(); - cout << "\nīŋŊ Thank you for exploring SecureBank!\n"; + cout << "\n" << getIcon("exit") << " Thank you for exploring SecureBank!\n"; return 0; } From 19776e6c61a43f474233043d104402836198cc8d Mon Sep 17 00:00:00 2001 From: Prashant Adhikari <78313801+ITx-prash@users.noreply.github.com> Date: Sat, 2 Aug 2025 01:04:54 +0545 Subject: [PATCH 13/13] Update release.yml --- .github/workflows/release.yml | 141 ++++++++-------------------------- 1 file changed, 30 insertions(+), 111 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 5014508..c38810c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -3,17 +3,6 @@ name: Build and Release on: push: branches: [main] - workflow_dispatch: # Allow manual triggering - inputs: - release_type: - description: "Release type" - required: true - default: "patch" - type: choice - options: - - patch - - minor - - major env: APP_NAME: securebank @@ -178,58 +167,9 @@ jobs: # Split version into major.minor.patch IFS='.' read -r MAJOR MINOR PATCH <<< "$LATEST_TAG" - # Determine release type - if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then - # Manual trigger - use selected type - RELEASE_TYPE="${{ github.event.inputs.release_type }}" - echo "Manual release type: $RELEASE_TYPE" - else - # Automatic trigger - analyze commits since last release - echo "Analyzing commits for automatic version detection..." - - # Get commits since last tag - if git describe --tags --abbrev=0 2>/dev/null; then - LAST_TAG=$(git describe --tags --abbrev=0) - COMMITS=$(git log ${LAST_TAG}..HEAD --oneline) - else - COMMITS=$(git log --oneline) - fi - - echo "Commits to analyze:" - echo "$COMMITS" - - # Check for breaking changes (major) - if echo "$COMMITS" | grep -E "(BREAKING CHANGE|!:)" > /dev/null; then - RELEASE_TYPE="major" - echo "🚨 Breaking changes detected → MAJOR release" - # Check for new features (minor) - elif echo "$COMMITS" | grep -E "^[a-f0-9]+ feat(\(.*\))?:" > /dev/null; then - RELEASE_TYPE="minor" - echo "✨ New features detected → MINOR release" - # Default to patch for fixes, docs, chore, etc. - else - RELEASE_TYPE="patch" - echo "🔧 Bug fixes/improvements detected → PATCH release" - fi - fi - - echo "Final release type: $RELEASE_TYPE" - - # Increment version based on type - case $RELEASE_TYPE in - major) - NEW_MAJOR=$((MAJOR + 1)) - NEW_VERSION="$NEW_MAJOR.0.0" - ;; - minor) - NEW_MINOR=$((MINOR + 1)) - NEW_VERSION="$MAJOR.$NEW_MINOR.0" - ;; - patch|*) - NEW_PATCH=$((PATCH + 1)) - NEW_VERSION="$MAJOR.$MINOR.$NEW_PATCH" - ;; - esac + # Increment patch version for automatic releases + NEW_PATCH=$((PATCH + 1)) + NEW_VERSION="$MAJOR.$MINOR.$NEW_PATCH" echo "New version: v$NEW_VERSION" echo "version=v$NEW_VERSION" >> $GITHUB_OUTPUT @@ -248,62 +188,41 @@ jobs: done ls -la release-assets/ - - name: Generate custom release notes - id: release_notes - run: | - # Get commits since last release - if git describe --tags --abbrev=0 2>/dev/null; then - LAST_TAG=$(git describe --tags --abbrev=0) - COMMITS=$(git log --oneline ${LAST_TAG}..HEAD --pretty=format:"- %s (%h)") - else - COMMITS=$(git log --oneline --pretty=format:"- %s (%h)") - fi - - # Create release notes - cat << EOF > release_notes.md - # SecureBank C++ Banking Application ${{ steps.version.outputs.version }} - - ## 🚀 What's New - ${COMMITS} - - ## đŸ“Ļ Downloads - - **🐧 Linux:** [securebank-linux.tar.gz](https://github.com/${{ github.repository }}/releases/download/${{ steps.version.outputs.version }}/securebank-linux.tar.gz) — Extract and run \`./crow_bank_app\` - - **đŸĒŸ Windows:** [securebank-windows.zip](https://github.com/${{ github.repository }}/releases/download/${{ steps.version.outputs.version }}/securebank-windows.zip) — Extract and run \`crow_bank_app.exe\` - - ## đŸ› ī¸ Quick Start - \`\`\`sh - # Linux - tar -xzf securebank-linux.tar.gz && cd securebank-linux/ - ./crow_bank_app - - # Windows - Extract zip file then: - crow_bank_app.exe - \`\`\` - Open your browser to [http://localhost:8080](http://localhost:8080) - - ## 🔧 System Requirements - - **Linux:** Ubuntu 18.04+ or equivalent, 64-bit - - **Windows:** Windows 10+ or Windows Server 2019+, 64-bit - - **Memory:** 512MB RAM minimum - - **Storage:** 50MB free space - - --- - *For major releases and new features, see our [release history](https://github.com/${{ github.repository }}/releases).* - EOF - - echo "Generated release notes:" - cat release_notes.md - - name: Create Release uses: softprops/action-gh-release@v2 with: tag_name: ${{ steps.version.outputs.version }} name: SecureBank ${{ steps.version.outputs.version }} - body_path: release_notes.md + body: | + # SecureBank C++ Banking Application ${{ steps.version.outputs.version }} + + ## đŸ“Ļ Downloads + - **🐧 Linux:** [securebank-linux.tar.gz](https://github.com/${{ github.repository }}/releases/download/${{ steps.version.outputs.version }}/securebank-linux.tar.gz) — Extract and run `./crow_bank_app` + - **đŸĒŸ Windows:** [securebank-windows.zip](https://github.com/${{ github.repository }}/releases/download/${{ steps.version.outputs.version }}/securebank-windows.zip) — Extract and run `crow_bank_app.exe` + + ## đŸ› ī¸ Quick Start + ```sh + # Linux + tar -xzf securebank-linux.tar.gz && cd securebank-linux/ + ./crow_bank_app + + # Windows - Extract zip file then: + crow_bank_app.exe + ``` + Open your browser to [http://localhost:8080](http://localhost:8080) + + ## 🔧 System Requirements + - **Linux:** Ubuntu 18.04+ or equivalent, 64-bit + - **Windows:** Windows 10+ or Windows Server 2019+, 64-bit + - **Memory:** 512MB RAM minimum + - **Storage:** 50MB free space + + --- + *For major releases and new features, see our [release history](https://github.com/ITx-prash/securebank-cpp/releases).* files: release-assets/* draft: false prerelease: false - generate_release_notes: false + generate_release_notes: true make_latest: true env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}