Skip to content
Merged
Show file tree
Hide file tree
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
99 changes: 87 additions & 12 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,36 @@ on:
workflow_dispatch:

jobs:
build-python:
name: Build Python Executable
lint-python:
name: Lint Python
runs-on: ubuntu-latest

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

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'

- name: Install lint dependencies
run: |
python -m pip install --upgrade pip
pip install ruff pyright
pip install -r python/requirements.txt

- name: Run ruff linter
working-directory: python
run: ruff check .

- name: Run pyright type checker
working-directory: python
run: pyright

build-python-windows:
name: Build Python (Windows)
needs: [lint-python]
runs-on: windows-latest

steps:
Expand All @@ -38,14 +66,53 @@ jobs:
--add-data "resources;resources" `
sc_main.py

- name: Upload Python artifact
- name: Upload Python Windows artifact
uses: actions/upload-artifact@v4
with:
name: SCPlaytime-Python-Windows
path: python/dist/SCPlaytime.exe

build-python-linux:
name: Build Python (Linux)
needs: [lint-python]
runs-on: ubuntu-latest

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

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'

- name: Install system dependencies
run: |
sudo apt-get update
sudo apt-get install -y python3-tk

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

- name: Build executable
working-directory: python
run: |
pyinstaller --onefile --windowed --name "SCPlaytime" \
--add-data "resources:resources" \
sc_main.py

- name: Upload Python Linux artifact
uses: actions/upload-artifact@v4
with:
name: SCPlaytime-Python-Linux
path: python/dist/SCPlaytime

build-csharp:
name: Build C# Executable
name: Build C# (Windows)
runs-on: windows-latest

steps:
Expand All @@ -64,7 +131,7 @@ jobs:

- name: Build solution
working-directory: csharp
run: msbuild StarCitizenPlaytimeCalculator.sln /p:Configuration=Release /p:Platform="Any CPU"
run: msbuild StarCitizenPlaytimeCalculator.sln /p:Configuration=Release /p:Platform="Any CPU" /p:TreatWarningsAsErrors=true /p:RunAnalyzersDuringBuild=true

- name: Upload C# artifact
uses: actions/upload-artifact@v4
Expand All @@ -74,19 +141,25 @@ jobs:

create-release:
name: Create Release
needs: [build-python, build-csharp]
needs: [build-python-windows, build-python-linux, build-csharp]
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')

permissions:
contents: write

steps:
- name: Download Python artifact
- name: Download Python Windows artifact
uses: actions/download-artifact@v4
with:
name: SCPlaytime-Python-Windows
path: artifacts/python
path: artifacts/python-windows

- name: Download Python Linux artifact
uses: actions/download-artifact@v4
with:
name: SCPlaytime-Python-Linux
path: artifacts/python-linux

- name: Download C# artifact
uses: actions/download-artifact@v4
Expand All @@ -97,15 +170,17 @@ jobs:
- name: Create release archives
run: |
cd artifacts
zip -r ../SCPlaytime-Python-${{ github.ref_name }}.zip python/
zip -r ../SCPlaytime-CSharp-${{ github.ref_name }}.zip csharp/
zip -r ../SCPlaytime-Python-Windows-${{ github.ref_name }}.zip python-windows/
zip -r ../SCPlaytime-Python-Linux-${{ github.ref_name }}.zip python-linux/
zip -r ../SCPlaytime-CSharp-Windows-${{ github.ref_name }}.zip csharp/

- name: Create GitHub Release
uses: softprops/action-gh-release@v1
with:
files: |
SCPlaytime-Python-${{ github.ref_name }}.zip
SCPlaytime-CSharp-${{ github.ref_name }}.zip
SCPlaytime-Python-Windows-${{ github.ref_name }}.zip
SCPlaytime-Python-Linux-${{ github.ref_name }}.zip
SCPlaytime-CSharp-Windows-${{ github.ref_name }}.zip
generate_release_notes: true
draft: false
prerelease: false
27 changes: 20 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,27 @@ Since Star Citizen doesn't expose playtime statistics in-game, SCPlay parses you
### Download Pre-built Executable

1. Go to [Releases](https://github.com/ckuma/scplay/releases)
2. Download the latest `.zip` for your preferred version
2. Download the appropriate `.zip` for your platform
3. Extract and run

### Available Versions
### Available Downloads

| Version | Platform | Framework | Best For |
|---------|----------|-----------|----------|
| **Python** | Windows, Linux, macOS | Tkinter | Cross-platform users |
| **C#** | Windows | WinForms | Windows-only users |
| Release | Platform | Description |
|---------|----------|-------------|
| `SCPlaytime-Python-Windows` | Windows | Python executable (.exe) |
| `SCPlaytime-Python-Linux` | Linux | Python executable (binary) |
| `SCPlaytime-CSharp-Windows` | Windows | C# WinForms executable (.exe) |

**Note:** macOS users should run the Python version from source (see Installation below).

### v2.0 Design

Both versions feature a modernized dark UI with Star Citizen-inspired aesthetics:
- Dark navy theme with cyan/green accents
- Grouped panels (Configuration, Processing Log, Results)
- Color-coded log output
- Progress indicators during calculation
- Status bar with colored feedback

---

Expand Down Expand Up @@ -186,7 +198,7 @@ Output: `bin/Release/StarCitizenPlaytimeCalculator.exe`

This repository uses GitHub Actions to automatically build releases:

- **On tag push** (`v*`) - Creates a GitHub Release with both executables
- **On tag push** (`v*`) - Creates a GitHub Release with 3 executables (Python Windows, Python Linux, C# Windows)
- **On PR** - Validates builds

To create a new release:
Expand Down Expand Up @@ -228,6 +240,7 @@ Distributed under the MIT License. See `LICENSE.txt` for more information.

- Star Citizen community
- All contributors
- [VNGD](https://vngd.net/)

---

Expand Down
Loading