The post covers the use of the setup-ballerina GitHub Action to automate the installation of the Ballerina (Swan Lake) distribution in the GitHub Action environment.
The following code block shows how you can configure the GitHub Action to build your Ballerina project. You can find a working example of this in this repository.
- The
setup-ballerinaGitHub Actionv1release requires a mandatory input of the Ballerina Swan Lake distribution version in the form of "Swan Lake channel" as listed in thebal dist listcommand. i.e.2201.3.0,2201.3.2, etc. This will install Ballerina on workflow environment andbalcommand is added to thePATH. - This action is supported on Ubuntu, MacOS, and Windows, and facilitates easy integration of Ballerina into your GitHub workflow.
- After you install Ballerina command, you can use
runto execute thebalcommand.
With the introduction of setup-ballerina, users now have the option to choose between ballerina-action and setup-ballerina for using Ballerina in their GitHub Actions workflows.
This provides greater flexibility and choice for users, allowing them to choose the option that best suits their specific workflow needs. A comparison of the two options can help users make an informed decision based on factors such as Architecture and full bal command support.
| GitHub Action | setup-ballerina |
ballerina-action |
|---|---|---|
| Architecture | Composite Actions | Docker container |
| Supported Ballerina Versions | Swan Lake | 1.x and Swan Lake |
Full bal Command Support |
Yes | Limited to bal build and bal push
|
In summary, setup-ballerina provides more flexibility and full bal command support. The choice of which action to use ultimately depends on your specific needs and workflow requirements.
Originally, setup-ballerina was one of my pet projects that have now been officially part of the Ballerina platform.

Top comments (0)