seqeralabs / tower-cli

Nextflow Tower CLI tool
Apache License 2.0
43 stars 9 forks source link

fix release #431

Closed munishchouhan closed 4 months ago

munishchouhan commented 4 months ago

this pr will try to fix the release process of tower cli

munishchouhan commented 4 months ago

removed github.event.ref=='refs/heads/master for testing

munishchouhan commented 4 months ago

error stack trace:

[DEBUG] creating release on seqeralabs/tower-cli with tag v0.9.3-A0
jreleaser.shadow.org.jreleaser.sdk.commons.RestAPIException: 403: Forbidden
{"message":"Resource not accessible by personal access token","documentation_url":"https://docs.github.com/rest/releases/releases#create-a-release","status":"403"}
    at jreleaser.shadow.org.jreleaser.sdk.commons.ClientUtils.lambda$builder$1(ClientUtils.java:118)
    at jreleaser.shadow.feign.InvocationContext.decodeError(InvocationContext.java:126)
    at jreleaser.shadow.feign.InvocationContext.proceed(InvocationContext.java:72)
    at jreleaser.shadow.feign.ResponseHandler.handleResponse(ResponseHandler.java:63)
    at jreleaser.shadow.feign.SynchronousMethodHandler.executeAndDecode(SynchronousMethodHandler.java:114)
    at jreleaser.shadow.feign.SynchronousMethodHandler.invoke(SynchronousMethodHandler.java:70)
    at jreleaser.shadow.feign.ReflectiveFeign$FeignInvocationHandler.invoke(ReflectiveFeign.java:99)
    at jdk.proxy2/jdk.proxy2.$Proxy20.createRelease(Unknown Source)
    at jreleaser.shadow.org.jreleaser.sdk.github.Github.createRelease(Github.java:334)
    at jreleaser.shadow.org.jreleaser.sdk.github.GithubReleaser.createRelease(GithubReleaser.java:361)
    at jreleaser.shadow.org.jreleaser.sdk.github.GithubReleaser.createRelease(GithubReleaser.java:232)
    at jreleaser.shadow.org.jreleaser.sdk.git.release.AbstractReleaser.release(AbstractReleaser.java:59)
    at jreleaser.shadow.org.jreleaser.engine.release.Releasers.release(Releasers.java:56)
    at jreleaser.shadow.org.jreleaser.workflow.ReleaseWorkflowItem.doInvoke(ReleaseWorkflowItem.java:39)
    at jreleaser.shadow.org.jreleaser.workflow.AbstractWorkflowItem.lambda$invoke$0(AbstractWorkflowItem.java:43)
    at jreleaser.shadow.org.jreleaser.engine.hooks.HookExecutor.execute(HookExecutor.java:70)
    at jreleaser.shadow.org.jreleaser.workflow.AbstractWorkflowItem.invoke(AbstractWorkflowItem.java:43)
    at jreleaser.shadow.org.jreleaser.workflow.WorkflowImpl.doExecute(WorkflowImpl.java:129)
    at jreleaser.shadow.org.jreleaser.workflow.WorkflowImpl.execute(WorkflowImpl.java:54)
    at jreleaser.shadow.org.jreleaser.cli.FullRelease.doExecute(FullRelease.java:219)
    at jreleaser.shadow.org.jreleaser.cli.AbstractModelCommand.execute(AbstractModelCommand.java:89)
    at jreleaser.shadow.org.jreleaser.cli.AbstractCommand.call(AbstractCommand.java:52)
    at jreleaser.shadow.org.jreleaser.cli.AbstractModelCommand.call(AbstractModelCommand.java:53)
    at jreleaser.shadow.org.jreleaser.cli.AbstractCommand.call(AbstractCommand.java:37)
    at jreleaser.shadow.picocli.CommandLine.executeUserObject(CommandLine.java:2045)
    at jreleaser.shadow.picocli.CommandLine.access$1500(CommandLine.java:148)
    at jreleaser.shadow.picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2465)
    at jreleaser.shadow.picocli.CommandLine$RunLast.handle(CommandLine.java:2457)
    at jreleaser.shadow.picocli.CommandLine$RunLast.handle(CommandLine.java:2419)
    at jreleaser.shadow.picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2277)
    at jreleaser.shadow.picocli.CommandLine$RunLast.execute(CommandLine.java:2421)
    at jreleaser.shadow.picocli.CommandLine.execute(CommandLine.java:2174)
    at jreleaser.shadow.org.jreleaser.cli.Main.execute(Main.java:98)
    at jreleaser.shadow.org.jreleaser.cli.Main.run(Main.java:94)
    at org.jreleaser.tool.JReleaser.main(JReleaser.java:47)
[INFO]  Writing output properties to out/jreleaser/output.properties
[ERROR] JReleaser failed after 3.203 s
org.jreleaser.model.JReleaserException: Unexpected error when creating release
    at jreleaser.shadow.org.jreleaser.workflow.ReleaseWorkflowItem.doInvoke(ReleaseWorkflowItem.java:41)
    at jreleaser.shadow.org.jreleaser.workflow.AbstractWorkflowItem.lambda$invoke$0(AbstractWorkflowItem.java:43)
    at jreleaser.shadow.org.jreleaser.engine.hooks.HookExecutor.execute(HookExecutor.java:70)
    at jreleaser.shadow.org.jreleaser.workflow.AbstractWorkflowItem.invoke(AbstractWorkflowItem.java:43)
    at jreleaser.shadow.org.jreleaser.workflow.WorkflowImpl.doExecute(WorkflowImpl.java:129)
    at jreleaser.shadow.org.jreleaser.workflow.WorkflowImpl.execute(WorkflowImpl.java:54)
    at jreleaser.shadow.org.jreleaser.cli.FullRelease.doExecute(FullRelease.java:219)
    at jreleaser.shadow.org.jreleaser.cli.AbstractModelCommand.execute(AbstractModelCommand.java:89)
    at jreleaser.shadow.org.jreleaser.cli.AbstractCommand.call(AbstractCommand.java:52)
    at jreleaser.shadow.org.jreleaser.cli.AbstractModelCommand.call(AbstractModelCommand.java:53)
    at jreleaser.shadow.org.jreleaser.cli.AbstractCommand.call(AbstractCommand.java:37)
    at jreleaser.shadow.picocli.CommandLine.executeUserObject(CommandLine.java:2045)
    at jreleaser.shadow.picocli.CommandLine.access$1500(CommandLine.java:148)
    at jreleaser.shadow.picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(CommandLine.java:2465)
    at jreleaser.shadow.picocli.CommandLine$RunLast.handle(CommandLine.java:2457)
    at jreleaser.shadow.picocli.CommandLine$RunLast.handle(CommandLine.java:2419)
    at jreleaser.shadow.picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2277)
    at jreleaser.shadow.picocli.CommandLine$RunLast.execute(CommandLine.java:2421)
    at jreleaser.shadow.picocli.CommandLine.execute(CommandLine.java:2174)
    at jreleaser.shadow.org.jreleaser.cli.Main.execute(Main.java:98)
    at jreleaser.shadow.org.jreleaser.cli.Main.run(Main.java:94)
    at org.jreleaser.tool.JReleaser.main(JReleaser.java:47)
Caused by: jreleaser.shadow.org.jreleaser.model.spi.release.ReleaseException: jreleaser.shadow.org.jreleaser.sdk.commons.RestAPIException: 403: Forbidden
{"message":"Resource not accessible by personal access token","documentation_url":"https://docs.github.com/rest/releases/releases#create-a-release","status":"403"}
    at jreleaser.shadow.org.jreleaser.sdk.github.GithubReleaser.createRelease(GithubReleaser.java:236)
    at jreleaser.shadow.org.jreleaser.sdk.git.release.AbstractReleaser.release(AbstractReleaser.java:59)
    at jreleaser.shadow.org.jreleaser.engine.release.Releasers.release(Releasers.java:56)
    at jreleaser.shadow.org.jreleaser.workflow.ReleaseWorkflowItem.doInvoke(ReleaseWorkflowItem.java:39)
    ... 21 more
Caused by: jreleaser.shadow.org.jreleaser.sdk.commons.RestAPIException: 403: Forbidden
{"message":"Resource not accessible by personal access token","documentation_url":"https://docs.github.com/rest/releases/releases#create-a-release","status":"403"}
    at jreleaser.shadow.org.jreleaser.sdk.commons.ClientUtils.lambda$builder$1(ClientUtils.java:118)
    at jreleaser.shadow.feign.InvocationContext.decodeError(InvocationContext.java:126)
    at jreleaser.shadow.feign.InvocationContext.proceed(InvocationContext.java:72)
    at jreleaser.shadow.feign.ResponseHandler.handleResponse(ResponseHandler.java:63)
    at jreleaser.shadow.feign.SynchronousMethodHandler.executeAndDecode(SynchronousMethodHandler.java:114)
    at jreleaser.shadow.feign.SynchronousMethodHandler.invoke(SynchronousMethodHandler.java:70)
    at jreleaser.shadow.feign.ReflectiveFeign$FeignInvocationHandler.invoke(ReflectiveFeign.java:99)
    at jdk.proxy2/jdk.proxy2.$Proxy20.createRelease(Unknown Source)
    at jreleaser.shadow.org.jreleaser.sdk.github.Github.createRelease(Github.java:334)
    at jreleaser.shadow.org.jreleaser.sdk.github.GithubReleaser.createRelease(GithubReleaser.java:361)
    at jreleaser.shadow.org.jreleaser.sdk.github.GithubReleaser.createRelease(GithubReleaser.java:232)
    ... 24 more
munishchouhan commented 4 months ago

release creation needs content read and write permission which is already provided to the token

munishchouhan commented 4 months ago

further testing here https://github.com/munishchouhan/tower-cli/actions/runs

munishchouhan commented 4 months ago

cannot test in my repo because it depends upon tower-sdk

munishchouhan commented 4 months ago

@jordeu the release with GITHUB_TOKEN is working but failing to push to homebrew-tap, which is expected. when I am using a personal access token for the jreleaser its not even starting the release and failing with this error:

[DEBUG] creating release on seqeralabs/tower-cli with tag v0.9.3-A0
jreleaser.shadow.org.jreleaser.sdk.commons.RestAPIException: 403: Forbidden

if you have insights please share

munishchouhan commented 4 months ago

after discussion with @JaimeSeqLabs , we decided to delay the homebrew functionality for future releases and will publish the current one without it