Skip to content

Render dimmed DMD using shaded palette #1313

Render dimmed DMD using shaded palette

Render dimmed DMD using shaded palette #1313

Workflow file for this run

name: libpinmame
on:
push:
pull_request:
env:
VERSION_START_SHA: e87be0e3cfa66411976ca04a72dd29e36c483966
UPX_ARTIFACT: 345209471
defaults:
run:
shell: bash
jobs:
version:
name: Version
runs-on: ubuntu-latest
outputs:
version: ${{ steps.version.outputs.version }}
revision: ${{ steps.version.outputs.revision }}
sha: ${{ steps.version.outputs.sha }}
sha7: ${{ steps.version.outputs.sha7 }}
tag: ${{ steps.version.outputs.tag }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- id: version
run: |
VERSION_MAJOR=$(grep -Eo "VERSION_MAJOR\s+[0-9]+" src/version.h | grep -Eo "[0-9]+")
VERSION_MINOR=$(grep -Eo "VERSION_MINOR\s+[0-9]+" src/version.h | grep -Eo "[0-9]+")
VERSION_REV=$(grep -Eo "VERSION_REV\s+[0-9]+" src/version.h | grep -Eo "[0-9]+")
VERSION="${VERSION_MAJOR}.${VERSION_MINOR}"
REVISION=$(git rev-list ${{ env.VERSION_START_SHA }}..HEAD --count)
SHA="${GITHUB_SHA}"
SHA7="${SHA::7}"
TAG="${VERSION}.${VERSION_REV}-${REVISION}-${SHA7}"
echo "version=${VERSION}" >> $GITHUB_OUTPUT
echo "revision=${REVISION}" >> $GITHUB_OUTPUT
echo "sha=${SHA}" >> $GITHUB_OUTPUT
echo "sha7=${SHA7}" >> $GITHUB_OUTPUT
echo "tag=${TAG}" >> $GITHUB_OUTPUT
build:
name: Build libpinmame-${{ matrix.platform }}
runs-on: ${{ matrix.os }}
needs: [ version ]
strategy:
fail-fast: false
matrix:
include:
- os: windows-latest
platform: win-x64
platform-name: x64
libpinmame: libpinmame-${{ needs.version.outputs.version }}.dll
pinmame-test: pinmame_test.exe
- os: windows-latest
platform: win-x86
platform-name: Win32
libpinmame: libpinmame-${{ needs.version.outputs.version }}.dll
pinmame-test: pinmame_test.exe
- os: windows-latest
platform: win-arm64
platform-name: ARM64
libpinmame: libpinmame-${{ needs.version.outputs.version }}.dll
pinmame-test: pinmame_test.exe
- os: macos-latest
platform: osx-x64
libpinmame: libpinmame.${{ needs.version.outputs.version }}.dylib
pinmame-test: pinmame_test
- os: macos-latest
platform: osx-arm64
libpinmame: libpinmame.${{ needs.version.outputs.version }}.dylib
pinmame-test: pinmame_test
- os: macos-latest
platform: ios-arm64
libpinmame: libpinmame.${{ needs.version.outputs.version }}.a
- os: macos-latest
platform: tvos-arm64
libpinmame: libpinmame.${{ needs.version.outputs.version }}.a
- os: ubuntu-latest
platform: linux-x64
libpinmame: libpinmame.so.${{ needs.version.outputs.version }}
pinmame-test: pinmame_test
- os: ubuntu-latest
platform: android-arm64-v8a
libpinmame: libpinmame.${{ needs.version.outputs.version }}.so
steps:
- uses: actions/checkout@v4
# - run: |
# if [[ "${{ matrix.os }}" == "windows-latest" ]]; then
# curl -sL -H "Authorization: Token ${{ secrets.GH_PAT }}" https://api.github.com/repos/upx/upx/actions/artifacts/${{ env.UPX_ARTIFACT }}/zip -o upx.zip
# 7z x upx.zip -oupx
# rm upx.zip
# fi
- run: |
perl -i -pe"s/0/${{ needs.version.outputs.revision }}/g" src/git_version.h
perl -i -pe"s/unknown/${{ needs.version.outputs.sha7 }}/g" src/git_version.h
if [[ "${{ matrix.os }}" == "windows-latest" ]]; then
curl -L https://github.com/upx/upx/releases/download/v4.2.2/upx-4.2.2-win64.zip -o upx.zip
7z e upx.zip -oupx
rm upx.zip
fi
- name: Build libpinmame-${{ matrix.platform }}
run: |
cp cmake/libpinmame/CMakeLists_${{ matrix.platform }}.txt CMakeLists.txt
if [[ "${{ matrix.os }}" == "windows-latest" ]]; then
cmake -G "Visual Studio 17 2022" -A ${{ matrix.platform-name }} -B build
cmake --build build --config Release
if [[ "${{ matrix.platform }}" != "win-arm64" ]]; then
./upx/upx.exe --best --lzma build/Release/${{ matrix.libpinmame }}
fi
else
cmake -DCMAKE_BUILD_TYPE=Release -B build/Release
cmake --build build/Release
if [[ "${{ matrix.platform }}" == "linux-x64" ]]; then
upx --best --lzma build/Release/${{ matrix.libpinmame }}
fi
fi
- run: |
mkdir tmp
cp build/Release/${{ matrix.libpinmame }} tmp
if [[ "${{ matrix.platform }}" == "ios-arm64" ]]; then
cp build/Release/zlib-prefix/src/zlib-build/libz.a tmp
fi
if [[ "${{ matrix.platform }}" == "tvos-arm64" ]]; then
cp build/Release/zlib-prefix/src/zlib-build/libz.a tmp
fi
if [[ "${{ matrix.pinmame-test }}" ]]; then
cp build/Release/${{ matrix.pinmame-test }} tmp
fi
cp release/gamelist.txt tmp
cp release/license.txt tmp
cp release/pinmame.txt tmp
cp release/whatsnew.txt tmp
- uses: actions/upload-artifact@v4
with:
name: libpinmame-${{ needs.version.outputs.tag }}-${{ matrix.platform }}
path: tmp
post-build:
runs-on: macos-latest
needs: [ version, build ]
name: Build libpinmame-osx
steps:
- uses: actions/download-artifact@v4
- run: |
mkdir tmp
cp libpinmame-${{ needs.version.outputs.tag }}-osx-x64/license.txt tmp
lipo -create -output tmp/libpinmame.${{ needs.version.outputs.version }}.dylib \
libpinmame-${{ needs.version.outputs.tag }}-osx-x64/libpinmame.${{ needs.version.outputs.version }}.dylib \
libpinmame-${{ needs.version.outputs.tag }}-osx-arm64/libpinmame.${{ needs.version.outputs.version }}.dylib
lipo -create -output tmp/pinmame_test \
libpinmame-${{ needs.version.outputs.tag }}-osx-x64/pinmame_test \
libpinmame-${{ needs.version.outputs.tag }}-osx-arm64/pinmame_test
- uses: actions/upload-artifact@v4
with:
name: libpinmame-${{ needs.version.outputs.tag }}-osx
path: tmp
dispatch:
runs-on: ubuntu-latest
needs: [ version, post-build ]
if: github.repository == 'vpinball/pinmame' && github.ref == 'refs/heads/master' && github.event_name == 'push'
steps:
- uses: peter-evans/repository-dispatch@v1
with:
token: ${{ secrets.GH_PAT }}
repository: vpinball/pinmame-dotnet
event-type: update-libpinmame
client-payload: '{ "run_id": "${{ github.run_id }}",
"version": "${{ needs.version.outputs.version }}",
"revision": "${{ needs.version.outputs.revision }}",
"sha": "${{ needs.version.outputs.sha }}",
"tag": "${{ needs.version.outputs.tag }}" }'