From 9a0efbf4c4771dc563c337479ff2e08d118b11a5 Mon Sep 17 00:00:00 2001 From: Lamberto Basti Date: Wed, 22 May 2024 16:03:40 +0200 Subject: [PATCH] 233 - Update environment variables for Space credentials (#168) Environment variables and secrets for fetching packages from Space were renamed and updated. This change affects build configuration and build scripts by replacing "MAVEN_SPACE" with "SPACE_INTELLIJ_NIGHTLIES" and "SPACE_PACKAGE_SEARCH". The affected files include Github workflow configuration files, build scripts, and publish plugin configuration files. (cherry picked from commit 8440a27da5df8422940d98988dbd433b01fc843b) Co-authored-by: Lamberto Basti --- .github/workflows/build.yml | 4 +++ .github/workflows/publish-release.yml | 6 ++-- .github/workflows/publish-snapshot.yml | 6 ++-- .github/workflows/test.yml | 36 ++++++++++--------- build.gradle.kts | 4 +-- .../gradle/ConfigurePublishPlugin.kt | 8 +++-- 6 files changed, 39 insertions(+), 25 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 531b282a..713db52c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -20,3 +20,7 @@ jobs: run: ./gradlew :plugin:buildShadowPlugin env: GRADLE_ENTERPRISE_KEY: ${{ secrets.GRADLE_ENTERPRISE_KEY }} + SPACE_INTELLIJ_NIGHTLIES_TOKEN: ${{ secrets.SPACE_INTELLIJ_NIGHTLIES_TOKEN }} + SPACE_INTELLIJ_NIGHTLIES_USERNAME: ${{ secrets.SPACE_INTELLIJ_NIGHTLIES_USERNAME }} + SPACE_PACKAGE_SEARCH_TOKEN: ${{ secrets.SPACE_PACKAGE_SEARCH_TOKEN }} + SPACE_PACKAGE_SEARCH_USERNAME: ${{ secrets.SPACE_PACKAGE_SEARCH_USERNAME }} diff --git a/.github/workflows/publish-release.yml b/.github/workflows/publish-release.yml index 546705c2..039baf87 100644 --- a/.github/workflows/publish-release.yml +++ b/.github/workflows/publish-release.yml @@ -23,8 +23,10 @@ jobs: env: MARKETPLACE_TOKEN: ${{ secrets.MARKETPLACE_TOKEN }} GRADLE_ENTERPRISE_KEY: ${{ secrets.GRADLE_ENTERPRISE_KEY }} - MAVEN_SPACE_PASSWORD: ${{ secrets.MAVEN_SPACE_PASSWORD }} - MAVEN_SPACE_USERNAME: ${{ secrets.MAVEN_SPACE_USERNAME }} + SPACE_INTELLIJ_NIGHTLIES_TOKEN: ${{ secrets.SPACE_INTELLIJ_NIGHTLIES_TOKEN }} + SPACE_INTELLIJ_NIGHTLIES_USERNAME: ${{ secrets.SPACE_INTELLIJ_NIGHTLIES_USERNAME }} + SPACE_PACKAGE_SEARCH_TOKEN: ${{ secrets.SPACE_PACKAGE_SEARCH_TOKEN }} + SPACE_PACKAGE_SEARCH_USERNAME: ${{ secrets.SPACE_PACKAGE_SEARCH_USERNAME }} CHANGE_NOTES: ${{ github.event.release.body }} - name: Run :publishStablePluginToTBE task run: ./gradlew :plugin:publishReleasePluginToTBE diff --git a/.github/workflows/publish-snapshot.yml b/.github/workflows/publish-snapshot.yml index 63a91318..22402283 100644 --- a/.github/workflows/publish-snapshot.yml +++ b/.github/workflows/publish-snapshot.yml @@ -24,8 +24,10 @@ jobs: env: TOOLBOX_ENTERPRISE_TOKEN: ${{ secrets.TOOLBOX_ENTERPRISE_TOKEN }} GRADLE_ENTERPRISE_KEY: ${{ secrets.GRADLE_ENTERPRISE_KEY }} - MAVEN_SPACE_PASSWORD: ${{ secrets.MAVEN_SPACE_PASSWORD }} - MAVEN_SPACE_USERNAME: ${{ secrets.MAVEN_SPACE_USERNAME }} + SPACE_INTELLIJ_NIGHTLIES_TOKEN: ${{ secrets.SPACE_INTELLIJ_NIGHTLIES_TOKEN }} + SPACE_INTELLIJ_NIGHTLIES_USERNAME: ${{ secrets.SPACE_INTELLIJ_NIGHTLIES_USERNAME }} + SPACE_PACKAGE_SEARCH_TOKEN: ${{ secrets.SPACE_PACKAGE_SEARCH_TOKEN }} + SPACE_PACKAGE_SEARCH_USERNAME: ${{ secrets.SPACE_PACKAGE_SEARCH_USERNAME }} RUN_NUMBER: ${{ github.run_number }} RUN_ATTEMPT: ${{ github.run_attempt }} KMP: true diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 2f684074..ef0fc79b 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -3,7 +3,6 @@ name: Run tests on: pull_request: branches: [ releases/233 ] - jobs: gradle: strategy: @@ -13,9 +12,6 @@ jobs: gradle-version: [ '5.6.4', '6.9.2', '7.6.4', '8.6' ] name: Gradle ${{ matrix.gradle-version }} on ${{ matrix.os }} runs-on: ${{ matrix.os }} - env: - MAVEN_SPACE_PASSWORD: ${{ secrets.MAVEN_SPACE_PASSWORD }} - MAVEN_SPACE_USERNAME: ${{ secrets.MAVEN_SPACE_USERNAME }} outputs: result: ${{ steps.final_step.outputs.result }} steps: @@ -34,6 +30,10 @@ jobs: GRADLE_VERSION: ${{ matrix.gradle-version }} GRADLE_ENTERPRISE_KEY: ${{ secrets.GRADLE_ENTERPRISE_KEY }} JAVA_VERSION: ${{matrix.jdk-version}} + SPACE_INTELLIJ_NIGHTLIES_TOKEN: ${{ secrets.SPACE_INTELLIJ_NIGHTLIES_TOKEN }} + SPACE_INTELLIJ_NIGHTLIES_USERNAME: ${{ secrets.SPACE_INTELLIJ_NIGHTLIES_USERNAME }} + SPACE_PACKAGE_SEARCH_TOKEN: ${{ secrets.SPACE_PACKAGE_SEARCH_TOKEN }} + SPACE_PACKAGE_SEARCH_USERNAME: ${{ secrets.SPACE_PACKAGE_SEARCH_USERNAME }} run: ./gradlew :plugin:test --continue --tests "com.jetbrains.packagesearch.plugin.tests.end2end.projectservice.GradleProjectTest" - name: Upload test result if: always() @@ -48,9 +48,6 @@ jobs: os: [ ubuntu-latest, macos-latest, windows-latest ] name: Maven on ${{ matrix.os }} runs-on: ${{ matrix.os }} - env: - MAVEN_SPACE_PASSWORD: ${{ secrets.MAVEN_SPACE_PASSWORD }} - MAVEN_SPACE_USERNAME: ${{ secrets.MAVEN_SPACE_USERNAME }} steps: - uses: actions/checkout@v4 with: @@ -66,6 +63,10 @@ jobs: KMP: true GRADLE_ENTERPRISE_KEY: ${{ secrets.GRADLE_ENTERPRISE_KEY }} JAVA_VERSION: ${{matrix.jdk-version}} + SPACE_INTELLIJ_NIGHTLIES_TOKEN: ${{ secrets.SPACE_INTELLIJ_NIGHTLIES_TOKEN }} + SPACE_INTELLIJ_NIGHTLIES_USERNAME: ${{ secrets.SPACE_INTELLIJ_NIGHTLIES_USERNAME }} + SPACE_PACKAGE_SEARCH_TOKEN: ${{ secrets.SPACE_PACKAGE_SEARCH_TOKEN }} + SPACE_PACKAGE_SEARCH_USERNAME: ${{ secrets.SPACE_PACKAGE_SEARCH_USERNAME }} run: ./gradlew :plugin:test --continue --tests "com.jetbrains.packagesearch.plugin.tests.end2end.projectservice.MavenProjectTest" - name: Upload test result if: always() @@ -81,9 +82,6 @@ jobs: gradle-version: [ '6.9.2', '7.6.4', '8.6' ] name: KMP ${{ matrix.gradle-version }} runs-on: ${{ matrix.os }} - env: - MAVEN_SPACE_PASSWORD: ${{ secrets.MAVEN_SPACE_PASSWORD }} - MAVEN_SPACE_USERNAME: ${{ secrets.MAVEN_SPACE_USERNAME }} outputs: result: ${{ steps.final_step.outputs.result }} steps: @@ -102,6 +100,10 @@ jobs: GRADLE_VERSION: ${{ matrix.gradle-version }} GRADLE_ENTERPRISE_KEY: ${{ secrets.GRADLE_ENTERPRISE_KEY }} JAVA_VERSION: ${{matrix.jdk-version}} + SPACE_INTELLIJ_NIGHTLIES_TOKEN: ${{ secrets.SPACE_INTELLIJ_NIGHTLIES_TOKEN }} + SPACE_INTELLIJ_NIGHTLIES_USERNAME: ${{ secrets.SPACE_INTELLIJ_NIGHTLIES_USERNAME }} + SPACE_PACKAGE_SEARCH_TOKEN: ${{ secrets.SPACE_PACKAGE_SEARCH_TOKEN }} + SPACE_PACKAGE_SEARCH_USERNAME: ${{ secrets.SPACE_PACKAGE_SEARCH_USERNAME }} run: ./gradlew :plugin:test --continue --tests "com.jetbrains.packagesearch.plugin.tests.end2end.projectservice.KMPGradleProjectTest" - name: Upload test result if: always() @@ -118,9 +120,6 @@ jobs: gradle-version: [ '7.6.4', '8.6' ] name: Version Catalog ${{ matrix.gradle-version }} on ${{ matrix.os }} runs-on: ${{ matrix.os }} - env: - MAVEN_SPACE_PASSWORD: ${{ secrets.MAVEN_SPACE_PASSWORD }} - MAVEN_SPACE_USERNAME: ${{ secrets.MAVEN_SPACE_USERNAME }} outputs: result: ${{ steps.final_step.outputs.result }} steps: @@ -139,6 +138,10 @@ jobs: GRADLE_VERSION: ${{ matrix.gradle-version }} GRADLE_ENTERPRISE_KEY: ${{ secrets.GRADLE_ENTERPRISE_KEY }} JAVA_VERSION: ${{matrix.jdk-version}} + SPACE_INTELLIJ_NIGHTLIES_TOKEN: ${{ secrets.SPACE_INTELLIJ_NIGHTLIES_TOKEN }} + SPACE_INTELLIJ_NIGHTLIES_USERNAME: ${{ secrets.SPACE_INTELLIJ_NIGHTLIES_USERNAME }} + SPACE_PACKAGE_SEARCH_TOKEN: ${{ secrets.SPACE_PACKAGE_SEARCH_TOKEN }} + SPACE_PACKAGE_SEARCH_USERNAME: ${{ secrets.SPACE_PACKAGE_SEARCH_USERNAME }} run: ./gradlew :plugin:test --continue --tests "com.jetbrains.packagesearch.plugin.tests.end2end.projectservice.CatalogProjectTest" - name: Upload test result if: always() @@ -149,9 +152,6 @@ jobs: unit-tests: name: Unit tests runs-on: ubuntu-latest - env: - MAVEN_SPACE_PASSWORD: ${{ secrets.MAVEN_SPACE_PASSWORD }} - MAVEN_SPACE_USERNAME: ${{ secrets.MAVEN_SPACE_USERNAME }} steps: - uses: actions/checkout@v4 with: @@ -165,4 +165,8 @@ jobs: - name: Run tests env: GRADLE_ENTERPRISE_KEY: ${{ secrets.GRADLE_ENTERPRISE_KEY }} + SPACE_INTELLIJ_NIGHTLIES_TOKEN: ${{ secrets.SPACE_INTELLIJ_NIGHTLIES_TOKEN }} + SPACE_INTELLIJ_NIGHTLIES_USERNAME: ${{ secrets.SPACE_INTELLIJ_NIGHTLIES_USERNAME }} + SPACE_PACKAGE_SEARCH_TOKEN: ${{ secrets.SPACE_PACKAGE_SEARCH_TOKEN }} + SPACE_PACKAGE_SEARCH_USERNAME: ${{ secrets.SPACE_PACKAGE_SEARCH_USERNAME }} run: ./gradlew :plugin:utils:test diff --git a/build.gradle.kts b/build.gradle.kts index 1e228396..08f19a44 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -31,9 +31,9 @@ allprojects { maven("https://cache-redirector.jetbrains.com/intellij-dependencies") maven("https://packages.jetbrains.team/maven/p/ij/intellij-sdk-nightly") { credentials { - username = getenv("MAVEN_SPACE_USERNAME") + username = getenv("SPACE_INTELLIJ_NIGHTLIES_USERNAME") ?: project.extra.getStringOrNull("space.intellij.username") - password = getenv("MAVEN_SPACE_PASSWORD") + password = getenv("SPACE_INTELLIJ_NIGHTLIES_TOKEN") ?: project.extra.getStringOrNull("space.intellij.password") } } diff --git a/buildSrc/src/main/kotlin/org/jetbrains/packagesearch/gradle/ConfigurePublishPlugin.kt b/buildSrc/src/main/kotlin/org/jetbrains/packagesearch/gradle/ConfigurePublishPlugin.kt index 765ce6c0..769fb783 100644 --- a/buildSrc/src/main/kotlin/org/jetbrains/packagesearch/gradle/ConfigurePublishPlugin.kt +++ b/buildSrc/src/main/kotlin/org/jetbrains/packagesearch/gradle/ConfigurePublishPlugin.kt @@ -15,8 +15,8 @@ import org.gradle.api.component.SoftwareComponentFactory import org.gradle.api.file.DuplicatesStrategy import org.gradle.api.internal.component.SoftwareComponentInternal import org.gradle.api.plugins.ExtraPropertiesExtension -import org.gradle.api.publish.PublishingExtension import org.gradle.api.plugins.internal.DefaultAdhocSoftwareComponent +import org.gradle.api.publish.PublishingExtension import org.gradle.api.publish.maven.MavenPublication import org.gradle.api.publish.maven.tasks.PublishToMavenRepository import org.gradle.api.tasks.SourceSetContainer @@ -191,8 +191,10 @@ fun RepositoryHandler.pkgsSpace(project: Project) { name = "Space" setUrl("https://packages.jetbrains.team/maven/p/kpm/public") credentials { - username = System.getenv("MAVEN_SPACE_USERNAME") ?: project.extra.getStringOrNull("space.username") - password = System.getenv("MAVEN_SPACE_PASSWORD") ?: project.extra.getStringOrNull("space.password") + username = System.getenv("SPACE_PACKAGE_SEARCH_TOKEN") + ?: project.extra.getStringOrNull("space.username") + password = System.getenv("SPACE_PACKAGE_SEARCH_USERNAME") + ?: project.extra.getStringOrNull("space.password") } } }