Skip to content
Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Latest commit

Β 

History

8 Commits

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

QB64PE Docker Banner

Build Status Tests License: MIT Docker QB64PE Version

QB64PE Logo

A Docker container and GitHub Action for compiling QB64 BASIC programs using QB64 Phoenix Edition (QB64PE).

Features β€’ Quick Start β€’ Documentation β€’ Examples


Features

βœ… Multi-platform builds - Build for Linux, macOS, and Windows in parallel
βœ… Automatic releases - Create GitHub releases with binaries for all platforms
βœ… Smart packaging - Include only what you need with .qb64pe-ignore
βœ… Reusable action - Drop-in workflow for any QB64PE project
βœ… Docker support - Compile locally or in CI/CD
βœ… Latest QB64PE - Built from source with configurable version
βœ… Matrix builds - Parallel compilation across platforms

πŸ—οΈ Architecture

graph LR
    A[Your .bas File] --> B[GitHub Action]
    B --> C[Linux Build<br/>Docker]
    B --> D[macOS Build<br/>Native]
    B --> E[Windows Build<br/>Native]
    C --> F[.tar.gz]
    D --> G[.tar.gz]
    E --> H[.zip]
    F --> I[GitHub Release]
    G --> I
    H --> I
    I --> J[Download Binaries]
    
    style A fill:#ec4899,stroke:#be185d,stroke-width:3px,color:#fff
    style I fill:#10b981,stroke:#059669,stroke-width:3px,color:#fff
    style C fill:#3b82f6,stroke:#1e40af,stroke-width:3px,color:#fff
    style D fill:#3b82f6,stroke:#1e40af,stroke-width:3px,color:#fff
    style E fill:#3b82f6,stroke:#1e40af,stroke-width:3px,color:#fff
    style B fill:#1e293b,stroke:#475569,stroke-width:3px,color:#fff
    style F fill:#475569,stroke:#1e293b,stroke-width:2px,color:#fff
    style G fill:#475569,stroke:#1e293b,stroke-width:2px,color:#fff
    style H fill:#475569,stroke:#1e293b,stroke-width:2px,color:#fff
    style J fill:#1e293b,stroke:#475569,stroke-width:3px,color:#fff
Loading
Linux macOS Windows

πŸš€ Quick Start

Terminal Demo

For QB64PE Project Developers (Recommended)

Add this to your QB64PE project's .github/workflows/build.yml:

name: Build My QB64PE Project

on:
  push:
    branches: [ main ]
    tags: [ 'v*' ]

jobs:
  build:
    uses: grymmjack/qb64pe-docker/.github/workflows/reusable-build.yml@main
    with:
      source-file: 'src/main.bas'
      project-name: 'my-awesome-game'
      qb64pe-version: 'v4.3.0'

What you get:

  • βœ… Builds for Linux, macOS, and Windows
  • βœ… Downloadable artifacts for each platform
  • βœ… Automatic releases when you push tags (e.g., v1.0.0)
  • βœ… All binaries uploaded to GitHub releases

πŸ“– Full Guide: Using as a Reusable Action

⚑ One-Command Build Example

# Tag your code and push - that's it!
git tag v1.0.0 && git push origin v1.0.0

# GitHub Actions automatically:
# βœ… Builds for Linux, macOS, Windows
# βœ… Creates a GitHub Release
# βœ… Uploads all binaries
πŸ“Έ See Example Release Output
βœ“ Build for linux completed
βœ“ Build for macos completed  
βœ“ Build for windows completed

πŸ“¦ Created Release v1.0.0
   β”œβ”€β”€ my-game-lnx-x64.tar.gz  (1.2 MB)
   β”œβ”€β”€ my-game-osx-x64.tar.gz  (1.3 MB)
   └── my-game-win-x64.zip     (1.4 MB)

πŸ”„ Build Process

Build Flow


Using Docker Locally

Build the image

make build

Compile a QB64 program

docker run --rm -v "$(pwd):/workspace" qb64pe:latest -x -w yourprogram.bas -o yourprogram

Using the helper script

./qb64pe-compile.sh workspace/hello.bas hello

Using Docker Compose

# Build the image
docker compose build

# Run a compilation
docker compose run --rm qb64pe -x -w hello.bas -o hello

🎬 GitHub Action Usage

Reusable Workflow (Recommended)

The easiest way to build QB64PE projects for multiple platforms:

jobs:
  build:
    uses: grymmjack/qb64pe-docker/.github/workflows/reusable-build.yml@main
    with:
      source-file: 'game.bas'
      project-name: 'retro-racer'

See REUSABLE-ACTION.md for complete documentation.

πŸ”„ Workflow Visualization

sequenceDiagram
    participant Dev as Developer
    participant Git as GitHub
    participant GHA as GitHub Actions
    participant Docker as Docker Hub
    participant Release as Release Page
    
    Dev->>Git: Push tag v1.0.0
    Git->>GHA: Trigger workflow
    GHA->>GHA: Matrix: Linux, macOS, Windows
    GHA->>Docker: Pull QB64PE image (Linux)
    Docker-->>GHA: Image ready
    GHA->>GHA: Compile on all platforms
    GHA->>Release: Create release
    GHA->>Release: Upload binaries
    Release-->>Dev: Download ready!
Loading

Direct Action Usage

For custom matrix builds:

name: Build QB64 Program

on: [push]

