RobLoach / node-raylib

Node.js bindings for Raylib
https://robloach.github.io/node-raylib/
Other
237 stars 20 forks source link

Improve CI/build/pre-built #118

Open konsumer opened 2 years ago

konsumer commented 2 years ago

I think we can improve CI a bit, and make the prebuilt system work better overall

"best" artifact

We should have fall-through logic for choosing the best version for a supported platform/arch.

graph TD
    ENV{Is an env-var set to force build?}
    FS{Is it already built locally in target dir?}
    GIT{Is this a git repo?}
    TAGGED{Is this tagged with something already in releases?}
    PKG{Is this package.json version in releases?}

    BUILD[Build using cmake]
    RELEASE[Download github release artifact]

    ENV --> |yes| BUILD
    ENV --> |no| FS

    FS --> |yes| FS_USE(use that)
    FS --> |no| GIT

    GIT --> |yes| TAGGED
    GIT --> |no| PKG

    TAGGED ==> |yes| RELEASE
    TAGGED ==> |no| PKG

    PKG --> |yes| RELEASE
    PKG --> |no| BUILD

Diagram is a bit crazy, but I think this would cascade correctly. I think we could make tags & branches build in CI, too, so if you don't set the env-var to force build, you can use the pre-built for that branch (like use whatever is the current raylib4-0.8.1 build for your platform, rather than fall right through to building.

konsumer commented 2 years ago

If you want to modify the diagram, here is the source I used:

graph TD
    ENV{Is an env-var set to force build?}
    FS{Is it already built locally in target dir?}
    GIT{Is this a git repo?}
    TAGGED{Is this tagged with something already in releases?}
    PKG{Is this package.json version in releases?}

    BUILD[Build using cmake]
    RELEASE[Download github release artifact]

    ENV --> |yes| BUILD
    ENV --> |no| FS

    FS --> |yes| FS_USE(use that)
    FS --> |no| GIT

    GIT --> |yes| TAGGED
    GIT --> |no| PKG

    TAGGED ==> |yes| RELEASE
    TAGGED ==> |no| PKG

    PKG --> |yes| RELEASE
    PKG --> |no| BUILD

set the language for code-block to mermaid and it will draw it. You can edit it here