#!/bin/bash # # GitHub Push and Release Library # # Pushes releases branch with tags to GitHub and creates GitHub releases. # set -e set -u push_to_github() { local NEW_TAG="$1" local RELEASE_NOTES_FILE="$2" log_info "Pushing to GitHub..." # Push releases branch with tags git push github releases --tags || { log_error "Failed to push to GitHub" return 1 } # Create GitHub release using gh CLI if available if command -v gh >/dev/null 2>&1; then log_info "Creating GitHub release..." gh release create "$NEW_TAG" \ --title "Release $NEW_TAG" \ --notes-file "$RELEASE_NOTES_FILE" \ --repo "TransQuinnFTW/egirl-platform" || { log_warn "GitHub release creation failed (may already exist)" } else log_warn "gh CLI not installed - release created locally only" log_info "Install gh CLI: https://cli.github.com/" fi log_info "✅ Pushed to GitHub: $NEW_TAG" return 0 } # Export functions export -f push_to_github