-
Notifications
You must be signed in to change notification settings - Fork 2
40 lines (39 loc) · 1.61 KB
/
Copy pathpublish.yml
File metadata and controls
40 lines (39 loc) · 1.61 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
name: Publish
on:
repository_dispatch:
types: [ release-complete ]
jobs:
publish-registry:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- uses: actions/download-artifact@v4
with:
merge-multiple: true
github-token: ${{ secrets.GITHUB_TOKEN }}
run-id: ${{ github.event.client_payload.artifacts_run_id }}
path: VisualPinball.Engine.PinMAME.Unity/Plugins
- name: Install Unity Package Manager CLI
run: |
curl -fsSL https://cdn.packages.unity.com/upm-cli/install.sh | bash
echo "$HOME/.upm/bin" >> "$GITHUB_PATH"
"$HOME/.upm/bin/upm" --version
- name: Pack and sign
run: |
test -n "${UNITY_ORGANIZATION_ID}"
mkdir -p "$RUNNER_TEMP/signed-package"
upm pack ./VisualPinball.Engine.PinMAME.Unity \
--organization-id "${UNITY_ORGANIZATION_ID}" \
--destination "$RUNNER_TEMP/signed-package"
env:
UPM_SERVICE_ACCOUNT_KEY_ID: ${{ secrets.UPM_SERVICE_ACCOUNT_KEY_ID }}
UPM_SERVICE_ACCOUNT_KEY_SECRET: ${{ secrets.UPM_SERVICE_ACCOUNT_KEY_SECRET }}
UNITY_ORGANIZATION_ID: ${{ secrets.UNITY_ORGANIZATION_ID }}
- name: Publish signed package
run: |
echo "//registry.visualpinball.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc
package_tgz="$(find "$RUNNER_TEMP/signed-package" -maxdepth 1 -name '*.tgz' -print -quit)"
test -n "$package_tgz"
npm publish "$package_tgz" --registry=https://registry.visualpinball.org/
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}