From e968522181a447450c7fe11e75ed60e39b9239f0 Mon Sep 17 00:00:00 2001 From: Jade Carino Date: Mon, 15 Jul 2024 16:23:12 +0100 Subject: [PATCH] Trying Dhruv's latest changes Signed-off-by: Jade Carino --- .github/workflows/build.yaml | 28 ++++++++++++++--- .github/workflows/pr-build.yaml | 36 ++++++++++++++++++++++ dev.galasa.gradle.impl/build.gradle | 4 +-- dev.galasa.plugin.common.impl/build.gradle | 4 +-- dev.galasa.plugin.common.test/build.gradle | 4 +-- dev.galasa.plugin.common/build.gradle | 4 +-- 6 files changed, 67 insertions(+), 13 deletions(-) create mode 100644 .github/workflows/pr-build.yaml diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 684caa5..28a484f 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -2,14 +2,32 @@ name: Main build on: workflow_dispatch: - pull_request: + push: branches: [main] +env: + NAMESPACE: galasa-dev + jobs: + delete-previous-packages: + name: Delete previous versions + runs-on: ubuntu-latest + strategy: + matrix: + name: [galasa-gradle-parent, githash.dev.galasa.githash.gradle.plugin,obr.dev.galasa.obr.gradle.plugin,tests.dev.galasa.tests.gradle.plugin,dev.galasa.gradle.impl,testcatalog.dev.galasa.testcatalog.gradle.plugin,dev.galasa.plugin.common,dev.galasa.plugin.common.impl,dev.galasa.plugin.common.test] + + steps: + - name: Delete previous versions + uses: actions/delete-package-versions@v5 + with: + package-name: 'dev.galasa.${{matrix.name}}' + package-type: 'maven' + build-gradle: name: build and Test Gradle + needs: delete-previous-packages + if: always() runs-on: ubuntu-latest - steps: - name: Checkout Code uses: actions/checkout@v4 @@ -18,7 +36,7 @@ jobs: uses: actions/setup-java@v4 with: java-version: '11' - distribution: 'temurin' + distribution: 'semeru' - name: Setup Gradle uses: gradle/actions/setup-gradle@v3 @@ -33,8 +51,8 @@ jobs: ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.GPG_PASSPHRASE }} run: | gradle check publish --scan \ - -PsourceMaven=https://repo.maven.apache.org/maven2/ \ + -PsourceMaven=https://repo.maven.apache.org/maven2/ \ -PcentralMaven=https://repo.maven.apache.org/maven2/ \ - -PtargetMaven=https://maven.pkg.github.com/galasa-dev/gradle \ + -PtargetMaven=https://maven.pkg.github.com/${{env.NAMESPACE}}/gradle \ -PjacocoEnabled=true \ -PisMainOrRelease=true \ No newline at end of file diff --git a/.github/workflows/pr-build.yaml b/.github/workflows/pr-build.yaml new file mode 100644 index 0000000..36ee7b9 --- /dev/null +++ b/.github/workflows/pr-build.yaml @@ -0,0 +1,36 @@ +name: PR build + +on: + workflow_dispatch: + pull_request: + branches: [main] + +env: + NAMESPACE: galasa-dev + +jobs: + build-gradle: + name: build and Test Gradle + runs-on: ubuntu-latest + + steps: + - name: Checkout Code + uses: actions/checkout@v4 + + - name: Setup JDK + uses: actions/setup-java@v4 + with: + java-version: '11' + distribution: 'semeru' + + - name: Setup Gradle + uses: gradle/actions/setup-gradle@v3 + with: + gradle-version: 6.9.2 + + - name: Test and Build Gradle + run: | + gradle clean build \ + -PsourceMaven=https://repo.maven.apache.org/maven2/ \ + -PcentralMaven=https://repo.maven.apache.org/maven2/ \ + -PtargetMaven=https://maven.pkg.github.com/${{env.NAMESPACE}}/gradle/ \ No newline at end of file diff --git a/dev.galasa.gradle.impl/build.gradle b/dev.galasa.gradle.impl/build.gradle index 08affde..406caa7 100644 --- a/dev.galasa.gradle.impl/build.gradle +++ b/dev.galasa.gradle.impl/build.gradle @@ -154,8 +154,8 @@ publishing { if ("$targetMaven".startsWith('http')) { credentials { - username System.getenv('GITHUB_ACTOR') - password System.getenv('GITHUB_TOKEN') + username System.getenv("GITHUB_ACTOR") + password System.getenv("GITHUB_TOKEN") } } } diff --git a/dev.galasa.plugin.common.impl/build.gradle b/dev.galasa.plugin.common.impl/build.gradle index e40e5e2..c9a7e0d 100644 --- a/dev.galasa.plugin.common.impl/build.gradle +++ b/dev.galasa.plugin.common.impl/build.gradle @@ -102,8 +102,8 @@ publishing { if ("$targetMaven".startsWith('http')) { credentials { - username System.getenv('GITHUB_ACTOR') - password System.getenv('GITHUB_TOKEN') + username System.getenv("GITHUB_ACTOR") + password System.getenv("GITHUB_TOKEN") } } } diff --git a/dev.galasa.plugin.common.test/build.gradle b/dev.galasa.plugin.common.test/build.gradle index 8432eff..7b31e5c 100644 --- a/dev.galasa.plugin.common.test/build.gradle +++ b/dev.galasa.plugin.common.test/build.gradle @@ -102,8 +102,8 @@ publishing { if ("$targetMaven".startsWith('http')) { credentials { - username System.getenv('GITHUB_ACTOR') - password System.getenv('GITHUB_TOKEN') + username System.getenv("GITHUB_ACTOR") + password System.getenv("GITHUB_TOKEN") } } } diff --git a/dev.galasa.plugin.common/build.gradle b/dev.galasa.plugin.common/build.gradle index b0ec584..d9a6c8f 100644 --- a/dev.galasa.plugin.common/build.gradle +++ b/dev.galasa.plugin.common/build.gradle @@ -126,8 +126,8 @@ publishing { if ("$targetMaven".startsWith('http')) { credentials { - username System.getenv('GITHUB_ACTOR') - password System.getenv('GITHUB_TOKEN') + username System.getenv("GITHUB_ACTOR") + password System.getenv("GITHUB_TOKEN") } } }