From 95378d57beafc78aa552bff7afe3f8fe54f0e9a6 Mon Sep 17 00:00:00 2001 From: Kaneel Dias Date: Wed, 23 Feb 2022 15:15:25 +0530 Subject: [PATCH] Add workflow --- .github/workflows/central-publish.yml | 65 +++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 .github/workflows/central-publish.yml diff --git a/.github/workflows/central-publish.yml b/.github/workflows/central-publish.yml new file mode 100644 index 0000000..0907853 --- /dev/null +++ b/.github/workflows/central-publish.yml @@ -0,0 +1,65 @@ +name: Central Publish + +on: + workflow_dispatch: + inputs: + environment: + type: choice + description: Select environment + required: true + options: + - CENTRAL + - DEV CENTRAL + - STAGE CENTRAL + +jobs: + publish-release: + runs-on: ubuntu-latest + if: github.repository_owner == 'ballerina-platform' + steps: + - uses: actions/checkout@v2 + + - name: Ballerina Build + uses: ballerina-platform/ballerina-action/@slbeta5 + with: + args: + build --skip-tests + + - name: Ballerina Pack + uses: ballerina-platform/ballerina-action/@slbeta5 + with: + args: + pack + + - name: Ballerina Central Push + if: ${{ github.event.inputs.environment == 'CENTRAL' }} + uses: ballerina-platform/ballerina-action/@slbeta5 + env: + BALLERINA_DEV_CENTRAL: false + BALLERINA_STAGE_CENTRAL: false + BALLERINA_CENTRAL_ACCESS_TOKEN: ${{ secrets.BALLERINA_CENTRAL_ACCESS_TOKEN }} + with: + args: + push + + - name: Ballerina Central Dev Push + if: ${{ github.event.inputs.environment == 'DEV CENTRAL' }} + uses: ballerina-platform/ballerina-action/@slbeta5 + env: + BALLERINA_DEV_CENTRAL: true + BALLERINA_STAGE_CENTRAL: false + BALLERINA_CENTRAL_ACCESS_TOKEN: ${{ secrets.BALLERINA_CENTRAL_DEV_ACCESS_TOKEN }} + with: + args: + push + + - name: Ballerina Central Stage Push + if: ${{ github.event.inputs.environment == 'STAGE CENTRAL' }} + uses: ballerina-platform/ballerina-action/@slbeta5 + env: + BALLERINA_DEV_CENTRAL: false + BALLERINA_STAGE_CENTRAL: true + BALLERINA_CENTRAL_ACCESS_TOKEN: ${{ secrets.BALLERINA_CENTRAL_STAGE_ACCESS_TOKEN }} + with: + args: + push