Skip to content

Generate Ballerina By Examples on demand

praneesha edited this page Jun 28, 2022 · 2 revisions

Updating the Ballerina By Examples can be done against the nightly PR builds.

The sections below provide the instructions to do this by simply running the Create PR for new Swan Lake BBEs pages on demand GitHub workflow.

Do your changes

Change the source of the Ballerina by Examples on the <ballerina-distribution> GitHub repository by merging a Pull Request.

Obtain the input values

The Create PR for new Swan Lake BBEs pages on demand GitHub workflow requires three input values to run it.

BBE On-Demand Workflow

The sections below provide the instructions to obtain them.

Obtain the artifact ID

In the Ballerina distributions, the PR merge builds and daily builds archive the artifacts. You need to get the ID of the Ballerina ZIP artifact, which is appended as the last element in the URL.

BBE On-Demand Workflow

Follow the steps below to obtain it.

  1. In the <ballerina-distribution> repo, click Actions, and then click Build.
  2. Wait until the build of the topmost entry (which is the latest) is successful.

    Tip: This will be indicated by a green color tick.

  3. Scroll down and right-click on the BALLERINA.zip file, and click Copy Link.
  4. Get the last element (the integer code) from the appended URL, which is the Artifact ID. (E.g., The artifact ID of https://github.com/ballerina-platform/ballerina-distribution/suites/2891309717/artifacts/64739040 is 64739040.)

Obtain the artifact version and short version

Click on the <ballerina-distribution>/gradle.properties file, and pick the master version (e.g., swan-lake-beta1-SNAPSHOT) and the short version (e.g., slbeta1).

E.g., version=swan-lake-beta2-SNAPSHOT and shortVersion=slbeta2.

Run the workflow

Follow the steps below in this ballerina-dev-website repo to run the respective workflow.

  1. In this ballerina-dev-website repo, click Actions in the top menu.
  2. Click on the Create PR for new Swan Lake BBEs pages on demand workflow, and click Run workflow.
  3. Select the Branch on which you need to update the BBE changes.
  4. Enter the Artifact ID, Artifact version, and Artifact short version (you obtained above).
  5. Click Run workflow. (This creates a PR to update the BBEs on the dev site.)
  6. Get the PR approved and merged.

Verify your changes locally

After running the workflow, once the PR build is successful, it creates a PR. Check out the branch of that PR, and build the website locally to verify your changes.