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
140 changes: 82 additions & 58 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,58 +1,82 @@
name: Build
on: [ push, pull_request ]

defaults:
run:
shell: bash

jobs:
build:
name: Build ${{ matrix.rid }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: windows-latest
rid: win-x64
- os: windows-latest
rid: win-x86
- os: macos-latest
rid: osx
- os: macos-latest
rid: ios-arm64
- os: ubuntu-22.04
rid: linux-x64
- os: ubuntu-22.04
rid: android-arm64-v8a
steps:
- uses: actions/checkout@v4
- uses: actions/setup-dotnet@v4
with:
dotnet-version: '3.1.x'
- name: Build
run: |
cd VisualPinball.Engine.PinMAME
dotnet build -c Release -r ${{ matrix.rid }}
# - name: Test
# run: |
# cd VisualPinball.Engine.PinMAME.Test
# dotnet run -c Release -r ${{ matrix.rid }}
- run: |
mkdir tmp
cp -r VisualPinball.Engine.PinMAME.Unity/Plugins/${{ matrix.rid }} tmp
- uses: actions/upload-artifact@v4
with:
name: Plugins-${{ matrix.rid }}
path: tmp

dispatch:
runs-on: ubuntu-latest
needs: [ build ]
if: github.repository == 'VisualPinball/VisualPinball.Engine.PinMAME' && github.ref == 'refs/heads/master' && github.event_name == 'push'
steps:
- uses: peter-evans/repository-dispatch@v3
with:
token: ${{ secrets.GH_PAT }}
event-type: build-complete
client-payload: '{"artifacts_run_id": "${{ github.run_id }}"}'
name: Build
on: [ push, pull_request ]

defaults:
run:
shell: bash

jobs:
build:
name: Build ${{ matrix.rid }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: windows-latest
rid: win-x64
- os: windows-latest
rid: win-x86
- os: macos-latest
rid: osx
- os: macos-latest
rid: ios-arm64
- os: ubuntu-22.04
rid: linux-x64
- os: ubuntu-22.04
rid: android-arm64-v8a
steps:
- uses: actions/checkout@v4
- uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.x'
- name: Build
run: |
cd VisualPinball.Engine.PinMAME
dotnet build -c Release -r ${{ matrix.rid }}
- run: |
mkdir tmp
cp -r VisualPinball.Engine.PinMAME.Unity/Plugins/${{ matrix.rid }} tmp
- uses: actions/upload-artifact@v4
with:
name: Plugins-${{ matrix.rid }}
path: tmp

test:
name: Test definition conversion
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Check out the pinned machine-definition corpus
uses: actions/checkout@v4
with:
repository: vpinball/pinmame-game-defs
ref: 4b3c12f776c4355f5dd27b942edf45d933b479b6
path: pinmame-game-defs
- uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.x'
- uses: actions/setup-node@v4
with:
node-version: '22'
cache: npm
cache-dependency-path: pinmame-game-defs/site/package-lock.json
- name: Generate the published machine-definition data
working-directory: pinmame-game-defs/site
run: |
npm ci
npm run data
- run: dotnet test VisualPinball.Engine.PinMAME.Test/VisualPinball.Engine.PinMAME.Test.csproj --configuration Release
env:
PINMAME_GAME_DEFS_ROOT: ${{ github.workspace }}/pinmame-game-defs

dispatch:
runs-on: ubuntu-latest
needs: [ build, test ]
if: github.repository == 'VisualPinball/VisualPinball.Engine.PinMAME' && github.ref == 'refs/heads/master' && github.event_name == 'push'
steps:
- uses: peter-evans/repository-dispatch@v3
with:
token: ${{ secrets.GH_PAT }}
event-type: build-complete
client-payload: '{"artifacts_run_id": "${{ github.run_id }}"}'
18 changes: 10 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,15 @@

## Structure

This project contains two root folders:
This project contains three root folders:

- `VisualPinball.Engine.PinMAME` wraps the [`pinmame-dotnet`](https://github.com/vpinball/pinmame-dotnet)
library and extends it with some meta data. It's also the project that provides
the Unity plugins.
- `VisualPinball.Engine.PinMAME.Unity` is the Unity UPM package that plugs into
VPE and implements the gamelogic engine.
- `VisualPinball.Engine.PinMAME` wraps the [`pinmame-dotnet`](https://github.com/vpinball/pinmame-dotnet) library and produces the managed Unity plugin.
- `VisualPinball.Engine.PinMAME.Unity` is the Unity UPM package that plugs into VPE and implements the gamelogic engine.
- `VisualPinball.Engine.PinMAME.Test` verifies the editor-side conversion from the public machine-definition schema to VPE hardware mappings.

Machine definitions are not compiled into this package. In the Unity Editor, the PinMAME inspector loads the catalog from `https://games.visualpinball.org`, caches it under the project's `Library/PinMAME/GameDefinitions` directory, and populates the table's serialized hardware mappings. Runtime builds contain those mappings and the selected machine/ROM identifiers, but none of the fetched catalog metadata or networking code. CI converts a pinned revision of the complete curated corpus so incompatible definition changes fail before release.

The published site endpoint is preferred to raw GitHub files because it exposes a stable joined index with all ROM aliases, supports CORS and conditional HTTP caching, and requires only one index request plus one detail request for the selected machine. The GitHub repository remains the canonical source from which the site is built.

### Unity Package

Expand Down Expand Up @@ -57,6 +59,6 @@ git update-index --assume-unchanged VisualPinball.Engine.PinMAME.Unity/Plugins/w

## License

This plugin is licensed under the [MIT license](LICENSE). However
This plugin is licensed under the [MIT license](LICENSE). However
since we link against PinMAME, the [MAME/BSD-3-Clause](https://github.com/vpinball/pinmame/blob/master/LICENSE)
must be honored as well.
must be honored as well.
Loading
Loading