You can refer to this repository where the project is set up with CI workflow already. I won't be showing here how to set up a library and how to set up the configuration for the publishing library in the project. Because our main goal is to demonstrate usage of CI to publish library. Here I'm assuming that you already know how to create a library and have the library setup done with publishing configuration. Let's start and see how we can achieve this. It sounds awesome □, right? Just provide version name and trigger workflow and GitHub Actions does everything rest for you! □ Create a draft release with a recently created tag.Publish library to Maven central with specified Version name.Build library project ( check if any compilation error/test fails).It'll take Version name as an input parameter for running the workflow.This is just like "Build with parameters" of Jenkins CI. While triggering workflow_dispatch event, we can provide external input parameters as well which can be then retrieved in Action. For more information, see "Manually running a workflow." You can manually trigger a workflow run using the GitHub API, GitHub CLI, or GitHub browser interface. To manually trigger a workflow, GitHub Action provides workflow_dispatch event. Also, triggering CI on pushing tag works in this case, but it still needs pushing a tag manually□. But we don't want to add such an event, right? Because every time we push on release, master, or any other branch, it doesn't mean we want to release the library. GitHub Action CI can be triggered on certain events like pushing commits, pushing tags, etc. Since most of the developers publish libraries on GitHub, we are gonna use GitHub Actions CI to automate library publishing and release. That's why I thought of automating this workflow so that we can release a library with just a click, that's it, let's see it! □ There are some extra steps and a set of scripts to publish the library on maven central as compared to Bintray. It's really different and complex thing for a developer initially who is using the Sonatype, Nexus repository manager after coming from Bintray. I personally moved my open-source JVM libraries to maven central. Hey developers□, after the sunset of Bintray almost many developers migrated their JVM library publishing workflow and moved to maven central.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |