sem-rel
Configurable Semantic Release module. Options are provided to modify yourreleaserc file on demand for testing purposes (e.g. local/dry/no-ci runs,
unlisted branches etc).
Usable with Github or Gitlab with a PAT token.
Installation
dagger install github.com/Mjb141/sem-rel@v2.2.0Entrypoint
Return Type
SemRel Example
dagger -m github.com/Mjb141/sem-rel@0b0cee328fe86de5c002d04a9036c8c49ce53071 call \
func (m *MyModule) Example() *dagger.SemRel {
return dag.
SemRel()
}@function
def example() -> dagger.SemRel:
return (
dag.sem_rel()
)@func()
example(): SemRel {
return dag
.semRel()
}Types
SemRel 🔗
addBranchToReleaseRc() 🔗
Return Type
[SemRelBranch ! ] !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| dir | Directory ! | - | No description provided |
| branches | [SemRelBranch ! ] ! | - | No description provided |
Example
echo 'Custom types are not supported in shell examples'func (m *MyModule) Example(dir *dagger.Directory, branches []*dagger.SemRelBranch) []*dagger.SemRelBranch {
return dag.
SemRel().
AddBranchToReleaseRc(dir, branches)
}@function
def example(dir: dagger.Directory, branches: List[dagger.SemRelBranch]) -> List[dagger.SemRelBranch]:
return (
dag.sem_rel()
.add_branch_to_release_rc(dir, branches)
)@func()
example(dir: Directory, branches: SemRelBranch[]): SemRelBranch[] {
return dag
.semRel()
.addBranchToReleaseRc(dir, branches)
}semanticReleaseCommand() 🔗
Return Type
[String ! ] !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| dryRun | Boolean ! | - | No description provided |
| allowLocal | Boolean ! | - | No description provided |
Example
dagger -m github.com/Mjb141/sem-rel@0b0cee328fe86de5c002d04a9036c8c49ce53071 call \
semantic-release-command --dry-run boolean --allow-local booleanfunc (m *MyModule) Example(ctx context.Context, dryRun bool, allowLocal bool) []string {
return dag.
SemRel().
SemanticReleaseCommand(ctx, dryRun, allowLocal)
}@function
async def example(dry_run: bool, allow_local: bool) -> List[str]:
return await (
dag.sem_rel()
.semantic_release_command(dry_run, allow_local)
)@func()
async example(dryRun: boolean, allowLocal: boolean): Promise<string[]> {
return dag
.semRel()
.semanticReleaseCommand(dryRun, allowLocal)
}configure() 🔗
Configure Semantic Release
Return Type
SemRel !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| addCurrentBranch | Boolean ! | false | Add the current branch to the 'branches' key in your .releaserc file |
| removeGitProvider | Boolean ! | false | Remove the Github/Gitlab from plugins (if you do not have a token) |
| dryRun | Boolean ! | true | The Semantic Release --dry-run flag for testing |
| allowLocal | Boolean ! | false | The Semantic Release --check-if-ci flag for local execution |
Example
dagger -m github.com/Mjb141/sem-rel@0b0cee328fe86de5c002d04a9036c8c49ce53071 call \
configure --add-current-branch boolean --remove-git-provider boolean --dry-run boolean --allow-local booleanfunc (m *MyModule) Example(addCurrentBranch bool, removeGitProvider bool, dryRun bool, allowLocal bool) *dagger.SemRel {
return dag.
SemRel().
Configure(addCurrentBranch, removeGitProvider, dryRun, allowLocal)
}@function
def example(add_current_branch: bool, remove_git_provider: bool, dry_run: bool, allow_local: bool) -> dagger.SemRel:
return (
dag.sem_rel()
.configure(add_current_branch, remove_git_provider, dry_run, allow_local)
)@func()
example(addCurrentBranch: boolean, removeGitProvider: boolean, dryRun: boolean, allowLocal: boolean): SemRel {
return dag
.semRel()
.configure(addCurrentBranch, removeGitProvider, dryRun, allowLocal)
}release() 🔗
Run Semantic Release
Return Type
Container !Arguments
| Name | Type | Default Value | Description |
|---|---|---|---|
| releaserc | File | - | .releaserc (or equivalent), defaults to .releaserc.json |
| dir | Directory | - | Directory containing app that should be assessed for release |
| provider | String ! | "Github" | Git provider, Github or Gitlab. Determines if GH_TOKEN or GL_TOKEN is provided to Semantic Release |
| token | Secret ! | - | PAT for either Github or Gitlab. Will be provided to Semantic Release as GH_TOKEN or GL_TOKEN |
Example
dagger -m github.com/Mjb141/sem-rel@0b0cee328fe86de5c002d04a9036c8c49ce53071 call \
release --provider string --token env:MYSECRETfunc (m *MyModule) Example(provider string, token *dagger.Secret) *dagger.Container {
return dag.
SemRel().
Release(provider, token)
}@function
def example(provider: str, token: dagger.Secret) -> dagger.Container:
return (
dag.sem_rel()
.release(provider, token)
)@func()
example(provider: string, token: Secret): Container {
return dag
.semRel()
.release(provider, token)
}SemRelBranch 🔗
Branch represents a branch configuration
name() 🔗
Return Type
String ! Example
Function SemRelBranch.name is not accessible from the sem-rel moduleFunction SemRelBranch.name is not accessible from the sem-rel moduleFunction SemRelBranch.name is not accessible from the sem-rel moduleFunction SemRelBranch.name is not accessible from the sem-rel moduleprerelease() 🔗
Return Type
Boolean ! Example
Function SemRelBranch.prerelease is not accessible from the sem-rel moduleFunction SemRelBranch.prerelease is not accessible from the sem-rel moduleFunction SemRelBranch.prerelease is not accessible from the sem-rel moduleFunction SemRelBranch.prerelease is not accessible from the sem-rel modulechannel() 🔗
Return Type
String ! Example
Function SemRelBranch.channel is not accessible from the sem-rel moduleFunction SemRelBranch.channel is not accessible from the sem-rel moduleFunction SemRelBranch.channel is not accessible from the sem-rel moduleFunction SemRelBranch.channel is not accessible from the sem-rel module