diff --git a/.github/workflows/central-publish.yml b/.github/workflows/central-publish.yml index 4750aede6..2ce7e868b 100644 --- a/.github/workflows/central-publish.yml +++ b/.github/workflows/central-publish.yml @@ -8,7 +8,6 @@ on: description: Select environment required: true options: - - CENTRAL - DEV CENTRAL - STAGE CENTRAL @@ -25,19 +24,6 @@ jobs: java-version: 17.0.7 - name: Grant execute permission for gradlew run: chmod +x gradlew - - 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 }} - nexusUser: ${{ secrets.NEXUS_USERNAME }} - nexusPassword: ${{ secrets.NEXUS_PASSWORD }} - run: | - ./gradlew clean build -PpublishToCentral=true - name: Ballerina Central Dev Push if: ${{ github.event.inputs.environment == 'DEV CENTRAL' }} @@ -49,7 +35,9 @@ jobs: packagePAT: ${{ secrets.BALLERINA_BOT_TOKEN }} GITHUB_TOKEN: ${{ secrets.BALLERINA_BOT_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: @@ -60,4 +48,5 @@ jobs: packagePAT: ${{ secrets.BALLERINA_BOT_TOKEN }} GITHUB_TOKEN: ${{ secrets.BALLERINA_BOT_TOKEN }} run: | + sed -i 's/version=\(.*\)-SNAPSHOT/version=\1/g' gradle.properties ./gradlew clean build -PpublishToCentral=true