├── hello.bal ├── updatepath.ps1 ├── .github ├── CODEOWNERS ├── ISSUE_TEMPLATE │ ├── task.yml │ ├── config.yml │ ├── improvement.yml │ ├── new-feature.yml │ └── bug.yml └── workflows │ ├── test-macos.yml │ ├── test-ubuntu.yml │ └── test-windows.yml ├── .gitignore ├── issue_template.md ├── pull_request_template.md ├── README.md ├── action.yml └── LICENSE /hello.bal: -------------------------------------------------------------------------------- 1 | import ballerina/io; 2 | 3 | public function main() { 4 | io:println("Hello, World!"); 5 | } 6 | -------------------------------------------------------------------------------- /updatepath.ps1: -------------------------------------------------------------------------------- 1 | echo "C:\Program Files\Ballerina\bin\" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append 2 | -------------------------------------------------------------------------------- /.github/CODEOWNERS: -------------------------------------------------------------------------------- 1 | # See: https://help.github.com/articles/about-codeowners/ 2 | 3 | # These owners will be the default owners for everything in the repo. 4 | * @keizer619 5 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Compiled class file 2 | *.class 3 | 4 | # Log file 5 | *.log 6 | 7 | # BlueJ files 8 | *.ctxt 9 | 10 | # Mobile Tools for Java (J2ME) 11 | .mtj.tmp/ 12 | 13 | # Package Files # 14 | *.jar 15 | *.war 16 | *.nar 17 | *.ear 18 | *.zip 19 | *.tar.gz 20 | *.rar 21 | 22 | # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml 23 | hs_err_pid* 24 | 25 | .idea 26 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/task.yml: -------------------------------------------------------------------------------- 1 | name: "✍️ Create a Task" 2 | description: Create a new task. 3 | labels: ["Type/Task"] 4 | body: 5 | - type: textarea 6 | id: description 7 | attributes: 8 | label: Description 9 | description: A clear description of what needs to be done. 10 | validations: 11 | required: true 12 | - type: input 13 | id: version 14 | attributes: 15 | label: Version 16 | description: Enter product/component version. 17 | validations: 18 | required: false 19 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | blank_issues_enabled: false 2 | contact_links: 3 | - name: '📚 Documentation Issue' 4 | about: Request a new article, missing topic, or report an issue if a topic is incorrect in the current documentation. 5 | url: https://github.com/ballerina-platform/ballerina-dev-website/issues/new/choose 6 | - name: General Question 7 | url: https://stackoverflow.com/questions/tagged/ballerina 8 | about: "If you have a question then please ask on Stack Overflow using the #ballerina tag." 9 | - name: Chat on Ballerina Discord Channel 10 | url: https://discord.gg/ballerinalang 11 | about: "Chat about anything else with the community." 12 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/improvement.yml: -------------------------------------------------------------------------------- 1 | name: "🚀 Improvement Request" 2 | description: Suggest an improvement to the product. 3 | labels: ["Type/Improvement"] 4 | body: 5 | - type: textarea 6 | id: limitation 7 | attributes: 8 | label: Current Limitation 9 | description: Describe the the current limitation. 10 | validations: 11 | required: true 12 | - type: textarea 13 | id: suggestion 14 | attributes: 15 | label: Suggested Improvement 16 | description: Describe the the improvement you suggest. 17 | validations: 18 | required: true 19 | - type: input 20 | id: version 21 | attributes: 22 | label: Version 23 | description: Enter component version. 24 | validations: 25 | required: false 26 | -------------------------------------------------------------------------------- /issue_template.md: -------------------------------------------------------------------------------- 1 | **Description:** 2 | 3 | 4 | **Suggested Labels:** 5 | 6 | 7 | **Suggested Assignees:** 8 | 9 | 10 | **Affected Product Version:** 11 | 12 | **OS, DB, other environment details and versions:** 13 | 14 | **Steps to reproduce:** 15 | 16 | 17 | **Related Issues:** 18 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/new-feature.yml: -------------------------------------------------------------------------------- 1 | name: "💡 New Feature Request" 2 | description: Suggest new functionality and features for the product. 3 | labels: ["Type/NewFeature"] 4 | body: 5 | - type: textarea 6 | id: problem 7 | attributes: 8 | label: Problem 9 | description: What is the problem this feature will solve? 10 | validations: 11 | required: true 12 | - type: textarea 13 | id: solution 14 | attributes: 15 | label: Proposed Solution 16 | description: Describe the solution you'd like to have. 17 | validations: 18 | required: true 19 | - type: textarea 20 | id: alternatives 21 | attributes: 22 | label: Alternatives 23 | description: Describe any alternatives have you considered 24 | validations: 25 | required: false 26 | - type: input 27 | id: version 28 | attributes: 29 | label: Version 30 | description: Enter product/component version. 31 | validations: 32 | required: false 33 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug.yml: -------------------------------------------------------------------------------- 1 | name: "🐞 Report a Bug" 2 | description: Create an issue if something does not work as expected. 3 | labels: ["Type/Bug"] 4 | body: 5 | - type: textarea 6 | id: background 7 | attributes: 8 | label: Description 9 | description: Please share a clear and concise description of the problem. 10 | placeholder: Description 11 | - type: textarea 12 | id: steps 13 | attributes: 14 | label: Steps to Reproduce 15 | description: List the steps you followed when you encountered the issue. Provide sample source code to reproduce the issue where applicable. 16 | validations: 17 | required: true 18 | - type: input 19 | id: version 20 | attributes: 21 | label: Version 22 | description: Enter product/component version. 23 | validations: 24 | required: true 25 | - type: textarea 26 | id: environment 27 | attributes: 28 | label: Environment Details (with versions) 29 | description: Mention the environment details (OS, Client, etc.) that the product is running on. 30 | validations: 31 | required: false 32 | -------------------------------------------------------------------------------- /.github/workflows/test-macos.yml: -------------------------------------------------------------------------------- 1 | name: Test MacOS 2 | on: 3 | push: 4 | branches: 5 | - main 6 | pull_request: 7 | workflow_dispatch: 8 | inputs: 9 | balVersion: 10 | default: 2201.9.2 11 | jobs: 12 | test_macos: 13 | name: Test action on MacOS 14 | runs-on: macos-latest 15 | steps: 16 | - name: Set env 17 | run: |- 18 | echo "balVersion=$( 19 | if [[ -n "${{ github.event.inputs.balVersion }}" ]]; then 20 | echo ${{ github.event.inputs.balVersion }} 21 | else 22 | echo 2201.3.2 23 | fi 24 | )" >> $GITHUB_ENV 25 | - uses: actions/checkout@v2 26 | - uses: ballerina-platform/setup-ballerina@main 27 | name: Test the action. 28 | with: 29 | version: ${{ env.balVersion }} 30 | - run: bal version 31 | - run: bal run hello.bal 32 | 33 | test_macos_nightly: 34 | name: Test action on MacOS (nightly) 35 | runs-on: macos-latest 36 | steps: 37 | - uses: actions/checkout@v2 38 | - uses: ballerina-platform/setup-ballerina@main 39 | name: Test the action. 40 | with: 41 | version: nightly-2201.9.x 42 | - run: bal version 43 | - run: bal run hello.bal 44 | -------------------------------------------------------------------------------- /.github/workflows/test-ubuntu.yml: -------------------------------------------------------------------------------- 1 | name: Test Ubuntu 2 | on: 3 | push: 4 | branches: 5 | - main 6 | pull_request: 7 | workflow_dispatch: 8 | inputs: 9 | balVersion: 10 | default: 2201.9.2 11 | jobs: 12 | test_linux: 13 | name: Test action on Ubuntu 14 | runs-on: ubuntu-latest 15 | steps: 16 | - name: Set env 17 | run: |- 18 | echo "balVersion=$( 19 | if [[ -n "${{ github.event.inputs.balVersion }}" ]]; then 20 | echo ${{ github.event.inputs.balVersion }} 21 | else 22 | echo 2201.9.2 23 | fi 24 | )" >> $GITHUB_ENV 25 | - uses: actions/checkout@v2 26 | - uses: ballerina-platform/setup-ballerina@main 27 | name: Test the action. 28 | with: 29 | version: ${{ env.balVersion }} 30 | - run: bal version 31 | - run: bal run hello.bal 32 | 33 | test_linux_nightly: 34 | name: Test action on Ubuntu (nightly) 35 | runs-on: ubuntu-latest 36 | steps: 37 | - uses: actions/checkout@v2 38 | - uses: ballerina-platform/setup-ballerina@main 39 | name: Test the action. 40 | with: 41 | version: nightly-2201.9.x 42 | - run: bal version 43 | - run: bal run hello.bal 44 | -------------------------------------------------------------------------------- /.github/workflows/test-windows.yml: -------------------------------------------------------------------------------- 1 | name: Test Windows 2 | on: 3 | push: 4 | branches: 5 | - main 6 | pull_request: 7 | workflow_dispatch: 8 | inputs: 9 | balVersion: 10 | default: 2201.9.2 11 | jobs: 12 | test_windows: 13 | name: Test action on Windows 14 | runs-on: windows-latest 15 | steps: 16 | - name: Set env 17 | run: |- 18 | echo "balVersion=$( 19 | if [[ -n "${{ github.event.inputs.balVersion }}" ]]; then 20 | echo ${{ github.event.inputs.balVersion }} 21 | else 22 | echo 2201.9.2 23 | fi 24 | )" >> $GITHUB_ENV 25 | shell: bash 26 | - uses: actions/checkout@v2 27 | - uses: ballerina-platform/setup-ballerina@main 28 | name: Test the action. 29 | with: 30 | version: ${{ env.balVersion }} 31 | - run: bal version 32 | - run: bal run hello.bal 33 | 34 | test_windows_nightly: 35 | name: Test action on Windows (nightly) 36 | runs-on: windows-latest 37 | steps: 38 | - uses: actions/checkout@v2 39 | - uses: ballerina-platform/setup-ballerina@main 40 | name: Test the action. 41 | with: 42 | version: nightly-2201.9.x 43 | - run: bal version 44 | - run: bal run hello.bal 45 | -------------------------------------------------------------------------------- /pull_request_template.md: -------------------------------------------------------------------------------- 1 | ## Purpose 2 | > Describe the problems, issues, or needs driving this feature/fix and include links to related issues in the following format: Resolves issue1, issue2, etc. 3 | 4 | ## Goals 5 | > Describe the solutions that this feature/fix will introduce to resolve the problems described above 6 | 7 | ## Approach 8 | > Describe how you are implementing the solutions. Include an animated GIF or screenshot if the change affects the UI (email documentation@wso2.com to review all UI text). Include a link to a Markdown file or Google doc if the feature write-up is too long to paste here. 9 | 10 | ## User stories 11 | > Summary of user stories addressed by this change> 12 | 13 | ## Release note 14 | > Brief description of the new feature or bug fix as it will appear in the release notes 15 | 16 | ## Documentation 17 | > Link(s) to product documentation that addresses the changes of this PR. If no doc impact, enter “N/A” plus brief explanation of why there’s no doc impact 18 | 19 | ## Training 20 | > Link to the PR for changes to the training content in https://github.com/wso2/WSO2-Training, if applicable 21 | 22 | ## Certification 23 | > Type “Sent” when you have provided new/updated certification questions, plus four answers for each question (correct answer highlighted in bold), based on this change. Certification questions/answers should be sent to certification@wso2.com and NOT pasted in this PR. If there is no impact on certification exams, type “N/A” and explain why. 24 | 25 | ## Marketing 26 | > Link to drafts of marketing content that will describe and promote this feature, including product page changes, technical articles, blog posts, videos, etc., if applicable 27 | 28 | ## Automation tests 29 | - Unit tests 30 | > Code coverage information 31 | - Integration tests 32 | > Details about the test cases and coverage 33 | 34 | ## Security checks 35 | - Followed secure coding standards in http://wso2.com/technical-reports/wso2-secure-engineering-guidelines? yes/no 36 | - Ran FindSecurityBugs plugin and verified report? yes/no 37 | - Confirmed that this PR doesn't commit any keys, passwords, tokens, usernames, or other secrets? yes/no 38 | 39 | ## Samples 40 | > Provide high-level details about the samples related to this feature 41 | 42 | ## Related PRs 43 | > List any other related PRs 44 | 45 | ## Migrations (if applicable) 46 | > Describe migration steps and platforms on which migration has been tested 47 | 48 | ## Test environment 49 | > List all JDK versions, operating systems, databases, and browser/versions on which this feature/fix was tested 50 | 51 | ## Learning 52 | > Describe the research phase and any blog posts, patterns, libraries, or add-ons you used to solve the problem. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | [![Test Ubuntu](https://github.com/ballerina-platform/setup-ballerina/actions/workflows/test-ubuntu.yml/badge.svg?branch=main)](https://github.com/ballerina-platform/setup-ballerina/actions/workflows/test-ubuntu.yml) 2 | [![Test Windows](https://github.com/ballerina-platform/setup-ballerina/actions/workflows/test-windows.yml/badge.svg?branch=main)](https://github.com/ballerina-platform/setup-ballerina/actions/workflows/test-windows.yml) 3 | [![Test Action](https://github.com/ballerina-platform/setup-ballerina/actions/workflows/test-macos.yml/badge.svg?branch=main)](https://github.com/ballerina-platform/setup-ballerina/actions/workflows/test-macos.yml) 4 | [![GitHub license](https://img.shields.io/github/license/ballerina-platform/setup-ballerina)](https://github.com/ballerina-platform/setup-ballerina/blob/main/LICENSE) 5 | [![GitHub issues](https://img.shields.io/github/issues/ballerina-platform/setup-ballerina)](https://github.com/ballerina-platform/setup-ballerina/issues) 6 | 7 | # Setup Ballerina 8 | 9 | This Github action installs [Ballerina](https://ballerina.io)'s build system and package manager command; the `bal` command. 10 | 11 | ## Inputs 12 | 13 | |Input| Description|Required| 14 | |---|---|---| 15 | |_version_|Ballerina SwanLake Version|yes| 16 | 17 | ## Usage 18 | 19 | _**Note**: This action is supported on all operating systems (`ubuntu`, `macos`, `windows`)_ 20 | 21 | ### Ubuntu 22 | 23 | ```yaml 24 | runs-on: ubuntu-latest 25 | steps: 26 | - uses: actions/checkout@v2 27 | - uses: ballerina-platform/setup-ballerina@v1 28 | name: Install Ballerina 29 | with: 30 | version: 2201.3.2 31 | - run: bal version 32 | - run: bal run hello.bal 33 | ``` 34 | 35 | [![Test Ubuntu](https://github.com/ballerina-platform/setup-ballerina/actions/workflows/test-ubuntu.yml/badge.svg?branch=main)](https://github.com/ballerina-platform/setup-ballerina/actions/workflows/test-ubuntu.yml) 36 | [![Source](https://img.shields.io/badge/-Source-blue)](https://github.com/ballerina-platform/setup-ballerina/blob/main/.github/workflows/test-ubuntu.yml) 37 | 38 | ### MacOs 39 | 40 | ```yaml 41 | runs-on: macos-latest 42 | steps: 43 | - uses: actions/checkout@v2 44 | - uses: ballerina-platform/setup-ballerina@v1 45 | name: Install Ballerina 46 | with: 47 | version: 2201.3.2 48 | - run: bal version 49 | - run: bal run hello.bal 50 | ``` 51 | 52 | [![Test Action](https://github.com/ballerina-platform/setup-ballerina/actions/workflows/test-macos.yml/badge.svg?branch=main)](https://github.com/ballerina-platform/setup-ballerina/actions/workflows/test-macos.yml) 53 | [![Source](https://img.shields.io/badge/-Source-blue)](https://github.com/ballerina-platform/setup-ballerina/blob/main/.github/workflows/test-macos.yml) 54 | 55 | ### Windows 56 | 57 | ```yaml 58 | runs-on: windows-latest 59 | steps: 60 | - uses: actions/checkout@v2 61 | - uses: ballerina-platform/setup-ballerina@v1 62 | name: Install Ballerina 63 | with: 64 | version: 2201.3.2 65 | - run: bal version 66 | - run: bal run hello.bal 67 | ``` 68 | 69 | [![Test Windows](https://github.com/ballerina-platform/setup-ballerina/actions/workflows/test-windows.yml/badge.svg?branch=main)](https://github.com/ballerina-platform/setup-ballerina/actions/workflows/test-windows.yml) 70 | [![Source](https://img.shields.io/badge/-Source-blue)](https://github.com/ballerina-platform/setup-ballerina/blob/main/.github/workflows/test-windows.yml) 71 | 72 | ## License 73 | The scripts and documentation in this project are released under the [Apache License](https://github.com/ballerina-platform/setup-ballerina/blob/main/LICENSE). -------------------------------------------------------------------------------- /action.yml: -------------------------------------------------------------------------------- 1 | name: 'Setup Ballerina Language' 2 | description: 'Install Ballerina `bal` command' 3 | branding: 4 | icon: 'archive' 5 | color: 'green' 6 | inputs: 7 | version: 8 | description: "Ballerina Version" 9 | required: true 10 | default: 2201.9.2 11 | github-token: 12 | description: 'GitHub token' 13 | default: ${{ github.token }} 14 | required: false 15 | 16 | runs: 17 | using: "composite" 18 | steps: 19 | - name: Configure version 20 | id: configure-version 21 | run: | 22 | if [[ ${{ inputs.version }} == 'latest' ]]; then 23 | BALLERINA_VERSION=$(echo $(curl -X GET 'https://api.central.ballerina.io/2.0/update-tool/distributions/latest?version=2201.0.0') | sed -n 's/.*"major":"\([^"]*\)".*/\1/p') 24 | else 25 | BALLERINA_VERSION=${{ inputs.version }} 26 | fi 27 | echo "::set-output name=version::$BALLERINA_VERSION" 28 | echo BALLERINA_VERSION=$BALLERINA_VERSION >> $GITHUB_ENV 29 | shell: bash 30 | 31 | - name: Cache Restore 32 | id: cache-dist 33 | uses: actions/cache@v3 34 | with: 35 | path: | 36 | ballerina-${{ steps.configure-version.outputs.version }}-*.* 37 | key: ballerina-${{ steps.configure-version.outputs.version }}-${{ runner.os }} 38 | 39 | - name: Download Ballerina installer 40 | if: steps.cache-dist.outputs.cache-hit != 'true' 41 | run: | 42 | set -x 43 | GITHUB_TOKEN=${{ inputs.github-token }} 44 | if [[ $OSTYPE == 'msys'* ]]; then 45 | echo "Windows runner detected" 46 | if [[ $BALLERINA_VERSION =~ ^nightly ]]; then 47 | DAILY_BUILD_VERSION=${BALLERINA_VERSION//nightly/daily-build} 48 | echo "Using nightly build" 49 | ARTIFACT_NAME="Windows Installer msi" 50 | GITHUB_RUN_ID=$(curl -H "Authorization: token $GITHUB_TOKEN" -H "Accept: application/vnd.github.v3+json" \ 51 | "https://api.github.com/repos/ballerina-platform/ballerina-distribution/actions/workflows/$DAILY_BUILD_VERSION.yml/runs?status=success&per_page=1" | jq '.workflow_runs[0].id') 52 | DOWNLOAD_URL=$(curl -H "Authorization: token $GITHUB_TOKEN" \ 53 | -H "Accept: application/vnd.github.v3+json" \ 54 | "https://api.github.com/repos/ballerina-platform/ballerina-distribution/actions/runs/$GITHUB_RUN_ID/artifacts" | jq -r --arg name "$ARTIFACT_NAME" '.artifacts[] | select(.name == $name) | .archive_download_url') 55 | curl -H "Authorization: token $GITHUB_TOKEN" \ 56 | -L -o artifact.zip $DOWNLOAD_URL 57 | unzip -q artifact.zip 58 | else 59 | curl -L -S -s https://dist.ballerina.io/downloads/${{ steps.configure-version.outputs.version }}/ballerina-${{ steps.configure-version.outputs.version }}-swan-lake-windows-x64.msi --output ballerina-${{ inputs.version }}-swan-lake-windows-x64.msi 60 | fi 61 | elif [[ $OSTYPE == 'darwin'* ]]; then 62 | echo "MacOS runner detected" 63 | if [[ $BALLERINA_VERSION =~ ^nightly ]]; then 64 | DAILY_BUILD_VERSION=${BALLERINA_VERSION//nightly/daily-build} 65 | echo "Using nightly build" 66 | ARTIFACT_NAME="MacOS Installer pkg" 67 | GITHUB_RUN_ID=$(curl -H "Authorization: token $GITHUB_TOKEN" -H "Accept: application/vnd.github.v3+json" \ 68 | "https://api.github.com/repos/ballerina-platform/ballerina-distribution/actions/workflows/$DAILY_BUILD_VERSION.yml/runs?status=success&per_page=1" | jq '.workflow_runs[0].id') 69 | DOWNLOAD_URL=$(curl -H "Authorization: token $GITHUB_TOKEN" \ 70 | -H "Accept: application/vnd.github.v3+json" \ 71 | "https://api.github.com/repos/ballerina-platform/ballerina-distribution/actions/runs/$GITHUB_RUN_ID/artifacts" | jq -r --arg name "$ARTIFACT_NAME" '.artifacts[] | select(.name == $name) | .archive_download_url') 72 | curl -H "Authorization: token $GITHUB_TOKEN" \ 73 | -L -o artifact.zip $DOWNLOAD_URL 74 | unzip -q artifact.zip 75 | else 76 | wget -q https://dist.ballerina.io/downloads/${{ steps.configure-version.outputs.version }}/ballerina-${{ steps.configure-version.outputs.version }}-swan-lake-macos-x64.pkg 77 | fi 78 | else 79 | echo "Ubuntu runner detected" 80 | if [[ $BALLERINA_VERSION =~ ^nightly ]]; then 81 | DAILY_BUILD_VERSION=${BALLERINA_VERSION//nightly/daily-build} 82 | echo "Using nightly build" 83 | ARTIFACT_NAME="Linux Installer deb" 84 | GITHUB_RUN_ID=$(curl -H "Authorization: token $GITHUB_TOKEN" -H "Accept: application/vnd.github.v3+json" \ 85 | "https://api.github.com/repos/ballerina-platform/ballerina-distribution/actions/workflows/$DAILY_BUILD_VERSION.yml/runs?status=success&per_page=1" | jq '.workflow_runs[0].id') 86 | DOWNLOAD_URL=$(curl -H "Authorization: token $GITHUB_TOKEN" \ 87 | -H "Accept: application/vnd.github.v3+json" \ 88 | "https://api.github.com/repos/ballerina-platform/ballerina-distribution/actions/runs/$GITHUB_RUN_ID/artifacts" | jq -r --arg name "$ARTIFACT_NAME" '.artifacts[] | select(.name == $name) | .archive_download_url') 89 | curl -H "Authorization: token $GITHUB_TOKEN" \ 90 | -L -o artifact.zip $DOWNLOAD_URL 91 | unzip -q artifact.zip 92 | else 93 | wget -q https://dist.ballerina.io/downloads/${{ steps.configure-version.outputs.version }}/ballerina-${{ steps.configure-version.outputs.version }}-swan-lake-linux-x64.deb 94 | fi 95 | fi 96 | shell: bash 97 | 98 | - name: Install Ballerina 99 | run: | 100 | set -x 101 | if [[ $OSTYPE == 'msys'* ]]; then 102 | echo "windows runner detected" 103 | INSTALLER_PATH=$(dir ballerina-*-windows-x64.msi) 104 | msiexec //i $INSTALLER_PATH //qn 105 | echo "BALLERINA_HOME=C:\\Program Files\\Ballerina\\" >> $GITHUB_ENV 106 | powershell ${GITHUB_ACTION_PATH}/updatepath.ps1 107 | elif [[ $OSTYPE == 'darwin'* ]]; then 108 | echo "macos runner detected" 109 | INSTALLER_PATH=$(ls ./ballerina-*-macos-x64.pkg) 110 | sudo installer -pkg $INSTALLER_PATH -target /Library 111 | echo "BALLERINA_HOME=/Library/Ballerina" >> $GITHUB_ENV 112 | echo "/Library/Ballerina/bin" >> $GITHUB_PATH 113 | else 114 | echo "ubuntu runner detected" 115 | INSTALLER_PATH=$(ls ./ballerina-*-linux-x64.deb) 116 | if [ "$(id --user)" -eq "0" ]; then 117 | sudocmd="" 118 | else 119 | sudocmd="sudo" 120 | fi 121 | $sudocmd dpkg -i $INSTALLER_PATH 122 | echo "BALLERINA_HOME=/usr/lib/ballerina" >> $GITHUB_ENV 123 | echo "/usr/lib/ballerina/bin" >> $GITHUB_PATH 124 | fi 125 | shell: bash 126 | 127 | - name: Remove downloaded files 128 | run: | 129 | set -x 130 | rm -f ballerina-*-windows-x64.msi 131 | rm -f ballerina-*-macos-x64.pkg 132 | rm -f ballerina-*-linux-x64.deb 133 | rm -f artifact.zip 134 | shell: bash 135 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright [yyyy] [name of copyright owner] 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | --------------------------------------------------------------------------------