From 78dd536db1e9908f7e252819118550d572619b3d Mon Sep 17 00:00:00 2001 From: RolandHewage <44081958+RolandHewage@users.noreply.github.com> Date: Mon, 25 Apr 2022 12:40:58 +0530 Subject: [PATCH] Create dev-stg-release.yml --- .github/workflows/dev-stg-release.yml | 63 +++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 .github/workflows/dev-stg-release.yml diff --git a/.github/workflows/dev-stg-release.yml b/.github/workflows/dev-stg-release.yml new file mode 100644 index 0000000..396295c --- /dev/null +++ b/.github/workflows/dev-stg-release.yml @@ -0,0 +1,63 @@ +name: Dev/Staging BCentral Release + +on: + workflow_dispatch: + inputs: + bal_central_environment: + description: Ballerina Central Environment + type: choice + options: + - STAGE + - DEV + required: true + +# A workflow run is made up of one or more jobs that can run sequentially or in parallel +jobs: + # This workflow contains a single job called "release" + release: + # The type of runner that the job will run on + runs-on: ubuntu-latest + env: + BALLERINA_${{ github.event.inputs.bal_central_environment }}_CENTRAL: true + + # Steps represent a sequence of tasks that will be executed as part of the job + steps: + # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it + - uses: actions/checkout@v2 + + # Set up Java Environment + - name: Set up JDK 11 + uses: actions/setup-java@v1 + with: + java-version: 11 + + # Build the ballerina project + - name: Ballerina Build + uses: ballerina-platform/ballerina-action@master + with: + args: + pack + env: + JAVA_HOME: /usr/lib/jvm/default-jvm + + # Push to Ballerina Staging Central + - name: Push to Staging + if: github.event.inputs.bal_central_environment == 'STAGE' + uses: ballerina-platform/ballerina-action@master + with: + args: + push + env: + JAVA_HOME: /usr/lib/jvm/default-jvm + BALLERINA_CENTRAL_ACCESS_TOKEN: ${{ secrets.BALLERINA_CENTRAL_STAGE_ACCESS_TOKEN }} + + # Push to Ballerina Dev Central + - name: Push to Dev + if: github.event.inputs.bal_central_environment == 'DEV' + uses: ballerina-platform/ballerina-action@master + with: + args: + push + env: + JAVA_HOME: /usr/lib/jvm/default-jvm + BALLERINA_CENTRAL_ACCESS_TOKEN: ${{ secrets.BALLERINA_CENTRAL_DEV_ACCESS_TOKEN }}