Add ball prefabs. #9
This file contains hidden or 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
| name: Publish | |
| on: | |
| push: | |
| branches: | |
| - master | |
| jobs: | |
| publish: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v5 | |
| with: | |
| fetch-depth: 0 | |
| lfs: true | |
| - name: Fetch next version | |
| id: nextVersion | |
| uses: VisualPinball/next-version-action@v0 | |
| with: | |
| tagPrefix: 'v' | |
| - name: Bump | |
| if: ${{ steps.nextVersion.outputs.isBump == 'true' }} | |
| run: | | |
| npm version ${{ steps.nextVersion.outputs.nextVersion }} --no-git-tag-version | |
| - name: Commit | |
| id: commit | |
| if: ${{ steps.nextVersion.outputs.isBump == 'true' }} | |
| run: | | |
| git config user.name "github-actions" | |
| git config user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
| git add package.json | |
| git commit -m "release: ${{ steps.nextVersion.outputs.nextTag }}." | |
| git push | |
| commitish=$(git rev-parse HEAD) | |
| echo "commitish=${commitish}" >> "$GITHUB_OUTPUT" | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Create Release | |
| run: | | |
| commitish="${{ steps.commit.outputs.commitish }}" | |
| if [ -z "$commitish" ]; then | |
| commitish="${GITHUB_SHA}" | |
| fi | |
| prerelease_args=() | |
| if [ "${{ steps.nextVersion.outputs.isPrerelease }}" = "true" ]; then | |
| prerelease_args+=(--prerelease) | |
| fi | |
| gh release create "${{ steps.nextVersion.outputs.nextTag }}" \ | |
| --title "${{ steps.nextVersion.outputs.nextTag }}" \ | |
| --target "$commitish" \ | |
| "${prerelease_args[@]}" | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - 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: Verify npm auth (optional but helpful) | |
| run: | | |
| echo "//registry.visualpinball.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc | |
| npm whoami --registry=https://registry.visualpinball.org | |
| env: | |
| NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | |
| - 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 }} |