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
21 changes: 21 additions & 0 deletions .github/workflows/audit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# SPDX-License-Identifier: AGPL-3.0-only
name: Audit public publication boundary
on:
pull_request:
push:
branches: [main]
permissions:
contents: read
jobs:
audit:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09 # v5
with:
fetch-depth: 0
persist-credentials: false
- uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6
with:
python-version: '3.12'
- run: python release.py check-repository
- run: python -m unittest -v test_release
137 changes: 137 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,137 @@
# SPDX-License-Identifier: AGPL-3.0-only
name: Build and publish binary SDKs
on:
workflow_dispatch:
inputs:
engine_commit:
description: Full commit from the private engine's matching runtime-<SHA> tag
required: true
permissions:
contents: read
concurrency:
group: sdk-${{ inputs.engine_commit }}
cancel-in-progress: false
jobs:
build:
if: github.ref == 'refs/heads/main'
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-22.04
target: linux-x64
- os: windows-2022
target: windows-x64
- os: macos-15
target: macos-universal
runs-on: ${{ matrix.os }}
env:
ENGINE_COMMIT: ${{ inputs.engine_commit }}
SDK_TARGET: ${{ matrix.target }}
steps:
- uses: actions/checkout@fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09 # v5
with:
path: automation
fetch-depth: 0
persist-credentials: false
- uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6
with:
python-version: '3.12'
- name: Audit automation and validate the requested commit
shell: bash
run: |
python automation/release.py check-repository --root automation
python -c 'import os,re; assert re.fullmatch("[0-9a-f]{40}",os.environ["ENGINE_COMMIT"])'
- name: Temporarily check out the private tagged source
uses: actions/checkout@fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09 # v5
with:
repository: RakuenSoftware/wol-engine
ref: runtime-${{ inputs.engine_commit }}
token: ${{ secrets.ENGINE_SOURCE_TOKEN }}
path: private-engine
submodules: recursive
persist-credentials: false
- name: Verify the private tag's exact commit
working-directory: private-engine
shell: bash
run: test "$(git rev-parse HEAD)" = "$ENGINE_COMMIT"
- uses: actions/setup-dotnet@26b0ec14cb23fa6904739307f278c14f94c95bf1 # v5
with:
dotnet-version: '10.0.403'
- run: python -m pip install scons==4.11.1
- name: Install Linux tools
if: runner.os == 'Linux'
run: sudo apt-get update && sudo apt-get install -y g++ pkg-config patch libx11-dev libxrandr-dev libwayland-dev libxkbcommon0 libxcursor1 libxinerama1 libxi6 libgl1
- name: Set up Windows compiler
if: runner.os == 'Windows'
shell: pwsh
run: |
$vs = & "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe" -latest -products '*' -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath
if (!$vs) { throw 'Visual C++ build tools are missing' }
cmd /c "`"$vs\VC\Auxiliary\Build\vcvars64.bat`" >nul && set" | ForEach-Object {
if ($_ -match '^([^=]+)=(.*)$') { [Environment]::SetEnvironmentVariable($matches[1], $matches[2], 'Process') }
}
foreach ($name in @('INCLUDE', 'LIB', 'LIBPATH', 'VCINSTALLDIR', 'VCToolsInstallDir', 'WindowsSdkDir', 'WindowsSDKVersion', 'UniversalCRTSdkDir', 'UCRTVersion')) {
$value = [Environment]::GetEnvironmentVariable($name, 'Process')
if ($value) { "$name=$value" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append }
}
"$env:PATH;C:\Program Files\Git\usr\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
- name: Compile and qualify the private engine without publishing compiler output
shell: python
run: |
import os, pathlib, subprocess, sys
log = pathlib.Path(os.environ['RUNNER_TEMP']) / 'private-sdk-build.log'
with log.open('w') as stream:
result = subprocess.run([sys.executable, 'scripts/package_runtime.py', os.environ['SDK_TARGET'], '--output', 'dist/sdk', '--release-repository', 'RakuenSoftware/wol-engine-release'], cwd='private-engine', stdout=stream, stderr=subprocess.STDOUT)
if result.returncode:
raise SystemExit('SDK compilation/qualification failed. Compiler output was withheld; inspect privately.')
- name: Audit and copy only approved binary SDK files
shell: bash
run: python automation/release.py stage --input private-engine/dist --output "$RUNNER_TEMP/approved-sdk" --commit "$ENGINE_COMMIT" --target "$SDK_TARGET"
- name: Remove the private checkout and compiler output
if: always()
shell: python
run: |
import os, pathlib, shutil
shutil.rmtree(pathlib.Path(os.environ['GITHUB_WORKSPACE']) / 'private-engine', ignore_errors=True)
(pathlib.Path(os.environ['RUNNER_TEMP']) / 'private-sdk-build.log').unlink(missing_ok=True)
- name: Upload only audited archives and checksums
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
with:
name: sdk-${{ matrix.target }}
path: |
${{ runner.temp }}/approved-sdk/*.zip
${{ runner.temp }}/approved-sdk/*.sha256
if-no-files-found: error
retention-days: 7
publish:
needs: build
runs-on: ubuntu-22.04
permissions:
contents: write
env:
ENGINE_COMMIT: ${{ inputs.engine_commit }}
steps:
- uses: actions/checkout@fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09 # v5
with:
path: automation
fetch-depth: 0
persist-credentials: false
- uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6
with:
python-version: '3.12'
- uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4
with:
path: incoming
merge-multiple: true
- name: Independently audit all three SDKs before publication
shell: bash
run: |
python automation/release.py check-repository --root automation
python automation/release.py stage --input incoming --output "$RUNNER_TEMP/release-sdk" --commit "$ENGINE_COMMIT"
- name: Publish binary assets without engine source access
env:
GH_TOKEN: ${{ github.token }}
GH_REPO: ${{ github.repository }}
shell: bash
run: gh release create "runtime-$ENGINE_COMMIT" "$RUNNER_TEMP/release-sdk/"*.zip "$RUNNER_TEMP/release-sdk/"*.sha256 --target "$GITHUB_SHA" --prerelease --title "WoL Engine SDK $ENGINE_COMMIT" --notes 'Native Linux, Windows and universal macOS binary SDKs. All three were qualified and independently audited before publication. No implementation source, compiler logs or debug symbols are included. Compiled binaries remain inspectable.'
25 changes: 25 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Private inputs and build outputs must never enter Git.
engine/
private-engine/
_private*/
runtime/
native/
addons/
managed/
.dependen*/
dist/
*.zip
*.sha256
*.dll
*.exe
*.so
*.dylib
*.pdb
*.cs
*.gd
*.gdshader
*.gdshaderinc
*.log
*.pem
.env*
__pycache__/
76 changes: 75 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,75 @@
# wol-engine-release
<!-- SPDX-License-Identifier: AGPL-3.0-only -->
# WoL Engine binary releases

This public repository owns build automation and binary SDK publication. The
engine implementation stays in the private `RakuenSoftware/wol-engine`
repository. Project Vagrant vendors the downloaded SDK archives from this
repository's Releases page.

## Publication boundary

- Public Git history contains only the explicitly allowed automation, tests,
documentation and licence files. The audit checks all reachable history, so
deleting a forbidden file in a later commit does not make it acceptable.
- Only a manual run of the workflow on `main` can access the source credential.
Pull request checks never receive it. Maintainers who can change `main` or
workflows are trusted with this credential; review those changes accordingly.
- Each fresh GitHub-hosted Linux, Windows and Mac runner temporarily checks out
an exact private `runtime-<40-character SHA>` tag into a separate sibling
directory. The tag's resolved commit must match the requested SHA.
- Compiler output goes to a temporary private file. Failure reports are generic.
The workflow removes the source checkout and compiler output before uploading
anything. There are no build caches, source artifacts or diagnostic uploads.
- The publication audit verifies archive identity, provenance, every file hash,
platform binary formats and a restricted file inventory. It rejects nonempty
C# files, loose shaders, implementation source, debug/symbol packages,
credentials and logs. Checksum files must contain only their exact checksum
record. Godot dependency packages are also inspected.
- Only approved ZIP archives and SHA-256 records reach the artifact service.
A separate publishing job has no private source credential and independently
audits all three platforms before creating a release. Any failed platform or
audit prevents publication.

SDKs intentionally include empty C# resource identity stubs, engine branding,
Godot scene resources, licence notices and compiled managed/native binaries.
Compiled code can be inspected or decompiled. Shader programs are compiled into
the managed assembly and can also be recovered from it. This boundary prevents
shipping loose implementation source; it does not provide irreversible secrecy
for software that users execute.

## Enable builds

1. Merge the private engine packaging changes that remove loose shader sources
and support `--release-repository RakuenSoftware/wol-engine-release`.
2. Configure the repository Actions secret `ENGINE_SOURCE_TOKEN` with a
fine-grained credential granting **Contents: read** only on the private
`RakuenSoftware/wol-engine` repository. Do not paste credentials into issues,
workflow inputs, commits or logs. Keep automatic pull request reviews enabled.
3. Merge this repository's reviewed automation to `main`. Create a private
engine tag `runtime-<full commit SHA>` for the reviewed source to build.
4. Run **Build and publish binary SDKs** on `main` with that exact commit SHA.
All three native-host SDK jobs must pass. The release contains three ZIP
archives and their checksum records; GitHub's automatic source archives
contain only this public automation repository.
5. Download those release assets and vendor them into Project Vagrant with its
existing `tools/release.py --vendor-runtime` command.

The first build must use the new packager. Existing SDKs containing loose shader
files are deliberately rejected. Old downloads are not retroactively removed
by this pipeline.

## Verification

```sh
python -m unittest -v test_release
python release.py check-repository
python release.py stage --input downloaded-sdk-assets --output approved-sdk --commit FULL_SHA
```

The automated tests use deliberate miniature fixtures; they do not build SDKs
locally. Real native compilation and binary consumer qualification run in CI.
If compilation fails, reproduce in the private repository to inspect diagnostics.
Do not add public compiler logs to troubleshoot a private build.

Automation in this repository is AGPL-3.0-only. SDK components retain their own
licences and required notices; this repository's licence does not relicense them.
15 changes: 15 additions & 0 deletions SECURITY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<!-- SPDX-License-Identifier: AGPL-3.0-only -->
# Reporting a suspected source exposure

Contact a RakuenSoftware repository administrator privately. Do not include
suspected private source or credentials in a public issue, pull request, comment
or attachment. Identify the release/run URL and affected file paths privately.

Administrators should disable the build workflow and revoke its read-only source
credential while investigating. Quarantine affected public artifacts and examine
repository history, run logs and release assets privately. Removing a download
does not revoke copies already obtained. Preserve licence notices on binaries.

Only trusted maintainers may change publication workflows or dispatch builds.
Review changes to the file allowlist, credential permissions, checkout paths,
log handling and artifact paths as changes to the source publication boundary.
Loading