Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simple way to create Github Release after CI succeeds #110

Open
KannarFr opened this issue May 2, 2022 · 7 comments
Open

Simple way to create Github Release after CI succeeds #110

KannarFr opened this issue May 2, 2022 · 7 comments

Comments

@KannarFr
Copy link

KannarFr commented May 2, 2022

There is a simple way to automatically create a github release when CI publish succeeds?

@KannarFr KannarFr changed the title Simple for to create Github Release after CI succeeds Simple way to create Github Release after CI succeeds May 3, 2022
@hagaiovadia
Copy link
Contributor

You need to add the publish step and also tag reference

If it's your first time of release you need also to configure sonatype account
https://central.sonatype.org/publish/publish-guide/

To release the new version, all you need to do is create a new tag on Github and Github Actions will publish a release to Sonatype.

The SBT plugin (sbt-github-actions) with the settings in build.sbt, automatically parses Git tags as version numbers and knows to publish the project with the correct version.

For example: set the tag name as v0.0.1 and it will be published as 0.0.1

  githubWorkflowPublishTargetBranches := Seq(RefPredicate.StartsWith(Ref.Tag("v"))),
  githubWorkflowTargetTags ++= Seq("v*"),
  githubWorkflowPublish := Seq(
    WorkflowStep.Sbt(
      List("ci-release"),
      env = Map(
        "PGP_PASSPHRASE" -> "${{ secrets.PGP_PASSPHRASE }}",
        "PGP_SECRET" -> "${{ secrets.PGP_SECRET }}",
        "SONATYPE_PASSWORD" -> "${{ secrets.SONATYPE_PASSWORD }}",
        "SONATYPE_USERNAME" -> "${{ secrets.SONATYPE_USERNAME }}")))))

@KannarFr
Copy link
Author

KannarFr commented May 4, 2022

@hagaiovadia thanks for your answer. Nevertheless, this is not my question :p, I already have these steps working.

My question is how to easily create a Github Release (using Github API I guess) when the publish on sonatype succeeds.

@KannarFr
Copy link
Author

KannarFr commented May 4, 2022

image

Like this ^

@hagay3
Copy link

hagay3 commented May 4, 2022

@KannarFr
Copy link
Author

KannarFr commented May 6, 2022

@hagay3 of course (wanted to know if it was implemented as optional step). Anyway, it would be nice to handle it as optional step in sbt-github-actions ;).

@hagay3
Copy link

hagay3 commented May 6, 2022

@KannarFr
I think the purpose of sbt-github-actions is to generate a github actions yaml .

@KannarFr
Copy link
Author

KannarFr commented May 6, 2022

Hum correct, it should be managed in sbt-ci-release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants