DEV Community

Hasitha Aravinda
Hasitha Aravinda

Posted on

Simplify Ballerina Workflow on GitHub with setup-ballerina Action

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.

 raw `setup-ballerina` endraw  in action

  • The setup-ballerina GitHub Action v1 release requires a mandatory input of the Ballerina Swan Lake distribution version in the form of "Swan Lake channel" as listed in the bal dist list command. i.e. 2201.3.0, 2201.3.2, etc. This will install Ballerina on workflow environment and bal command is added to the PATH.
  • 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 run to execute the bal command.

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)