Skip to content

Commit 2a2821b

Browse files
committed
Enhance GitHub Actions workflow for building and releasing GhostInjector
1 parent 1b00730 commit 2a2821b

1 file changed

Lines changed: 44 additions & 77 deletions

File tree

.github/workflows/build.yml

Lines changed: 44 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Build GhostInjector
1+
name: Build and Release GhostInjector
22

33
on:
44
push:
@@ -13,103 +13,70 @@ permissions:
1313
jobs:
1414
build-windows-mingw:
1515
runs-on: windows-latest
16-
1716
steps:
18-
- name: Checkout repository
19-
uses: actions/checkout@v4
17+
- uses: actions/checkout@v4
2018
with:
2119
submodules: recursive
22-
2320
- name: Set up MinGW
2421
run: |
2522
choco install mingw
2623
echo "C:\ProgramData\chocolatey\lib\mingw\tools\install\mingw64\bin" >> $env:GITHUB_PATH
27-
2824
- name: Configure CMake
29-
run: |
30-
cmake -B build -G "MinGW Makefiles" -DCMAKE_BUILD_TYPE=Release
31-
25+
run: cmake -B build -G "MinGW Makefiles" -DCMAKE_BUILD_TYPE=Release
3226
- name: Build
33-
run: |
34-
cmake --build build
35-
27+
run: cmake --build build
3628
- name: Rename executable
3729
run: move build\ghostinjector-*.exe build\ghostinjector.exe
38-
39-
- name: Check DLL dependencies
40-
run: |
41-
objdump -p build/ghostinjector.exe | findstr "DLL"
42-
43-
- name: Upload artifact
44-
uses: actions/upload-artifact@v4
30+
- uses: actions/upload-artifact@v4
4531
with:
46-
name: ghostinjector-windows-x64-mingw
32+
name: ghostinjector-windows
4733
path: build/ghostinjector.exe
48-
if-no-files-found: error
49-
retention-days: 90
50-
51-
- name: Get executable name
52-
id: get-exe-name
53-
shell: pwsh
54-
run: |
55-
$exePath = Get-ChildItem -Path build\ghostinjector.exe | Select-Object -First 1
56-
echo "exe-name=$($exePath.Name)" >> $env:GITHUB_OUTPUT
57-
echo "exe-path=$($exePath.FullName)" >> $env:GITHUB_OUTPUT
58-
59-
- name: Create/Update Latest Release
60-
if: github.ref == 'refs/heads/main' && github.event_name == 'push'
34+
35+
build-linux-gcc:
36+
runs-on: ubuntu-latest
37+
steps:
38+
- uses: actions/checkout@v4
39+
with:
40+
submodules: recursive
41+
- name: Install dependencies
42+
run: sudo apt-get update && sudo apt-get install -y build-essential
43+
- name: Configure CMake
44+
run: cmake -B build -DCMAKE_BUILD_TYPE=Release
45+
- name: Build
46+
run: cmake --build build
47+
- name: Rename executable
48+
run: mv build/ghostinjector-* build/ghostinjector
49+
- uses: actions/upload-artifact@v4
50+
with:
51+
name: ghostinjector-linux
52+
path: build/ghostinjector
53+
54+
release:
55+
runs-on: ubuntu-latest
56+
needs: [build-windows-mingw, build-linux-gcc]
57+
if: (github.ref == 'refs/heads/main' && github.event_name == 'push') || startsWith(github.ref, 'refs/tags/v')
58+
steps:
59+
- uses: actions/download-artifact@v4
60+
with:
61+
path: artifacts
62+
- name: Create Release
6163
uses: softprops/action-gh-release@v2
6264
with:
63-
tag_name: latest
64-
name: Latest Build (Development)
65+
tag_name: ${{ (github.ref == 'refs/heads/main' && 'latest') || github.ref_name }}
66+
name: ${{ (github.ref == 'refs/heads/main' && 'Latest Build (Development)') || github.ref_name }}
6567
body: |
6668
## 🚀 Latest Development Build
6769
6870
**Commit:** ${{ github.sha }}
69-
**Date:** ${{ github.event.head_commit.timestamp }}
70-
**Message:** ${{ github.event.head_commit.message }}
71-
72-
### ⚠️ Requirements
73-
- Windows 10/11 (64-bit)
74-
75-
### 📥 Download
76-
Download `${{ steps.get-exe-name.outputs.exe-name }}` below
77-
78-
### 📖 Usage
79-
```
80-
ghostinjector.exe <pid> <dll_path1> [dll_path2] ...
81-
```
82-
files: build/ghostinjector.exe
83-
draft: false
84-
prerelease: true
85-
make_latest: true
86-
env:
87-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
88-
89-
- name: Create Release (on version tag)
90-
if: startsWith(github.ref, 'refs/tags/v')
91-
uses: softprops/action-gh-release@v2
92-
with:
93-
name: Release ${{ github.ref_name }}
94-
body: |
95-
## 📦 Release ${{ github.ref_name }}
96-
97-
### ⚠️ Requirements
98-
- Windows 10/11 (64-bit)
9971
10072
### 📥 Download
101-
Download the executable below
102-
103-
### 📖 Usage
104-
```
105-
ghostinjector.exe <pid> <dll_path1> [dll_path2] ...
106-
```
107-
108-
### ✨ Features
109-
- Support for multiple DLL injection
110-
- Positional arguments support
111-
files: build/ghostinjector.exe
73+
- **Windows:** `ghostinjector.exe`
74+
- **Linux:** `ghostinjector`
75+
files: |
76+
artifacts/ghostinjector-windows/ghostinjector.exe
77+
artifacts/ghostinjector-linux/ghostinjector
11278
draft: false
113-
prerelease: false
79+
prerelease: ${{ github.ref == 'refs/heads/main' }}
80+
make_latest: ${{ github.ref == 'refs/heads/main' }}
11481
env:
11582
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)