jobs:
  build:
    name: Build for ${{ matrix.platform }}
    runs-on: ${{ matrix.os }}
    strategy:
      matrix:
        include:
          - os: ubuntu-latest
            platform: linux
          - os: macos-latest
            platform: macos
          - os: windows-latest
            platform: windows
    
    steps:
      - uses: actions/checkout@v4
      
      - uses: grymmjack/qb64pe-docker@main
        with:
          source-file: 'src/main.bas'
          project-name: 'my-program'
          platform: ${{ matrix.platform }}
          path: src/myprogram

Advanced Example

name: Multi-Platform Build

on:
  release:
    types: [ created ]

jobs:
  build:
    runs-on: ubuntu-latest
    strategy:
      matrix:
        program:
          - { source: 'game.bas', output: 'mygame' }
          - { source: 'tools/converter.bas', output: 'converter' }
    
    steps:
      - name: Checkout code
        uses: actions/checkout@v4
      
      - name: Compile ${{ matrix.program.output }}
        uses: grymmjack/qb64pe-docker@v1
        with:
          source: ${{ matrix.program.source }}
          output: ${{ matrix.program.output }}
          qb64pe-version: v3.15.0
      
      - name: Upload to release
        uses: actions/upload-release-asset@v1
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        with:
          upload_url: ${{ github.event.release.upload_url }}
          asset_path: ./${{ matrix.program.output }}
          asset_name: ${{ matrix.program.output }}-linux
          asset_content_type: application/octet-stream

Action Inputs

Input Description Required Default
source Path to QB64 BASIC source file (.bas) Yes -
output Name of output executable (without extension) No Source filename without .bas
qb64pe-version QB64PE version to use (e.g., v3.15.0) No v3.15.0
additional-flags Additional compiler flags No -

Action Outputs

Output Description
executable Path to the compiled executable

QB64PE Compiler Flags

The QB64PE compiler supports various flags:

  • -x - Compile to executable
  • -w - Show compilation warnings
  • -o <name> - Specify output name
  • -c - Console-only mode
  • -f - Compiler settings (e.g., -f:OptimizeForSpeed)

Example with flags:

- name: Compile with optimization
  uses: grymmjack/qb64pe-docker@v1
  with:
    source: game.bas
    output: game
    additional-flags: -f:OptimizeForSpeed

Docker Image Tags

Images are available on GitHub Container Registry:

# Latest version
docker pull ghcr.io/grymmjack/qb64pe-docker:latest

# Specific version
docker pull ghcr.io/grymmjack/qb64pe-docker:v3.15.0

Local Development

Prerequisites

  • Docker
  • Docker Compose (optional)
  • Bash (for helper scripts)

Building locally

# Build with default QB64PE version
docker build -t qb64pe:latest .

# Build with specific version
docker build --build-arg QB64PE_VERSION=v3.14.1 -t qb64pe:v3.14.1 .

Testing

A sample program is included in workspace/hello.bas:

# Using the helper script
./qb64pe-compile.sh workspace/hello.bas

# Using Docker directly
docker run --rm -v "$(pwd)/workspace:/workspace" qb64pe:latest -x -w hello.bas -o hello

# Check the compiled executable
ls -lh workspace/hello

Project Structure

qb64pe-docker/
β”œβ”€β”€ Dockerfile              # Multi-stage Docker build
β”œβ”€β”€ docker-compose.yml      # Docker Compose configuration
β”œβ”€β”€ action.yml             # GitHub Action definition
β”œβ”€β”€ qb64pe-compile.sh      # Compilation helper script
β”œβ”€β”€ .github/
β”‚   └── workflows/
β”‚       β”œβ”€β”€ docker-build.yml  # Build and push Docker image
β”‚       └── test.yml          # Test the action
β”œβ”€β”€ workspace/             # Sample QB64 programs
β”‚   └── hello.bas
└── README.md

How It Works

  1. Multi-stage Build: The Dockerfile uses a two-stage build process:

    • Builder stage: Installs build dependencies and compiles QB64PE from source
    • Runtime stage: Copies only the compiled QB64PE and minimal runtime dependencies
  2. Small Image Size: By using Debian Slim and only copying necessary files, the final image is kept small

  3. Universal Compatibility: The Docker container provides a consistent Linux environment that works on macOS, Windows, and Linux hosts

  4. GitHub Actions Integration: The action automatically pulls or builds the Docker image and compiles your QB64 programs in CI/CD pipelines

System Requirements

Docker Host

  • Docker 20.10 or later
  • Docker Compose 2.0 or later (optional)

For Building

  • 2GB+ RAM
  • 2GB+ disk space

πŸ“š Documentation

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

This project is licensed under the MIT License - see the LICENSE file for details.

QB64 Phoenix Edition is licensed under the MIT License and the GNU LGPL - see the QB64PE repository for details.

Links

Troubleshooting

Permission Issues

If you encounter permission issues with the compiled executable:

docker run --rm -v "$(pwd):/workspace" --user $(id -u):$(id -g) qb64pe:latest -x -w program.bas

Display Issues

QB64PE programs with graphics require X11. For GUI programs:

docker run --rm \
  -v "$(pwd):/workspace" \
  -e DISPLAY=$DISPLAY \
  -v /tmp/.X11-unix:/tmp/.X11-unix \
  qb64pe:latest -x -w program.bas

Memory Issues

For large programs, increase Docker's memory limit:

docker run --rm -m 4g -v "$(pwd):/workspace" qb64pe:latest -x -w program.bas

Support


Made with ❀️ for the QB64 community

About

QB64PE Docker

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages