Skip to content
Draft
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
27 changes: 27 additions & 0 deletions .github/runner/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
FROM fedora:43

# Install build dependencies for native Linux and Windows cross-compilation
RUN dnf install -y \
gcc gcc-c++ make \
mingw64-gcc mingw64-gcc-c++ mingw64-winpthreads-static \
curl tar gzip \
git \
&& dnf clean all

# Create runner user (don't run as root for security)
RUN useradd -m -s /bin/bash runner
USER runner
WORKDIR /home/runner

# Download and extract GitHub Actions runner
# Version should match latest from: https://github.com/actions/runner/releases
RUN curl -o actions-runner-linux-x64-2.321.0.tar.gz \
-L https://github.com/actions/runner/releases/download/v2.321.0/actions-runner-linux-x64-2.321.0.tar.gz \
&& tar xzf actions-runner-linux-x64-2.321.0.tar.gz \
&& rm actions-runner-linux-x64-2.321.0.tar.gz

# SDK will be mounted at /sdk (read-only) when container runs
# Build workflows will symlink /sdk to workspace library/sdk before building

# Entrypoint runs the GitHub Actions runner
CMD ["./run.sh"]
145 changes: 145 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,145 @@
name: Build SteamworksPy

on:
push:
branches:
- master
tags:
- 'v*'
- '[0-9]*'
pull_request:
branches:
- master

jobs:
build-linux:
name: Build Linux (native)
runs-on: [self-hosted, linux, x64]

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

- name: Verify SDK mounted
run: |
if [ ! -d "/sdk/public/steam" ]; then
echo "ERROR: SDK not mounted at /sdk"
echo "Expected SDK to be mounted from host at /sdk"
exit 1
fi
echo "SDK found at /sdk"
ls -lh /sdk/public/steam | head -5
ls -lh /sdk/redistributable_bin/linux64/libsteam_api.so

- name: Symlink SDK to workspace
run: |
cd library
ln -sf /sdk sdk
echo "SDK symlinked to library/sdk"

- name: Build Linux library
run: |
cd library
chmod +x build_linux.sh
./build_linux.sh

- name: Upload Linux artifact
uses: actions/upload-artifact@v4
with:
name: linux-x64
path: |
redist/linux/SteamworksPy.so
redist/linux/libsteam_api.so
if-no-files-found: error

build-windows-cross:
name: Build Windows (cross-compile)
runs-on: [self-hosted, linux, x64]

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

- name: Verify SDK mounted
run: |
if [ ! -d "/sdk/public/steam" ]; then
echo "ERROR: SDK not mounted at /sdk"
echo "Expected SDK to be mounted from host at /sdk"
exit 1
fi
echo "SDK found at /sdk"
ls -lh /sdk/public/steam | head -5
ls -lh /sdk/redistributable_bin/win64/steam_api64.dll
ls -lh /sdk/redistributable_bin/win64/steam_api64.lib

- name: Symlink SDK to workspace
run: |
cd library
ln -sf /sdk sdk
echo "SDK symlinked to library/sdk"

- name: Build Windows library (MinGW cross-compile)
run: |
cd library
chmod +x build_windows_cross.sh
./build_windows_cross.sh

- name: Upload Windows artifact
uses: actions/upload-artifact@v4
with:
name: windows-x64
path: |
redist/windows/SteamworksPy64.dll
redist/windows/steam_api64.dll
if-no-files-found: error

release:
name: Create GitHub Release
needs: [build-linux, build-windows-cross]
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
permissions:
contents: write

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

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

- name: Download Windows artifacts
uses: actions/download-artifact@v4
with:
name: windows-x64
path: artifacts/windows

- name: Extract version from tag
id: get_version
run: echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT

- name: Create GitHub Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
VERSION="${{ steps.get_version.outputs.VERSION }}"

gh release create "$VERSION" \
--title "SteamworksPy $VERSION" \
--notes "Automated release for $VERSION

## Binaries

- **Linux**: \`SteamworksPy.so\` + \`libsteam_api.so\`
- **Windows**: \`SteamworksPy64.dll\` + \`steam_api64.dll\`

Built with automated CI/CD using containerized self-hosted runner.

🤖 Generated with [Claude Code](https://claude.com/claude-code)" \
artifacts/linux/SteamworksPy.so \
artifacts/linux/libsteam_api.so \
artifacts/windows/SteamworksPy64.dll \
artifacts/windows/steam_api64.dll
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@
*.dylib
!redist/windows/*.dll
!redist/osx/*.dylib
!redist/linux/*.so
!redist/linux/*.so
library/sdk
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,18 @@ Pre-builds for Windows and Linux here: https://github.com/philippj/SteamworksPy/

Full documentation on getting started is now available here: https://philippj.github.io/SteamworksPy/

## Automated Builds

SteamworksPy now has automated CI/CD! Builds are automatically created for Linux and Windows on every commit using self-hosted GitHub Actions runners with cross-compilation.

**For users:** Pre-built binaries are available on the [Releases page](https://github.com/philippj/SteamworksPy/releases).

**For maintainers setting up CI/CD:**
- 🚀 **Quick Start:** [docs/QUICKSTART.md](docs/QUICKSTART.md) - Step-by-step setup guide (3-4 hours)
- 📚 **Reference:** [docs/CI_SETUP.md](docs/CI_SETUP.md) - Detailed documentation and troubleshooting

The setup uses a Podman container with MinGW for Windows cross-compilation, allowing both Linux and Windows builds from a single Linux machine while complying with Valve's SDK licensing requirements.

## What's New
Updates since February 1st, 2020
- Added: GetNumAchievements, GetAchievementName, GetAChievementDisplayAttribute by **aveao**
Expand Down
Loading