release-please-action icon indicating copy to clipboard operation
release-please-action copied to clipboard

rust version not changed for workspace project

Open gengjiawen opened this issue 3 years ago • 9 comments

https://github.com/gengjiawen/monkey-rust/pull/28

@bcoe @fasterthanlime

gengjiawen avatar Jan 08 '21 03:01 gengjiawen

@gengjiawen thank you for the bug report. I'll investigate tomorrow, unless @fasterthanlime is ... faster than me.

bcoe avatar Jan 08 '21 04:01 bcoe

So, for a cargo workspace like this, the supported workflow is to run the release-please action once per crate in your workspace.

Instead of:

      - uses: GoogleCloudPlatform/release-please-action@v2
        id: release
        with:
          token: ${{ secrets.GITHUB_TOKEN }}
          release-type: rust
          package-name: release-please-action

You could use a build matrix, something like:

jobs:
  crates:
    strategy:
      matrix:
        include:
          - crate: monkey-parser
            path: parser
          - crate: monkey-interpreter
            path: interpreter
    runs-on: ubuntu-latest
    steps:
      - uses: GoogleCloudPlatform/release-please-action@v2
        id: release
        with:
          token: ${{ secrets.GITHUB_TOKEN }}
          monorepo-tags: true
          release-type: rust
          path: ${{ matrix.path }}
          package-name: ${{ matrix.crate }}

(I've only listed two crates, but it seems you have 4, make sure to include all 4 - first the one with the least local dependencies, like lexer, keep interpreter for last!)

fasterthanlime avatar Jan 08 '21 08:01 fasterthanlime

This matrix seems very redundant. I previously use https://github.com/pksunkara/cargo-workspaces to update my version (Maybe we can adopt similar strategy). But it doesn't fit into release-it.

gengjiawen avatar Jan 08 '21 08:01 gengjiawen

Right, cargo-workspaces uses the "all crates of a workspace are the same version, they're always bumped together", which certainly simplifies some things.

Currently release-please only supports "crates of a workspace are released independently, with their own versioning scheme", that's why you need to run it for each crate. In my use case, each crate is published to a registry independently after a release-please PR has been merged. (I run cargo publish in CI too).

As @bcoe said in #177, the Rust support is a starting point, it'll work for "the repository has a single crate" and "every crate of the workspace is bumped and released independently", not "every crate is bumped and released together" right now.

fasterthanlime avatar Jan 08 '21 09:01 fasterthanlime

@fasterthanlime @gengjiawen I've been thinking about this problem with regards to Node.js mono-repos too. I have a repository here where I'd like to release ~170 submodules.

I don't love the idea of having both a individual and monorepo strategy for each language though, perhaps we can figure out a way to abstract this problem a bit.

bcoe avatar Jan 08 '21 17:01 bcoe

@fasterthanlime Is this any progress for workspace support ? Thanks.

gengjiawen avatar Jan 25 '21 11:01 gengjiawen

@fasterthanlime Is this any progress for workspace support ? Thanks.

I don't have any personal plans to implement support for your use case in the near future at the moment!

(I'm not one of the primary maintainers of this repository, I provided initial support + offered to provide some insight if requested).

fasterthanlime avatar Jan 25 '21 15:01 fasterthanlime

@fasterthanlime If I understand this problem properly (which is the ability to release multiple modules from one repo), we've been working on a design for this.

CC: @joeldodge79

bcoe avatar Jan 27 '21 01:01 bcoe

marking as feature request, as this sounds like a request for enhancements to our Rust workspace support.

bcoe avatar Jun 07 '22 17:06 bcoe