Skip to content

Improve GitHub Actions workflow with automatic releases #2

Improve GitHub Actions workflow with automatic releases

Improve GitHub Actions workflow with automatic releases #2

Workflow file for this run

name: Build GhostInjector
on:
push:
branches: [ main, master ]
pull_request:
branches: [ main, master ]
workflow_dispatch:
jobs:
build-windows-msvc:
runs-on: windows-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: recursive
- name: Setup MSVC
uses: microsoft/setup-msbuild@v2
- name: Configure CMake
run: |
cmake -B build -G "Visual Studio 17 2022" -A x64
- name: Build
run: |
cmake --build build --config Release
- name: Check DLL dependencies
shell: pwsh
run: |
Write-Host "=== Executable Info ==="
Get-ChildItem -Path build\Release\ghostinjector-*.exe | ForEach-Object {
Write-Host "File: $($_.Name)"
Write-Host "Size: $([math]::Round($_.Length / 1MB, 2)) MB"
Write-Host ""
}
Write-Host "=== Checking for MSVC Runtime Dependencies ==="
Write-Host "Note: This executable requires Visual C++ Redistributable (vcruntime140.dll, msvcp140.dll)"
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: ghostinjector-windows-x64-msvc
path: build/Release/ghostinjector-*.exe
if-no-files-found: error
retention-days: 90
- name: Get executable name
id: get-exe-name
shell: pwsh
run: |
$exePath = Get-ChildItem -Path build\Release\ghostinjector-*.exe | Select-Object -First 1
echo "exe-name=$($exePath.Name)" >> $env:GITHUB_OUTPUT
echo "exe-path=$($exePath.FullName)" >> $env:GITHUB_OUTPUT
- name: Create/Update Latest Release
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
uses: softprops/action-gh-release@v2
with:
tag_name: latest
name: Latest Build (Development)
body: |
## 🚀 Latest Development Build
**Commit:** ${{ github.sha }}
**Date:** ${{ github.event.head_commit.timestamp }}
**Message:** ${{ github.event.head_commit.message }}
### ⚠️ Requirements
- Windows 10/11 (64-bit)
- [Visual C++ Redistributable](https://aka.ms/vs/17/release/vc_redist.x64.exe)
### 📥 Download
Download `${{ steps.get-exe-name.outputs.exe-name }}` below
### 📖 Usage
```
ghostinjector-1.0.2.exe <pid> <dll_path1> [dll_path2] ...
```
files: build/Release/ghostinjector-*.exe
draft: false
prerelease: true
make_latest: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Create Release (on version tag)
if: startsWith(github.ref, 'refs/tags/v')
uses: softprops/action-gh-release@v2
with:
name: Release ${{ github.ref_name }}
body: |
## 📦 Release ${{ github.ref_name }}
### ⚠️ Requirements
- Windows 10/11 (64-bit)
- [Visual C++ Redistributable](https://aka.ms/vs/17/release/vc_redist.x64.exe)
### 📥 Download
Download the executable below
### 📖 Usage
```
ghostinjector-1.0.2.exe <pid> <dll_path1> [dll_path2] ...
```
### ✨ Features
- Modern C++11 codebase
- Command-line argument parsing with cxxopts
- Support for multiple DLL injection
- Positional arguments support
files: build/Release/ghostinjector-*.exe
draft: false
prerelease: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}