From d1caba4e4f5976f171c2759607d8a9e93607c8b4 Mon Sep 17 00:00:00 2001 From: Tharik Kanaka Date: Thu, 22 Apr 2021 15:43:57 +0530 Subject: [PATCH] Fix central token issue --- .github/workflows/daily-build.yml | 2 ++ .github/workflows/main.yml | 2 ++ .github/workflows/publish-release.yml | 1 + .github/workflows/pull-request.yml | 3 +++ .../java/org/ballerina/devtools/central/CentralTestUtils.java | 2 +- 5 files changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/daily-build.yml b/.github/workflows/daily-build.yml index 7a5015b3e4..41ae7d1c95 100644 --- a/.github/workflows/daily-build.yml +++ b/.github/workflows/daily-build.yml @@ -20,6 +20,7 @@ jobs: env: packageUser: ${{ github.actor }} packagePAT: ${{ secrets.GITHUB_TOKEN }} + devCentralToken: ${{ secrets.BALLERINA_DEV_CENTRAL_ACCESS_TOKEN }} run: ./gradlew clean build --stacktrace --scan --console=plain --no-daemon --continue - name: Archive Ballerina ZIP uses: actions/upload-artifact@v2 @@ -69,4 +70,5 @@ jobs: env: packageUser: ${{ github.actor }} packagePAT: ${{ secrets.GITHUB_TOKEN }} + devCentralToken: ${{ secrets.BALLERINA_DEV_CENTRAL_ACCESS_TOKEN }} run: ./gradlew.bat clean build --stacktrace --scan --console=plain --no-daemon -x test diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 1671e0577b..cb14842db8 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -28,12 +28,14 @@ jobs: env: packageUser: ${{ github.actor }} packagePAT: ${{ secrets.GITHUB_TOKEN }} + devCentralToken: ${{ secrets.BALLERINA_DEV_CENTRAL_ACCESS_TOKEN }} run: ./gradlew clean build --stacktrace --scan --console=plain --no-daemon --continue - name: Build Ballerina Distribution Skip Tests if: ${{ github.event.inputs.skipTests == 'true' }} env: packageUser: ${{ github.actor }} packagePAT: ${{ secrets.GITHUB_TOKEN }} + devCentralToken: ${{ secrets.BALLERINA_DEV_CENTRAL_ACCESS_TOKEN }} run: ./gradlew clean build --stacktrace --scan --console=plain --no-daemon --continue -x test - name: Archive Ballerina ZIP uses: actions/upload-artifact@v2 diff --git a/.github/workflows/publish-release.yml b/.github/workflows/publish-release.yml index 046a8036cb..c93a07bc1e 100644 --- a/.github/workflows/publish-release.yml +++ b/.github/workflows/publish-release.yml @@ -36,6 +36,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.BALLERINA_BOT_TOKEN }} packageUser: ${{ secrets.BALLERINA_BOT_USERNAME }} packagePAT: ${{ secrets.BALLERINA_BOT_TOKEN }} + devCentralToken: ${{ secrets.BALLERINA_DEV_CENTRAL_ACCESS_TOKEN }} run: | ./gradlew build release -Prelease.useAutomaticVersion=true -Pversion=${VERSION} - name: Create release diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index f6ca070b6f..e5187e1b03 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -21,6 +21,7 @@ jobs: env: packageUser: ${{ github.actor }} packagePAT: ${{ secrets.GITHUB_TOKEN }} + devCentralToken: ${{ secrets.BALLERINA_DEV_CENTRAL_ACCESS_TOKEN }} run: ./gradlew clean build --stacktrace --scan --console=plain --no-daemon --continue -x :ballerina:testExamples ubuntu-bbe-tests: @@ -36,6 +37,7 @@ jobs: env: packageUser: ${{ github.actor }} packagePAT: ${{ secrets.GITHUB_TOKEN }} + devCentralToken: ${{ secrets.BALLERINA_DEV_CENTRAL_ACCESS_TOKEN }} run: ./gradlew clean :ballerina:testExamples --stacktrace --scan --console=plain --no-daemon --continue windows-build-without-tests: runs-on: windows-latest @@ -50,4 +52,5 @@ jobs: env: packageUser: ${{ github.actor }} packagePAT: ${{ secrets.GITHUB_TOKEN }} + devCentralToken: ${{ secrets.BALLERINA_DEV_CENTRAL_ACCESS_TOKEN }} run: ./gradlew.bat clean build --stacktrace --scan --console=plain --no-daemon --continue -x test diff --git a/devtools-integration-tests/src/test/java/org/ballerina/devtools/central/CentralTestUtils.java b/devtools-integration-tests/src/test/java/org/ballerina/devtools/central/CentralTestUtils.java index 29f5d8444c..218d504e83 100644 --- a/devtools-integration-tests/src/test/java/org/ballerina/devtools/central/CentralTestUtils.java +++ b/devtools-integration-tests/src/test/java/org/ballerina/devtools/central/CentralTestUtils.java @@ -84,7 +84,7 @@ static void createSettingToml(Path dirPath) throws IOException { */ private static String getToken() { // staging and dev both has the same access token - return new String(Base64.getDecoder().decode("OGM0Mzk4OTktYjNjMy0zOGZmLThkMjYtY2Q2MjlkNTY3OTFj")); + return System.getenv("devCentralToken"); } /**