mikeal / merge-release

Automatically release all merges to master on npm.
Other
471 stars 64 forks source link

Added functionality for mono-repos (different src and dist folders) #19

Closed benwinding closed 4 years ago

benwinding commented 4 years ago

Scope Added functionality for deploying a package within a subdirectory in a monorepo. Similar to PR #7, but here's my changes anyway...

Features In mono repos the src directory and compiled dist directory are usually in different folders. So I added the 2 environment variables:

In angular development it's convention to use a projects folder for the src code and a dist folder for the builds.

Here's a working snippet using a forked version of this repo:

- name: Publish
      if: github.ref == 'refs/heads/master'
      uses: benwinding/merge-release@master
      env:
        DEPLOY_DIR: dist/ngx-firestate
        SRC_PACKAGE_DIR: projects/ngx-firestate
        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        NPM_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}

Cheers for making this anyway, hope this PR helps someone else :+1:

mattdsteele commented 4 years ago

@benwinding thank you for putting this together! Conceptually it looks like exactly what I'm looking for; I'm using pika/pack for my tooling, which builds the package in a pkg/ subfolder.

I'm trying to use your branched version in my project, but it doesn't appear to be working:

https://github.com/mattdsteele/bt-device/blob/60b453d03176c03f03c5134ba739b224b15abef9/.github/workflows/publish.yml#L24-L28

Using this approach, my NPM packages still are published at the root:, instead of the subfolder I want https://unpkg.com/browse/bt-device@1.0.2/

Looking at the Action's entrypoint, I think this is because it's using the NPM version of merge-release when actually being used by a component:

https://github.com/mikeal/merge-release/blob/master/entrypoint.sh#L31

Which makes me thing this PR needs merged and published for folks to actually use 🙃

@mikeal can you confirm? Is there anything I can do to help get this merged?

mikeal commented 4 years ago

pinging @fredkschott who might find this interesting.

mikeal commented 4 years ago

Apologies, I didn’t see the last commit come in after my last review comment. This shouldn’t have sat here for so long, my bad.