Skip to content

release-complete

release-complete #139

Workflow file for this run

name: Publish
on:
repository_dispatch:
types: [ release-complete ]
jobs:
publish-registry:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: dawidd6/action-download-artifact@v2
with:
workflow: build
run_id: ${{ github.event.client_payload.artifacts_run_id }}
name: Plugins
path: VisualPinball.Unity/Plugins
- run: |
ls -laR VisualPinball.Unity/Plugins
- name: Add Meta Files
run: |
echo -e "fileFormatVersion: 2\nguid: 766a31c3b9f34ab0885c9eb91f7b1fe4" > package.json.meta
echo -e "fileFormatVersion: 2\nguid: adae7347fead42e782a1276d30931a41" > LICENSE.meta
echo -e "fileFormatVersion: 2\nguid: 72a46a663e3b40d0b6e8ff25d554a779" > README.md.meta
echo -e "fileFormatVersion: 2\nguid: a2951ed31fba458ca06c535598194a28" > CHANGELOG.md.meta
echo -e "fileFormatVersion: 2\nguid: a2a4b6cb3229489f99c06f0771c522ce" > CONTRIBUTING.md.meta
echo -e "fileFormatVersion: 2\nguid: 931f3c49f79d4032bceefe14682a7d5a" > VisualPinball.Unity.meta
echo -e "fileFormatVersion: 2\nguid: ea4f7f8d4c2c418e9fc0fbed8ab1f5a9" > VisualPinball.Engine.meta
- name: Publish
run: |
echo "//registry.visualpinball.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc
npm publish
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
publish-nuget:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-dotnet@v1
with:
dotnet-version: '3.1.x'
- name: Pack
run: |
VERSION="$(npx -c 'echo "$npm_package_version"')"
dotnet pack VisualPinball.Resources/VisualPinball.Resources.csproj -c Release -p:PackageVersion=$VERSION -o nupkg
dotnet pack VisualPinball.Engine/VisualPinball.Engine.csproj -c Release -p:PackageVersion=$VERSION -o nupkg
- name: Publish
run: |
dotnet nuget push nupkg/VisualPinball.Resources.*.nupkg -k ${{ secrets.NUGET_KEY }} -s https://api.nuget.org/v3/index.json
dotnet nuget push nupkg/VisualPinball.Engine.*.nupkg -k ${{ secrets.NUGET_KEY }} -s https://api.nuget.org/v3/index.json
dispatch:
runs-on: ubuntu-latest
needs: [ publish-registry, publish-nuget ]
steps:
- uses: peter-evans/repository-dispatch@v1
with:
token: ${{ secrets.GH_PAT }}
event-type: publish-complete
client-payload: '{"artifacts_run_id": "${{ github.run_id }}"}'