Skip to content

Commit 554c750

Browse files
initial commit
0 parents  commit 554c750

23 files changed

Lines changed: 890 additions & 0 deletions

.github/workflows/release.yml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: Build UMU Sniper Source Runtime
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
snapshot:
7+
description: 'Override config/sniper.env (example: latest-container-runtime-depot or 3.0.20260218.209091)'
8+
required: false
9+
type: string
10+
push:
11+
tags:
12+
- 'v*'
13+
14+
permissions:
15+
contents: write
16+
17+
jobs:
18+
build:
19+
runs-on: ubuntu-24.04
20+
env:
21+
SNAPSHOT_OVERRIDE: ${{ github.event_name == 'workflow_dispatch' && inputs.snapshot || '' }}
22+
RELEASE_VERSION: ${{ github.ref_type == 'tag' && github.ref_name || format('manual-{0}', github.run_number) }}
23+
REPOSITORY_URL: ${{ github.server_url }}/${{ github.repository }}
24+
GIT_SHA: ${{ github.sha }}
25+
GIT_TAG: ${{ github.ref_type == 'tag' && github.ref_name || '' }}
26+
steps:
27+
- name: Check out source
28+
uses: actions/checkout@v4
29+
30+
- name: Install host build tools
31+
run: |
32+
sudo apt-get update
33+
sudo apt-get install -y dpkg-dev devscripts patch python3
34+
35+
- name: Set up Docker Buildx
36+
uses: docker/setup-buildx-action@v3
37+
38+
- name: Build runtime artifacts
39+
run: ./scripts/release-build.sh "$SNAPSHOT_OVERRIDE"
40+
41+
- name: Upload workflow artifacts
42+
uses: actions/upload-artifact@v4
43+
with:
44+
name: umu-sniper-source-${{ env.RELEASE_VERSION }}
45+
path: dist/*
46+
if-no-files-found: error
47+
48+
- name: Create or update GitHub release
49+
if: startsWith(github.ref, 'refs/tags/')
50+
env:
51+
GH_TOKEN: ${{ github.token }}
52+
run: |
53+
tag="${GITHUB_REF_NAME}"
54+
if gh release view "$tag" >/dev/null 2>&1; then
55+
gh release upload "$tag" dist/* --clobber
56+
else
57+
gh release create "$tag" dist/* --title "$tag" --generate-notes
58+
fi

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
build/
2+
dist/

README.md

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
# UMU Sniper Source Builder
2+
3+
This repository builds a UMU-owned Steam Runtime 3 (`sniper`) derivative **without downloading Valve's prebuilt runtime image or runtime tarball**.
4+
5+
Instead, it follows the same broad public pipeline Valve documents for Steam Runtime 3:
6+
7+
1. fetch SteamRT metadata and source package references,
8+
2. optionally fetch and patch source packages,
9+
3. optionally rebuild selected packages,
10+
4. assemble a base runtime from the SteamRT apt repositories plus any locally rebuilt packages,
11+
5. export that filesystem into a `FROM scratch` OCI image,
12+
6. optionally run a second Dockerfile-based overlay stage that matches the old `umu-sdk` customization model,
13+
7. attach artifacts to a tagged GitHub release.
14+
15+
Valve says the official container runtimes and SDKs are built with `flatdeb-steam`, not with the scripts in `steam-runtime`, and that all software making up the Steam Runtime is available in source and binary form in `repo.steampowered.com/steamrt`. The public `sniper` snapshot also publishes `manifest.dpkg`, `source-required.txt`, `Sources.gz`, build IDs, and the sysroot Dockerfile. This project uses those public inputs and never downloads `SteamLinuxRuntime_sniper.tar.xz` or `Platform-...-runtime.tar.gz`.
16+
17+
## What this gives you
18+
19+
- A source-visible pipeline.
20+
- A patch point before package rebuilds.
21+
- A package-assembled base image rather than a downloaded runtime image.
22+
- Your previous `umu-sdk` style of customization preserved as an optional final overlay stage.
23+
24+
## Important scope note
25+
26+
This is the **closest public equivalent** to Valve's pipeline that can be run in GitHub Actions with public artifacts. It is not a byte-for-byte clone of Valve's internal build farm, and it does not call Valve's private or undocumented infrastructure. The assembly step here uses the published SteamRT apt repository and the published package manifest to reconstruct the runtime package set.
27+
28+
## Repository layout
29+
30+
- `config/sniper.env` — snapshot pinning and repo settings.
31+
- `scripts/fetch-metadata.sh` — downloads build metadata, manifests, source lists, and `Sources.gz`.
32+
- `scripts/fetch-sources.sh` — mirrors the source packages listed in `source-required.txt`.
33+
- `scripts/unpack-sources.sh` — expands `.dsc` source packages for inspection and patching.
34+
- `patches/<source-package>/*.patch` — optional patches, applied in lexical order.
35+
- `scripts/rebuild-patched-packages.sh` — rebuilds only the source packages you patched, into a local apt repo.
36+
- `scripts/assemble-base.sh` — assembles the base runtime image from packages, exports it, and emits a `FROM scratch` OCI image.
37+
- `docker/overlay.Dockerfile` — optional old-style “take base image and layer our changes on top” stage.
38+
- `overlays/rootfs/` — optional file overlay copied into the exported rootfs before the final image is built.
39+
- `scripts/hooks/post-extract.sh` — optional shell customization hook after rootfs export.
40+
41+
## How the old `umu-sdk` model fits in
42+
43+
Your old flow was:
44+
45+
1. pull a prebuilt image,
46+
2. apply changes,
47+
3. publish a new image.
48+
49+
This repo keeps the same *shape* for the last step, but changes the upstream stage:
50+
51+
1. build the UMU base image from SteamRT package metadata and sources,
52+
2. tag that as the local base image,
53+
3. run `docker/overlay.Dockerfile` on top of it,
54+
4. export artifacts.
55+
56+
So the “apply changes on top of an image” part survives, but the image you are extending is one you built locally from public SteamRT inputs.
57+
58+
## Releasing
59+
60+
Push a tag such as:
61+
62+
```bash
63+
git tag -a v0.1.0 -m "v0.1.0"
64+
git push origin v0.1.0
65+
```
66+
67+
The workflow will create release artifacts including:
68+
69+
- source metadata bundle,
70+
- mirrored source package bundle,
71+
- assembled base rootfs tarball,
72+
- OCI archive for the base runtime image,
73+
- OCI archive for the final overlaid runtime image,
74+
- `SHA256SUMS`.
75+
76+
## Using patches
77+
78+
Drop patch files in:
79+
80+
```text
81+
patches/bash/*.patch
82+
patches/libdecor-0/*.patch
83+
patches/steam-runtime-tools/*.patch
84+
```
85+
86+
Only patched source packages are rebuilt locally. Everything else is installed from the pinned SteamRT apt repository, which keeps the pipeline practical for CI while still letting you inspect and modify sources where needed.

config/sniper.env

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# Pin this to a concrete build for reproducible releases.
2+
SNIPER_SNAPSHOT="latest-container-runtime-depot"
3+
4+
SNIPER_SUITE="sniper"
5+
SNIPER_VARIANT="Platform"
6+
SNIPER_ARCH="amd64,i386"
7+
SNIPER_BASE_URL="https://repo.steampowered.com/steamrt-images-sniper/snapshots"
8+
SNIPER_APT_URL="https://repo.steampowered.com/steamrt3/apt"
9+
SNIPER_APT_DIST="sniper"
10+
SNIPER_APT_COMPONENTS="main contrib non-free"
11+
DEBIAN_MIRROR="http://deb.debian.org/debian"
12+
DEBIAN_SECURITY_MIRROR="http://security.debian.org/debian-security"
13+
DEBIAN_RELEASE="bullseye"
14+
15+
UMU_RUNTIME_PREFIX="umu-sniper"
16+
UMU_IMAGE_NAME="ghcr.io/open-wine-components/umu-sniper"
17+
DEFAULT_CMD='["/bin/bash"]'
18+
19+
# Legacy customization stage. If docker/overlay.Dockerfile exists, it will run
20+
# after the source-built base image is created.
21+
ENABLE_LEGACY_OVERLAY="1"

docker/overlay.Dockerfile

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
ARG BASE_IMAGE
2+
FROM ${BASE_IMAGE}
3+
4+
# This file is the compatibility point for the old umu-sdk workflow.
5+
# Put RUN/COPY/ENV directives here the way you used to customize
6+
# a downloaded image, except BASE_IMAGE now points at a locally assembled
7+
# sniper base image.
8+
#
9+
# Example:
10+
# COPY docker/overlay-rootfs/ /
11+
# RUN mkdir -p /usr/local/share/umu
12+
13+
CMD ["/bin/bash"]

overlays/rootfs/.gitkeep

Whitespace-only changes.

patches/.gitkeep

Whitespace-only changes.
2.42 KB
Binary file not shown.
4.09 KB
Binary file not shown.
3.5 KB
Binary file not shown.

0 commit comments

Comments
 (0)