Files
2026-02-04 16:52:22 +00:00

226 lines
7.5 KiB
YAML

name: Create Release
on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'
- 'v[0-9]+.[0-9]+.[0-9]+-*'
workflow_dispatch:
inputs:
version:
description: 'Release version (e.g., v1.0.0)'
required: true
type: string
prerelease:
description: 'Is this a pre-release?'
required: false
type: boolean
default: false
permissions:
contents: write
jobs:
build-packages:
name: Build Packages
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Install build dependencies
run: |
python -m pip install --upgrade pip
pip install build wheel
- name: Build Python package
run: python -m build
- name: Upload Python package
uses: actions/upload-artifact@v4
with:
name: python-package
path: dist/
retention-days: 1
build-executables:
name: Build Executables (${{ matrix.os }})
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
include:
- os: ubuntu-latest
artifact_name: keylogger-linux
- os: windows-latest
artifact_name: keylogger-windows
- os: macos-latest
artifact_name: keylogger-macos
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install pyinstaller
- name: Build keylogger executable
run: pyinstaller --onefile --name keylogger src/keylogger.py
- name: Build server executable
run: pyinstaller --onefile --name keylogger-server src/server.py
- name: Create distribution package (Unix)
if: runner.os != 'Windows'
run: |
mkdir -p package
cp dist/keylogger package/
cp dist/keylogger-server package/
cp -r config package/
cp README.md LICENSE DISCLAIMER.md SECURITY.md package/
tar -czvf ${{ matrix.artifact_name }}.tar.gz -C package .
- name: Create distribution package (Windows)
if: runner.os == 'Windows'
shell: pwsh
run: |
New-Item -ItemType Directory -Force -Path package
Copy-Item dist/keylogger.exe package/
Copy-Item dist/keylogger-server.exe package/
Copy-Item -Recurse config package/
Copy-Item README.md, LICENSE, DISCLAIMER.md, SECURITY.md package/
Compress-Archive -Path package/* -DestinationPath ${{ matrix.artifact_name }}.zip
- name: Upload executable artifact (Unix)
if: runner.os != 'Windows'
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.artifact_name }}
path: ${{ matrix.artifact_name }}.tar.gz
retention-days: 1
- name: Upload executable artifact (Windows)
if: runner.os == 'Windows'
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.artifact_name }}
path: ${{ matrix.artifact_name }}.zip
retention-days: 1
release:
name: Create Release
needs: [build-packages, build-executables]
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Get version
id: get_version
run: |
if [ "${{ github.event_name }}" = "push" ]; then
VERSION="${GITHUB_REF#refs/tags/}"
else
VERSION="${{ inputs.version }}"
fi
# Trim leading and trailing whitespace
VERSION=$(echo "$VERSION" | xargs)
echo "version=$VERSION" >> $GITHUB_OUTPUT
# Determine if it's a prerelease (contains hyphen after version number)
if [[ "$VERSION" =~ ^v[0-9]+\.[0-9]+\.[0-9]+-.+ ]]; then
echo "prerelease=true" >> $GITHUB_OUTPUT
else
echo "prerelease=${{ inputs.prerelease || 'false' }}" >> $GITHUB_OUTPUT
fi
- name: Validate version format
run: |
VERSION="${{ steps.get_version.outputs.version }}"
if [[ ! "$VERSION" =~ ^v[0-9]+\.[0-9]+\.[0-9]+(-[a-zA-Z0-9.]+)?$ ]]; then
echo "Error: Version must follow semantic versioning (e.g., v1.0.0 or v1.0.0-beta.1)"
exit 1
fi
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
- name: List artifacts
run: find artifacts -type f
- name: Create Release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ steps.get_version.outputs.version }}
name: Release ${{ steps.get_version.outputs.version }}
body: |
## Keylogger ${{ steps.get_version.outputs.version }}
### 📦 Downloads
**Pre-built Executables:**
- 🐧 **Linux**: `keylogger-linux.tar.gz`
- 🪟 **Windows**: `keylogger-windows.zip`
- 🍎 **macOS**: `keylogger-macos.tar.gz`
**Python Package:**
- `keylogger_educational-<version>-py3-none-any.whl` - Install with `pip install <filename>`
- `keylogger_educational-<version>.tar.gz` - Source distribution
### 🚀 Quick Start
**Using pre-built executables:**
1. Download the package for your operating system
2. Extract the archive
3. Configure `config/config.json` and `config/.env`
4. Run `./keylogger-server` to start the web server
5. Run `./keylogger` to start the keylogger
**Using Python package:**
1. `pip install keylogger_educational-*.whl`
2. Run `keylogger-server` and `keylogger` commands
**From source:**
1. Clone or download this release
2. Run `./setup.sh` to install dependencies
3. Configure `config/config.json` and `config/.env`
4. Start the server: `python3 src/server.py`
5. Run the keylogger: `python3 src/keylogger.py`
### ⚠️ Important Legal Disclaimer
**This project is for EDUCATIONAL PURPOSES ONLY.**
- Unauthorized use of keyloggers is **illegal** and may result in criminal prosecution
- Always obtain **explicit informed consent** before deploying any monitoring software
- Users are responsible for complying with all applicable local and international laws
- See [DISCLAIMER.md](https://github.com/Stalin-143/Keylogger/blob/main/DISCLAIMER.md) for full legal information
See [README.md](https://github.com/Stalin-143/Keylogger/blob/main/README.md) for full documentation.
files: |
artifacts/python-package/*
artifacts/keylogger-linux/*
artifacts/keylogger-windows/*
artifacts/keylogger-macos/*
draft: false
prerelease: ${{ steps.get_version.outputs.prerelease }}
generate_release_notes: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}