github.com/goreleaser/goreleaser@v1.25.1/www/docs/cookbooks/private-monorepo-public-release.md (about)

     1  # Building in a private monorepo, publishing in to a public repository
     2  
     3  One fairly common usecase is on open-core projects is to have the code in a
     4  private monorepo, but publish its binaries to a public repository.
     5  
     6  This cookbook gives some suggestions on how to handle that.
     7  
     8  !!! success "GoReleaser Pro"
     9      This cookbook uses [GoReleaser Pro](/pro).
    10  
    11  Usually, you'll rely on tag prefixes for each sub-project within your monorepo.
    12  GoReleaser can handle that within its [monorepo
    13  configuration](/customization/monorepo):
    14  
    15  ```yaml
    16  monorepo:
    17    tag_prefix: app1/
    18    dir: ./app1/
    19  ```
    20  
    21  With that you can already push a tag `app1/v1.0.0`, for example, and GoReleaser
    22  should gracefully handling everything.
    23  
    24  But, if you want the release to happen in another repository, you'll also need
    25  to add some [release](/customization/release) settings:
    26  
    27  ```yaml
    28  release:
    29    github:
    30      owner: myorg
    31      name: myrepo
    32  ```
    33  
    34  When you release now, it'll create the `app1/v1.0.0` tag and respective release
    35  in `myorg/myrepo`.
    36  
    37  ## Removing the `myapp/` prefix
    38  
    39  Maybe you'll create one public repository to release each of the projects in
    40  your monorepo. In that case, the tag prefix on the public repository makes no
    41  sense.
    42  
    43  You can remove it by setting the `release.tag` field:
    44  
    45  ```yaml
    46  release:
    47    tag: '{{ .Tag }}'
    48    github:
    49      owner: myorg
    50      name: app1
    51  ```
    52  
    53  !!! info
    54      On GoReleaser Pro, `{{.Tag}}` is the tag without the prefix, and the
    55      prefixed tag can be accessed with `{{.PrefixedTag}}`. Check the
    56      [documentation](/customization/templates) for more information.
    57  
    58  ## Learning more
    59  
    60  Make sure to take a look at the following documentation pages:
    61  
    62  - [Monorepo](/customization/monorepo)
    63  - [Release](/customization/release)
    64  - [Template variables](/customization/templates)
    65