This repository has been archived by the owner on Oct 24, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
1,479 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
name: prerelease | ||
on: | ||
workflow_dispatch: | ||
inputs: | ||
sha: | ||
description: "SHA (leave blank for HEAD)" | ||
required: false | ||
|
||
env: | ||
ACTIONS_API_URL: https://api.github.com/repos/${GITHUB_REPOSITORY}/actions | ||
VERSION_START_SHA: de217010a2ee1328b401ac593313b5e04011ecef | ||
|
||
jobs: | ||
version: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
sha: ${{ steps.sha.outputs.sha }} | ||
tag: ${{ steps.version.outputs.tag }} | ||
steps: | ||
- id: sha | ||
run: | | ||
SHA=$(if [[ "${{ github.event.inputs.sha }}" ]]; then echo "${{ github.event.inputs.sha }}"; else echo "${GITHUB_SHA}"; fi) | ||
SHA7="${SHA::7}" | ||
echo "::set-output name=sha::${SHA}" | ||
echo "::set-output name=sha7::${SHA7}" | ||
- uses: actions/checkout@v2 | ||
with: | ||
ref: ${{ steps.sha.outputs.sha }} | ||
fetch-depth: 0 | ||
- id: version | ||
run: | | ||
VERSION_MAJOR=$(grep -Eo "VP_VERSION_MAJOR\s+[0-9]+" vpversion.h | grep -Eo "[0-9]+") | ||
VERSION_MINOR=$(grep -Eo "VP_VERSION_MINOR\s+[0-9]+" vpversion.h | grep -Eo "[0-9]+") | ||
VERSION_REV=$(grep -Eo "VP_VERSION_REV\s+[0-9]+" vpversion.h | grep -Eo "[0-9]+") | ||
REVISION=$(git rev-list ${{ env.VERSION_START_SHA }}..${{ steps.sha.outputs.sha }} --count) | ||
TAG="${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_REV}-${REVISION}-${{ steps.sha.outputs.sha7 }}" | ||
echo "::set-output name=tag::${TAG}" | ||
prerelease: | ||
runs-on: ubuntu-latest | ||
needs: [ version ] | ||
steps: | ||
- id: download | ||
run: | | ||
curl -s "${{ env.ACTIONS_API_URL }}/runs" --output runs.json | ||
RUN_ID=$(jq -r --arg SHA "${{ needs.version.outputs.sha }}" --arg NAME "vpinball" '.workflow_runs[] | select(.head_sha==$SHA and .name==$NAME) | .id' runs.json) | ||
echo "Downloading vpinball artifact list ${RUN_ID}..." | ||
curl -s "${{ env.ACTIONS_API_URL }}/runs/${RUN_ID}/artifacts" --output artifacts.json | ||
ARTIFACTS=($(jq -r '.artifacts[] | .archive_download_url' artifacts.json)) | ||
for url in ${ARTIFACTS[@]} | ||
do | ||
echo "Downloading artifact: ${url}..." | ||
curl -s -OJ -L -H "authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" ${url} | ||
done | ||
rm *.json | ||
- id: create_release | ||
uses: actions/create-release@v1 | ||
with: | ||
tag_name: "v${{ needs.version.outputs.tag }}" | ||
release_name: "v${{ needs.version.outputs.tag }}" | ||
prerelease: true | ||
commitish: ${{ needs.version.outputs.sha }} | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
- id: upload_release_assets | ||
uses: dwenegar/upload-release-assets@v1 | ||
with: | ||
release_id: ${{ steps.create_release.outputs.id }} | ||
assets_path: . | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,151 @@ | ||
name: vpinball | ||
on: | ||
push: | ||
|
||
env: | ||
VERSION_START_SHA: de217010a2ee1328b401ac593313b5e04011ecef | ||
UPX_ARTIFACT: 122350854 | ||
|
||
defaults: | ||
run: | ||
shell: bash | ||
|
||
jobs: | ||
dxsdk: | ||
name: DirectX SDK | ||
runs-on: windows-latest | ||
steps: | ||
- id: cache | ||
uses: actions/cache@v2 | ||
with: | ||
path: DXSDK | ||
key: cache-dxsdk | ||
- name: Create Cache | ||
if: steps.cache.outputs.cache-hit != 'true' | ||
run: | | ||
curl -sL https://download.microsoft.com/download/a/e/7/ae743f1f-632b-4809-87a9-aa1bb3458e31/DXSDK_Jun10.exe -o DXSDK_Jun10.exe | ||
7z x DXSDK_Jun10.exe DXSDK/Include -otmp | ||
7z x DXSDK_Jun10.exe DXSDK/Lib -otmp | ||
mv tmp/DXSDK DXSDK | ||
rm -fR DXSDK_Jun10.exe tmp | ||
ls -Ra DXSDK | ||
version: | ||
name: Version | ||
runs-on: ubuntu-latest | ||
outputs: | ||
revision: ${{ steps.version.outputs.revision }} | ||
sha7: ${{ steps.version.outputs.sha7 }} | ||
tag: ${{ steps.version.outputs.tag }} | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
- id: version | ||
run: | | ||
VERSION_MAJOR=$(grep -Eo "VP_VERSION_MAJOR\s+[0-9]+" vpversion.h | grep -Eo "[0-9]+") | ||
VERSION_MINOR=$(grep -Eo "VP_VERSION_MINOR\s+[0-9]+" vpversion.h | grep -Eo "[0-9]+") | ||
VERSION_REV=$(grep -Eo "VP_VERSION_REV\s+[0-9]+" vpversion.h | grep -Eo "[0-9]+") | ||
REVISION=$(git rev-list ${{ env.VERSION_START_SHA }}..HEAD --count) | ||
SHA7="${GITHUB_SHA::7}" | ||
TAG="${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_REV}-${REVISION}-${SHA7}" | ||
echo "::set-output name=revision::${REVISION}" | ||
echo "::set-output name=sha7::${SHA7}" | ||
echo "::set-output name=tag::${TAG}" | ||
build: | ||
name: Build VPinballX_GL-${{ matrix.config }}-${{ matrix.platform }} | ||
runs-on: windows-2022 | ||
needs: [ dxsdk, version ] | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
include: | ||
- platform: win-x64 | ||
platform-name: x64 | ||
bass: x64/Bass64.dll | ||
free-image: x64/FreeImage64.dll | ||
sci-lexer-vp: x64/SciLexerVP64.dll | ||
sdl2-ttf: x64/SDL2_ttf.dll | ||
sdl2: x64/SDL2.dll | ||
openvr-api: x64/openvr_api.dll | ||
config: Release | ||
- platform: win-x64 | ||
platform-name: x64 | ||
bass: x64/Bass64.dll | ||
free-image: x64/FreeImage64.dll | ||
sci-lexer-vp: x64/SciLexerVP64.dll | ||
sdl2-ttf: x64/SDL2_ttf.dll | ||
sdl2: x64/SDL2.dll | ||
openvr-api: x64/openvr_api.dll | ||
config: Debug | ||
- platform: win-x86 | ||
platform-name: Win32 | ||
bass: Bass.dll | ||
free-image: FreeImage.dll | ||
sci-lexer-vp: SciLexerVP.dll | ||
sdl2-ttf: SDL2_ttf.dll | ||
sdl2: SDL2.dll | ||
openvr-api: openvr_api.dll | ||
config: Release | ||
- platform: win-x86 | ||
platform-name: Win32 | ||
bass: Bass.dll | ||
free-image: FreeImage.dll | ||
sci-lexer-vp: SciLexerVP.dll | ||
sdl2-ttf: SDL2_ttf.dll | ||
sdl2: SDL2.dll | ||
openvr-api: openvr_api.dll | ||
config: Debug | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/cache@v2 | ||
with: | ||
path: DXSDK | ||
key: cache-dxsdk | ||
- run: | | ||
sed -i "s/0/${{ needs.version.outputs.revision }}/g" git_version.h | ||
sed -i "s/unknown/${{ needs.version.outputs.sha7 }}/g" git_version.h | ||
- name: Build | ||
run: | | ||
export DXSDK_DIR="${GITHUB_WORKSPACE}/DXSDK" | ||
cp cmake/CMakeLists_${{ matrix.platform}}.txt CMakeLists.txt | ||
cmake -G "Visual Studio 17 2022" -A ${{ matrix.platform-name }} -B build | ||
cmake --build build --config ${{ matrix.config }} | ||
- name: Compress | ||
if: matrix.config == 'Release' | ||
run: | | ||
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 | ||
./upx/upx.exe --best --lzma build/${{ matrix.config }}/VPinballX_GL.exe | ||
- run: | | ||
mkdir tmp | ||
cp build/${{ matrix.config }}/VPinballX_GL.* tmp | ||
cp dll/${{ matrix.bass }} tmp | ||
cp dll/${{ matrix.free-image }} tmp | ||
cp dll/${{ matrix.sci-lexer-vp }} tmp | ||
cp dll/${{ matrix.sdl2-ttf }} tmp | ||
cp dll/${{ matrix.sdl2 }} tmp | ||
cp dll/${{ matrix.openvr-api }} tmp | ||
cp txt/Changelog_Scripts.txt tmp | ||
cp txt/Changelog.txt tmp | ||
cp txt/CommandLineParameters.txt tmp | ||
cp txt/CommandReference.txt tmp | ||
cp txt/Hotkeys.txt tmp | ||
cp "txt/JP's Arcade Physics Materials v3.0.mat" tmp | ||
cp "txt/JP's Arcade Physics Materials v3.01 for 10.7.mat" tmp | ||
cp "txt/JP's Arcade Physics v3.0 2nd edition.pdf" tmp | ||
cp "txt/JP's Arcade Physics v3.0.vbs" tmp | ||
cp "txt/JP's Arcade Physics v3.01.vpp" tmp | ||
cp txt/layoutGuideline.txt tmp | ||
cp txt/license.txt tmp | ||
cp "txt/New Plunger Documentation.pdf" tmp | ||
cp txt/PhysicValues.txt tmp | ||
cp txt/RegistryKeys.txt tmp | ||
cp txt/Scripts.txt tmp | ||
cp -r glshader tmp | ||
cp -r scripts tmp | ||
cp -r tables tmp | ||
- uses: actions/upload-artifact@v2 | ||
with: | ||
name: VPinballX_GL-${{ needs.version.outputs.tag }}-${{ matrix.config }}-${{ matrix.platform }} | ||
path: tmp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
Oops, something went wrong.