Skip to content

[OpenUPM/Github Packages] Fix npm prepublishOnly script error

Choose a tag to compare

@mfdeveloper mfdeveloper released this 12 Oct 18:40
· 2 commits to upm since this release

Fixed OpenUpm: Build pipeline for version 0.1.1 that shows an error when try run the pipeline job: Publish to OpenUPM

TIP: This release 0.1.3 is just a replacement of 0.1.2 because the OpenUPM pipeline for publishing failed. But In essence, the tags are almost the "same".

The fix consists in rewrite the file .env on [upm] branch to REPOSITORY_ROOT=. only from Github Actions CI, and bypass the prepublishOnly script. This one is required only for manually publishing from a local repo (development environment)

image

Build pipelines summary from: https://openupm.com/packages/com.benoitfreslon.vibration

image

Build pipeline failure.

ADDED

  • Added new function fixEnvFile() to .github/scripts/functions.sh shell script, in order to rewrite the root .env file
  • Added new function checkPkgRoot() to verify and define the $PKG_ROOT environment variable

CHANGED

  • Renamed environment variables names to UPPER CASE on .github/workflows/main.yml
  • Added .env files, in order to define where is the REPOSITORY_ROOT.

    PS: This is important because, in a embedded package branch ([upm-package-embedded]) with a Unity project, usually the root doesn't contains the UPM package files.

  • Updated README.md with npm scripts and node installation documentation