opendesigndev / open-design-engine

The Open Design Engine (ODE) renders designs and provides interface to edit them and query specific information about them and their components
Apache License 2.0
4 stars 5 forks source link

Publish native packages to npm #48

Closed CodeWitchBella closed 1 year ago

CodeWitchBella commented 1 year ago

Extends existing publish workflow to native builds + the wrapper package. Also fixes some errors I did not notice before.

Notes:

Chlumsky-Ceros commented 1 year ago

For pull requests, the WASM workflow runs twice for no reason. There needs to be a condition for the whole action like if: github.event_name == 'push' || env.ODE_SHOULD_PUBLISH_TO_NPM but I don't think ODE_SHOULD_PUBLISH_TO_NPM will be available when determining whether to run the workflow.

CodeWitchBella commented 1 year ago

For pull requests, the WASM workflow runs twice for no reason. There needs to be a condition for the whole action like if: github.event_name == 'push' || env.ODE_SHOULD_PUBLISH_TO_NPM but I don't think ODE_SHOULD_PUBLISH_TO_NPM will be available when determining whether to run the workflow.

Good catch. Also turns out that something is different for pull_request and push and it was producing incompatible versions. It was also always publishing as it was passing false as a string and evaluating it as "not empty string, therefore true". I fixed it by getting rid of pull_request trigger altogether and instead using gh to list labels on a PR.

Chlumsky-Ceros commented 1 year ago

Now I think nothing will happen if you actually add the label so maybe there could be a small subset of the PR triggers like opened and labeled but I don't use NPM publish related stuff so I don't really mind.

CodeWitchBella commented 1 year ago

Now I think nothing will happen if you actually add the label so maybe there could be a small subset of the PR triggers like opened and labeled but I don't use NPM publish related stuff so I don't really mind.

Yeah, I considered that, but figured that in this can we can just add the tag and then push, or manually rerun workflows, or (probably easiest) just amend and force push afterwards git commit --amend --no-edit && git push --force