Skip to content

update-libpinmame

update-libpinmame #766

Workflow file for this run

# This workflow runs when recieving a "update-libpinmame"
# repository_dispatch event from vpinball/pinmame.
name: Native
on:
repository_dispatch:
types: [ update-libpinmame ]
jobs:
version:
runs-on: ubuntu-latest
outputs:
semver: ${{ steps.version.outputs.semver }}
exists: ${{ steps.version.outputs.exists }}
steps:
- id: version
run: |
VERSION=$(npx semver -c ${{ github.event.client_payload.version }})
SEMVER="${VERSION}-preview.${{ github.event.client_payload.revision }}"
EXISTS=$(if [[ $(curl https://api.nuget.org/v3-flatcontainer/pinmame.native/index.json | grep \"${SEMVER}\") ]]; then echo "true"; else echo "false"; fi)
echo "::set-output name=semver::${SEMVER}"
echo "::set-output name=exists::${EXISTS}"
build-nuget:
runs-on: ubuntu-latest
needs: [ version ]
steps:
- uses: nuget/setup-nuget@v1
- uses: actions/checkout@v2
- uses: dawidd6/action-download-artifact@v2
with:
workflow: libpinmame
run_id: ${{ github.event.client_payload.run_id }}
repo: vpinball/pinmame
path: native/nuget
- name: Pack
run: |
cd native/nuget
mv libpinmame-*-win-x64 libpinmame-win-x64
mv libpinmame-*-win-x86 libpinmame-win-x86
mv libpinmame-*-osx-x64 libpinmame-osx-x64
mv libpinmame-*-osx-arm64 libpinmame-osx-arm64
mv libpinmame-*-osx libpinmame-osx
mv libpinmame-*-ios-arm64 libpinmame-ios-arm64
mv libpinmame-*-linux-x64 libpinmame-linux-x64
mv libpinmame-*-android-arm64-v8a libpinmame-android-arm64-v8a
sed -i 's/__VERSION__/${{ needs.version.outputs.semver }}/g' *.nuspec
nuget pack PinMame.Native.win-x64.nuspec -OutputDirectory nupkg
nuget pack PinMame.Native.win-x86.nuspec -OutputDirectory nupkg
nuget pack PinMame.Native.osx-x64.nuspec -OutputDirectory nupkg
nuget pack PinMame.Native.osx-arm64.nuspec -OutputDirectory nupkg
nuget pack PinMame.Native.osx.nuspec -OutputDirectory nupkg
nuget pack PinMame.Native.ios-arm64.nuspec -OutputDirectory nupkg
nuget pack PinMame.Native.linux-x64.nuspec -OutputDirectory nupkg
nuget pack PinMame.Native.android-arm64-v8a.nuspec -OutputDirectory nupkg
nuget pack PinMame.Native.nuspec -OutputDirectory nupkg
- uses: actions/upload-artifact@v2
with:
name: nupkg
path: native/nuget/nupkg
publish:
runs-on: ubuntu-latest
needs: [ version, build-nuget ]
steps:
- uses: nuget/setup-nuget@v1
- uses: actions/download-artifact@v2
with:
name: nupkg
- name: Publish
run: |
nuget push PinMame.Native.${{ needs.version.outputs.semver }}.nupkg -ApiKey ${{ secrets.NUGET_KEY }} -src https://api.nuget.org/v3/index.json
nuget push PinMame.Native.win-x64.${{ needs.version.outputs.semver }}.nupkg -ApiKey ${{ secrets.NUGET_KEY }} -src https://api.nuget.org/v3/index.json
nuget push PinMame.Native.win-x86.${{ needs.version.outputs.semver }}.nupkg -ApiKey ${{ secrets.NUGET_KEY }} -src https://api.nuget.org/v3/index.json
nuget push PinMame.Native.osx-x64.${{ needs.version.outputs.semver }}.nupkg -ApiKey ${{ secrets.NUGET_KEY }} -src https://api.nuget.org/v3/index.json
nuget push PinMame.Native.osx-arm64.${{ needs.version.outputs.semver }}.nupkg -ApiKey ${{ secrets.NUGET_KEY }} -src https://api.nuget.org/v3/index.json
nuget push PinMame.Native.osx.${{ needs.version.outputs.semver }}.nupkg -ApiKey ${{ secrets.NUGET_KEY }} -src https://api.nuget.org/v3/index.json
nuget push PinMame.Native.ios-arm64.${{ needs.version.outputs.semver }}.nupkg -ApiKey ${{ secrets.NUGET_KEY }} -src https://api.nuget.org/v3/index.json
nuget push PinMame.Native.linux-x64.${{ needs.version.outputs.semver }}.nupkg -ApiKey ${{ secrets.NUGET_KEY }} -src https://api.nuget.org/v3/index.json
nuget push PinMame.Native.android-arm64-v8a.${{ needs.version.outputs.semver }}.nupkg -ApiKey ${{ secrets.NUGET_KEY }} -src https://api.nuget.org/v3/index.json