-
Notifications
You must be signed in to change notification settings - Fork 1
44 lines (42 loc) · 1.58 KB
/
Copy pathpublish.yml
File metadata and controls
44 lines (42 loc) · 1.58 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
41
42
43
44
name: Publish
on:
repository_dispatch:
types: [ release-complete ]
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v5
- 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 . \
--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 }}
dispatch:
runs-on: ubuntu-latest
needs: [ publish ]
steps:
- uses: peter-evans/repository-dispatch@v4
with:
token: ${{ secrets.GH_PAT }}
event-type: publish-complete
client-payload: '{"artifacts_run_id": "${{ github.run_id }}"}'