From a88c40d5082df0ba9503c77484ae260dcd4eaa41 Mon Sep 17 00:00:00 2001 From: Danesh Kuruppu Date: Mon, 15 Apr 2024 23:10:13 +0530 Subject: [PATCH 1/2] [Automated] Update the native jar versions --- ballerina/Ballerina.toml | 4 ++-- ballerina/Dependencies.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ballerina/Ballerina.toml b/ballerina/Ballerina.toml index 3eeec7b..3d5a691 100644 --- a/ballerina/Ballerina.toml +++ b/ballerina/Ballerina.toml @@ -1,7 +1,7 @@ [package] org = "ballerina" name = "observe" -version = "1.2.2" +version = "1.2.3" distribution = "2201.8.0" export = ["observe", "observe.mockextension" ] @@ -9,7 +9,7 @@ export = ["observe", "observe.mockextension" ] graalvmCompatible = true [[platform.java17.dependency]] -path = "../native/build/libs/observe-native-1.2.2.jar" +path = "../native/build/libs/observe-native-1.2.3-SNAPSHOT.jar" groupId = "ballerina" artifactId = "observe" diff --git a/ballerina/Dependencies.toml b/ballerina/Dependencies.toml index 2725a36..87219ba 100644 --- a/ballerina/Dependencies.toml +++ b/ballerina/Dependencies.toml @@ -18,7 +18,7 @@ modules = [ [[package]] org = "ballerina" name = "observe" -version = "1.2.2" +version = "1.2.3" dependencies = [ {org = "ballerina", name = "jballerina.java"} ] From 46313aab7603444661e707fed16408b50276e303 Mon Sep 17 00:00:00 2001 From: Danesh Kuruppu Date: Mon, 15 Apr 2024 23:15:57 +0530 Subject: [PATCH 2/2] Update central publish workflow to accept dev and staging central --- .github/workflows/central-publish.yml | 64 ++++++++++++++++++++++++--- 1 file changed, 57 insertions(+), 7 deletions(-) diff --git a/.github/workflows/central-publish.yml b/.github/workflows/central-publish.yml index 2418a0d..1310269 100644 --- a/.github/workflows/central-publish.yml +++ b/.github/workflows/central-publish.yml @@ -2,36 +2,86 @@ name: Publish to the Ballerina central 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: - - name: Checkout Repository - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Set up JDK 17 - uses: actions/setup-java@v2 + uses: actions/setup-java@v3 with: - distribution: 'adopt' + distribution: 'temurin' java-version: 17.0.7 - name: Build with Gradle env: packageUser: ${{ github.actor }} packagePAT: ${{ secrets.GITHUB_TOKEN }} run: ./gradlew build -x check -x test + - name: Create lib directory if not exists + run: mkdir -p ballerina/lib - name: Run Trivy vulnerability scanner uses: aquasecurity/trivy-action@master with: - scan-type: 'fs' + scan-type: 'rootfs' scan-ref: '/github/workspace/ballerina/lib' format: 'table' + timeout: '10m0s' exit-code: '1' - - name: Publish artifact + + - name: Ballerina Central Push + if: ${{ github.event.inputs.environment == 'CENTRAL' }} env: + BALLERINA_DEV_CENTRAL: false + BALLERINA_STAGE_CENTRAL: false BALLERINA_CENTRAL_ACCESS_TOKEN: ${{ secrets.BALLERINA_CENTRAL_ACCESS_TOKEN }} packageUser: ${{ secrets.BALLERINA_BOT_USERNAME }} packagePAT: ${{ secrets.BALLERINA_BOT_TOKEN }} GITHUB_TOKEN: ${{ secrets.BALLERINA_BOT_TOKEN }} + CLIENT_ID: ${{ secrets.CLIENT_ID }} + CLIENT_SECRET: ${{ secrets.CLIENT_SECRET }} + REFRESH_TOKEN: ${{ secrets.REFRESH_TOKEN }} + run: | + ./gradlew clean build -PpublishToCentral=true + + - name: Ballerina Central Dev Push + if: ${{ github.event.inputs.environment == 'DEV CENTRAL' }} + env: + BALLERINA_DEV_CENTRAL: true + BALLERINA_STAGE_CENTRAL: false + BALLERINA_CENTRAL_ACCESS_TOKEN: ${{ secrets.BALLERINA_CENTRAL_DEV_ACCESS_TOKEN }} + packageUser: ${{ secrets.BALLERINA_BOT_USERNAME }} + packagePAT: ${{ secrets.BALLERINA_BOT_TOKEN }} + GITHUB_TOKEN: ${{ secrets.BALLERINA_BOT_TOKEN }} + CLIENT_ID: ${{ secrets.CLIENT_ID }} + CLIENT_SECRET: ${{ secrets.CLIENT_SECRET }} + REFRESH_TOKEN: ${{ secrets.REFRESH_TOKEN }} + run: | + sed -i 's/version=\(.*\)-SNAPSHOT/version=\1/g' gradle.properties + ./gradlew clean build -PpublishToCentral=true + + - name: Ballerina Central Stage Push + if: ${{ github.event.inputs.environment == 'STAGE CENTRAL' }} + env: + BALLERINA_DEV_CENTRAL: false + BALLERINA_STAGE_CENTRAL: true + BALLERINA_CENTRAL_ACCESS_TOKEN: ${{ secrets.BALLERINA_CENTRAL_STAGE_ACCESS_TOKEN }} + packageUser: ${{ secrets.BALLERINA_BOT_USERNAME }} + packagePAT: ${{ secrets.BALLERINA_BOT_TOKEN }} + GITHUB_TOKEN: ${{ secrets.BALLERINA_BOT_TOKEN }} + CLIENT_ID: ${{ secrets.CLIENT_ID }} + CLIENT_SECRET: ${{ secrets.CLIENT_SECRET }} + REFRESH_TOKEN: ${{ secrets.REFRESH_TOKEN }} run: | - ./gradlew clean build -PpublishToCentral=true --stacktrace --console=plain + sed -i 's/version=\(.*\)-SNAPSHOT/version=\1/g' gradle.properties + ./gradlew clean build -PpublishToCentral=true \ No newline at end of file