diff --git a/.github/workflows/daily-build.yml b/.github/workflows/daily-build.yml index b5e4c9720c..c7386ced4e 100644 --- a/.github/workflows/daily-build.yml +++ b/.github/workflows/daily-build.yml @@ -235,6 +235,7 @@ jobs: packageUser: ${{ github.actor }} packagePAT: ${{ secrets.GITHUB_TOKEN }} devCentralToken: ${{ secrets.BALLERINA_CENTRAL_DEV_ACCESS_TOKEN }} + prodCentralToken: ${{ secrets.BALLERINA_CENTRAL_ACCESS_TOKEN }} ballerinaBotWorkflow: $ {{ secrets.BALLERINA_BOT_WORKFLOW }} TEST_MODE_ACTIVE: true run: ./gradlew :project-api-tests:test --stacktrace --scan --console=plain --no-daemon --continue diff --git a/.github/workflows/publish-release.yml b/.github/workflows/publish-release.yml index 03a8a68b2e..0a306421ab 100644 --- a/.github/workflows/publish-release.yml +++ b/.github/workflows/publish-release.yml @@ -73,6 +73,7 @@ jobs: packageUser: ${{ secrets.BALLERINA_BOT_USERNAME }} packagePAT: ${{ secrets.BALLERINA_BOT_TOKEN }} devCentralToken: ${{ secrets.BALLERINA_CENTRAL_DEV_ACCESS_TOKEN }} + prodCentralToken: ${{ secrets.BALLERINA_CENTRAL_ACCESS_TOKEN }} ballerinaBotWorkflow: $ {{ secrets.BALLERINA_BOT_WORKFLOW }} run: | ./gradlew build -Pversion=${VERSION} diff --git a/project-api-tests/src/test/java/org/ballerina/projectapi/BuildTimeTest.java b/project-api-tests/src/test/java/org/ballerina/projectapi/BuildTimeTest.java index 6025d398fe..c24e752691 100644 --- a/project-api-tests/src/test/java/org/ballerina/projectapi/BuildTimeTest.java +++ b/project-api-tests/src/test/java/org/ballerina/projectapi/BuildTimeTest.java @@ -19,8 +19,8 @@ import java.util.Map; import java.util.Objects; -import static org.ballerina.projectapi.CentralTestUtils.BALLERINA_DEV_CENTRAL; import static org.ballerina.projectapi.CentralTestUtils.BALLERINA_HOME_DIR; +import static org.ballerina.projectapi.CentralTestUtils.TEST_MODE_ACTIVE; import static org.ballerina.projectapi.CentralTestUtils.createSettingToml; import static org.ballerina.projectapi.CentralTestUtils.deleteFiles; import static org.ballerina.projectapi.CentralTestUtils.getEnvVariables; @@ -89,7 +89,7 @@ public void testCodeGenOfflineResolution() throws IOException, InterruptedExcept */ private Map addEnvVariables(Map envVariables) { envVariables.put(BALLERINA_HOME_DIR, tempHome.toString()); - envVariables.put(BALLERINA_DEV_CENTRAL, "true"); + envVariables.put(TEST_MODE_ACTIVE, "true"); return envVariables; } diff --git a/project-api-tests/src/test/java/org/ballerina/projectapi/CentralTestUtils.java b/project-api-tests/src/test/java/org/ballerina/projectapi/CentralTestUtils.java index c26bf8b31f..8d89a429d2 100644 --- a/project-api-tests/src/test/java/org/ballerina/projectapi/CentralTestUtils.java +++ b/project-api-tests/src/test/java/org/ballerina/projectapi/CentralTestUtils.java @@ -58,6 +58,7 @@ private CentralTestUtils() { static final String BALLERINA_HOME_DIR = "BALLERINA_HOME_DIR"; static final String BALLERINA_DEV_CENTRAL = "BALLERINA_DEV_CENTRAL"; + static final String TEST_MODE_ACTIVE = "TEST_MODE_ACTIVE"; static final String BALLERINA_CENTRAL_ACCESS_TOKEN = "BALLERINA_CENTRAL_ACCESS_TOKEN"; static final String BALLERINA_TOML = "Ballerina.toml"; static final String DEPENDENCIES_TOML = "Dependencies.toml"; @@ -96,21 +97,30 @@ static String randomPackageName(int count) { * @throws IOException i/o exception when writing to file */ static void createSettingToml(Path dirPath) throws IOException { - String content = "[central]\n accesstoken = \"" + getToken() + "\""; + String content = "[central]\n accesstoken = \"" + getProdToken() + "\""; Files.write(dirPath.resolve("Settings.toml"), content.getBytes(), StandardOpenOption.CREATE, StandardOpenOption.TRUNCATE_EXISTING); } /** - * Get token of ballerina-central-bot required to push the module. + * Get token of ballerina-dev-central required to push the module. * * @return token required to push the module. */ - private static String getToken() { + private static String getDevToken() { // staging and dev both has the same access token return System.getenv("devCentralToken"); } + /** + * Get token of ballerina-central required to push the module. + * + * @return token required to push the module. + */ + private static String getProdToken() { + return System.getenv("prodCentralToken"); + } + /** * Get token of ballerina-bot required to dispatch GitHub workflows. * diff --git a/project-api-tests/src/test/java/org/ballerina/projectapi/TestUtils.java b/project-api-tests/src/test/java/org/ballerina/projectapi/TestUtils.java index 598a26a53a..73256c65c5 100644 --- a/project-api-tests/src/test/java/org/ballerina/projectapi/TestUtils.java +++ b/project-api-tests/src/test/java/org/ballerina/projectapi/TestUtils.java @@ -30,8 +30,8 @@ import java.util.List; import java.util.Map; -import static org.ballerina.projectapi.CentralTestUtils.BALLERINA_DEV_CENTRAL; import static org.ballerina.projectapi.CentralTestUtils.BALLERINA_HOME_DIR; +import static org.ballerina.projectapi.CentralTestUtils.TEST_MODE_ACTIVE; /** * Utility class for tests. @@ -146,7 +146,7 @@ public static void cleanDistribution() throws IOException { */ static Map addEnvVariables(Map envVariables, Path tempHomeDirectory) { envVariables.put(BALLERINA_HOME_DIR, tempHomeDirectory.toString()); - envVariables.put(BALLERINA_DEV_CENTRAL, "true"); + envVariables.put(TEST_MODE_ACTIVE, "true"); return envVariables; } }