diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml new file mode 100644 index 000000000..6f9f0cddb --- /dev/null +++ b/.github/workflows/build.yaml @@ -0,0 +1,44 @@ +name: Main build + +on: + workflow_dispatch: + pull_request: + branches: [main] + +env: + NAMESPACE: galasa-dev + +jobs: + build-managers: + name: Build and test Managers with 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: Build, Test and Publish Managers + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + ORG_GRADLE_PROJECT_signingKeyId: ${{ secrets.GPG_KEYID }} + ORG_GRADLE_PROJECT_signingKey: ${{ secrets.GPG_KEY }} + ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.GPG_PASSPHRASE }} + run: | + gradle -b galasa-managers-parent/build.gradle check publish --info \ + -Dorg.gradle.jvmargs=-Xmx4096M \ + -PsourceMaven=https://maven.pkg.github.com/${{env.NAMESPACE}}/extensions/ \ + -PcentralMaven=https://repo.maven.apache.org/maven2/ \ + -PtargetMaven=https://maven.pkg.github.com/${{env.NAMESPACE}}/managers/ \ + -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 000000000..73b2c8638 --- /dev/null +++ b/.github/workflows/pr-build.yaml @@ -0,0 +1,37 @@ +name: PR build + +on: + workflow_dispatch: + pull_request: + branches: [main] + +env: + NAMESPACE: galasa-dev + +jobs: + build-managers: + name: Build and test Managers with 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: Build and Test Managers + run: | + gradle -b galasa-managers-parent/build.gradle clean build \ + -Dorg.gradle.jvmargs=-Xmx4096M \ + -PsourceMaven=https://maven.pkg.github.com/${{env.NAMESPACE}}/extensions/ \ + -PcentralMaven=https://repo.maven.apache.org/maven2/ \ + -PtargetMaven=https://maven.pkg.github.com/${{env.NAMESPACE}}/managers/ \ No newline at end of file diff --git a/galasa-managers-parent/build.gradle b/galasa-managers-parent/build.gradle index 0922eb38c..3e1aaa90d 100644 --- a/galasa-managers-parent/build.gradle +++ b/galasa-managers-parent/build.gradle @@ -51,6 +51,10 @@ repositories { } signing { + def signingKeyId = findProperty("signingKeyId") + def signingKey = findProperty("signingKey") + def signingPassword = findProperty("signingPassword") + useInMemoryPgpKeys(signingKeyId, signingKey, signingPassword) sign publishing.publications } @@ -74,8 +78,8 @@ if (jacocoEnabled.toBoolean()) { if ("$targetMaven".startsWith('http')) { credentials { - username System.getenv('MAVENUSERNAME') - password System.getenv('MAVENPASSWORD') + username System.getenv('GITHUB_ACTOR') + password System.getenv('GITHUB_TOKEN') } } } @@ -230,8 +234,8 @@ publishing { if ("$targetMaven".startsWith('http')) { credentials { - username System.getenv('MAVENUSERNAME') - password System.getenv('MAVENPASSWORD') + username System.getenv('GITHUB_ACTOR') + password System.getenv('GITHUB_TOKEN') } } } diff --git a/galasa-managers-parent/buildSrc/src/main/groovy/galasa.java.gradle b/galasa-managers-parent/buildSrc/src/main/groovy/galasa.java.gradle index bda13eac0..bf8be6898 100644 --- a/galasa-managers-parent/buildSrc/src/main/groovy/galasa.java.gradle +++ b/galasa-managers-parent/buildSrc/src/main/groovy/galasa.java.gradle @@ -58,6 +58,10 @@ repositories { } signing { + // def signingKeyId = findProperty("signingKeyId") + // def signingKey = findProperty("signingKey") + // def signingPassword = findProperty("signingPassword") + // useInMemoryPgpKeys(signingKeyId, signingKey, signingPassword) sign publishing.publications } @@ -108,8 +112,8 @@ publishing { if ("$targetMaven".startsWith('http')) { credentials { - username System.getenv('MAVENUSERNAME') - password System.getenv('MAVENPASSWORD') + username System.getenv('GITHUB_ACTOR') + password System.getenv('GITHUB_TOKEN') } } }