Update GitHub Actions workflow to use MinGW for building GhostInjector #16
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build GhostInjector | |
| on: | |
| push: | |
| branches: [ main, master ] | |
| pull_request: | |
| branches: [ main, master ] | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| jobs: | |
| build-windows-mingw: | |
| runs-on: windows-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| submodules: recursive | |
| - name: Set up MinGW | |
| run: | | |
| choco install mingw | |
| echo "C:\ProgramData\chocolatey\lib\mingw\tools\install\mingw64\bin" >> $env:GITHUB_PATH | |
| - name: Configure CMake | |
| run: | | |
| cmake -B build -G "MinGW Makefiles" -DCMAKE_BUILD_TYPE=Release | |
| - name: Build | |
| run: | | |
| cmake --build build | |
| - name: Rename executable | |
| run: move build\ghostinjector-*.exe build\ghostinjector.exe | |
| - name: Check DLL dependencies | |
| run: | | |
| objdump -p build/ghostinjector.exe | findstr "DLL" | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: ghostinjector-windows-x64-mingw | |
| path: build/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\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) | |
| ### 📥 Download | |
| Download `${{ steps.get-exe-name.outputs.exe-name }}` below | |
| ### 📖 Usage | |
| ``` | |
| ghostinjector.exe <pid> <dll_path1> [dll_path2] ... | |
| ``` | |
| files: build/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) | |
| ### 📥 Download | |
| Download the executable below | |
| ### 📖 Usage | |
| ``` | |
| ghostinjector.exe <pid> <dll_path1> [dll_path2] ... | |
| ``` | |
| ### ✨ Features | |
| - Support for multiple DLL injection | |
| - Positional arguments support | |
| files: build/ghostinjector.exe | |
| draft: false | |
| prerelease: false | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |