Skip to content

Central Publish

Central Publish #2

name: Central Publish
on:
workflow_dispatch:
inputs:
environment:
type: choice
description: Select environment
required: true
options:
- CENTRAL
- DEV CENTRAL
- STAGE CENTRAL
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: 17
- name: Grant execute permission for gradlew
run: chmod +x gradlew
- name: Build with Gradle
run: |
sed -i 's/version=\(.*\)-SNAPSHOT/version=\1/g' gradle.properties
./gradlew clean build
env:
packageUser: ${{ secrets.BALLERINA_BOT_USERNAME }}
packagePAT: ${{ secrets.BALLERINA_BOT_TOKEN }}
- name: Build the final Copybook tools package using Ballerina
uses: ballerina-platform/ballerina-action/@2201.8.0
with:
args: pack ./copybook-tool
env:
JAVA_HOME: /usr/lib/jvm/default-jvm
- name: Ballerina Central Push
if: ${{ inputs.environment == 'CENTRAL' }}
uses: ballerina-platform/ballerina-action/@2201.8.0
with:
args: push
env:
WORKING_DIR: ./copybook-tool
BALLERINA_DEV_CENTRAL: false
BALLERINA_STAGE_CENTRAL: false
packageUser: ${{ secrets.BALLERINA_BOT_USERNAME }}
packagePAT: ${{ secrets.BALLERINA_BOT_TOKEN }}
JAVA_HOME: /usr/lib/jvm/default-jvm
BALLERINA_CENTRAL_ACCESS_TOKEN: ${{ secrets.BALLERINA_CENTRAL_ACCESS_TOKEN }}
- name: Ballerina Central Stage Push
if: ${{ inputs.environment == 'STAGE CENTRAL' }}
uses: ballerina-platform/ballerina-action/@2201.8.0
with:
args: push
env:
WORKING_DIR: ./copybook-tool
BALLERINA_DEV_CENTRAL: false
BALLERINA_STAGE_CENTRAL: true
packageUser: ${{ secrets.BALLERINA_BOT_USERNAME }}
packagePAT: ${{ secrets.BALLERINA_BOT_TOKEN }}
JAVA_HOME: /usr/lib/jvm/default-jvm
BALLERINA_CENTRAL_ACCESS_TOKEN: ${{ secrets.BALLERINA_CENTRAL_STAGE_ACCESS_TOKEN }}
- name: Ballerina Central Dev Push
if: ${{ inputs.environment == 'DEV CENTRAL' }}
uses: ballerina-platform/ballerina-action/@2201.8.0
with:
args: push
env:
WORKING_DIR: ./copybook-tool
BALLERINA_DEV_CENTRAL: true
BALLERINA_STAGE_CENTRAL: false
packageUser: ${{ secrets.BALLERINA_BOT_USERNAME }}
packagePAT: ${{ secrets.BALLERINA_BOT_TOKEN }}
JAVA_HOME: /usr/lib/jvm/default-jvm
BALLERINA_CENTRAL_ACCESS_TOKEN: ${{ secrets.BALLERINA_CENTRAL_DEV_ACCESS_TOKEN }}