Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 57 additions & 0 deletions .github/workflows/build-binary.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Build and Release Binary

on:
release:
types: [published]

jobs:
build:
strategy:
matrix:
include:
- os: ubuntu-latest
asset_name: ghosttrack-linux
executable_name: GhostTR
- os: windows-latest
asset_name: ghosttrack-windows.exe
executable_name: GhostTR.exe
- os: macos-latest
asset_name: ghosttrack-macos
executable_name: GhostTR

runs-on: ${{ matrix.os }}

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pyinstaller
pip install -r requirements.txt

- name: Build binary
run: |
pyinstaller --onefile --name GhostTR GhostTR.py

- name: Rename binary
shell: bash
run: |
if [[ "${{ matrix.os }}" == "windows-latest" ]]; then
mv dist/GhostTR.exe dist/${{ matrix.asset_name }}
else
mv dist/GhostTR dist/${{ matrix.asset_name }}
fi

- name: Upload binary to release
uses: softprops/action-gh-release@v2
with:
files: dist/${{ matrix.asset_name }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}