Repository navigation
Publish a nightly only when every platform built - #340
Merged
Merged
Conversation
Why:
The nightly of 00c12b2 has no macOS package: GitHub gave its
darwin-arm64 build no runner ("not acquired by Runner of type hosted
even after multiple attempts"), and the publish job ran anyway, as it
did for any build that failed or was cancelled, leaving the platform
out of the compiler package. Installing that nightly drops macOS from
a project's lockfile, and since npm versions cannot change, no rerun
could add it back.
The publish job now needs every build to succeed, so a missing platform
leaves the commit unpublished, and "Re-run failed jobs" builds it and
publishes it then. `scripts/nightlyPackages.js` also fails when a
platform's binaries are missing; `--allow-missing-platforms` keeps the
old behaviour for a dry run on one machine.
Workflow modified (.github/workflows/nightly.yml, a platform build cancelled):
Before (text):
publish: runs (if: !cancelled()) -> @tellahq/rescript@<version> without darwin-arm64, tagged nightly
After (text):
publish: skipped -> nothing published; re-run failed jobs -> darwin-arm64 builds, then publish
Command modified (node scripts/nightlyPackages.js --scope @tellahq, darwin-arm64 binaries missing):
Before (text):
publishes linux-arm64, linux-x64, win32-x64; "Not built, so not published: darwin-arm64"
After (text):
No binaries in bin/ for darwin-arm64: a nightly needs every platform (--allow-missing-platforms publishes without them). (exit 1)
Co-authored-by: Jaap Frolich <jfrolich@gmail.com>
Session: https://os.submodule.nl/session/os-01a1e3ed-7092-7ff6-a2b2-b5eb642ab42e
Signed-off-by: Jaap Frolich <jfrolich@gmail.com>
Co-authored-by: Jaap Frolich <jfrolich@gmail.com> Session: https://os.submodule.nl/session/os-01a1e3ed-7092-7ff6-a2b2-b5eb642ab42e Signed-off-by: Jaap Frolich <jfrolich@gmail.com>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The nightly of 00c12b2 shipped without a macOS package. GitHub never gave its darwin-arm64 build a runner ("The job was not acquired by Runner of type hosted even after multiple attempts"). The publish job ran anyway: it is
if: ${{ !cancelled() }}, so it also runs when a build fails or is cancelled. That left@rescript/darwin-arm64out of the compiler package's optional dependencies. A project that installs that nightly loses macOS from its lockfile. npm versions are immutable, so no rerun can add it back.Change
nightly.yml:publishnow needs every build to succeed. If a platform is missing, the commit is left unpublished, and "Re-run failed jobs" builds that platform and then publishes, since npm has nothing of that version yet.scripts/nightlyPackages.js: fails when a platform's binaries are missing.--allow-missing-platformskeeps the old behaviour, for a dry run on one machine.A rerun after a newer commit has been published still refuses to move the dist-tag back, as before.
Testing
On a throwaway checkout with binaries only for linux-x64, linux-arm64 and win32-x64,
node scripts/nightlyPackages.js --scope @tellahq --dry-runexits 1 withNo binaries in bin/ for darwin-arm64: a nightly needs every platform (--allow-missing-platforms publishes without them).With--allow-missing-platformsit gets past that check as before. This PR touches the pipeline, so its own nightly run builds all four platforms and does annpm publish --dry-run.Started by Jaap Frolich in this Assistant session