diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml new file mode 100644 index 00000000..db17432e --- /dev/null +++ b/.github/workflows/build.yaml @@ -0,0 +1,41 @@ +name: Main build + +on: + workflow_dispatch: + pull_request: + branches: [main] + +env: + NAMESPACE: galasa-dev + +jobs: + build-extensions: + name: Build and test Extensions + 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 Extensions using gradle + env: + GITHUB_ACTOR: ${{ github.actor }} + GITHUB_TOKEN: ${{ github.token }} + run: | + gradle -x sign -b galasa-extensions-parent/build.gradle check publish --info \ + -PsourceMaven=https://development.galasa.dev/main/maven-repo/framework \ + -PcentralMaven=https://repo.maven.apache.org/maven2/ \ + -PtargetMaven=https://maven.pkg.github.com/${{env.NAMESPACE}}/extensions/ \ + -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 00000000..d920f641 --- /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-extensions: + name: Build, test and publish Extensions + 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 Extensions using gradle + run: | + gradle -b galasa-extensions-parent/build.gradle clean build --scan \ + -PsourceMaven=https://development.galasa.dev/main/maven-repo/framework \ + -PcentralMaven=https://repo.maven.apache.org/maven2/ \ + -PtargetMaven=https://maven.pkg.github.com/${{env.NAMESPACE}}/extensions/ \ No newline at end of file diff --git a/galasa-extensions-parent/build.gradle b/galasa-extensions-parent/build.gradle index 9df0a73e..3e169cac 100644 --- a/galasa-extensions-parent/build.gradle +++ b/galasa-extensions-parent/build.gradle @@ -2,6 +2,7 @@ plugins { id 'biz.aQute.bnd.builder' version '5.3.0' apply false id 'dev.galasa.githash' version '0.15.0' apply false id 'maven-publish' + // id 'signing' } version = '0.15.0' @@ -13,6 +14,14 @@ task clean { } } +// signing { +// def signingKeyId = findProperty("signingKeyId") +// def signingKey = findProperty("signingKey") +// def signingPassword = findProperty("signingPassword") +// useInMemoryPgpKeys(signingKeyId, signingKey, signingPassword) +// sign publishing.publications +// } + //--------------------------------------------------------------- // We need to gather the release and packaging metadata from each // sub-project, to generate a release.yaml document which can act @@ -201,6 +210,8 @@ publishing { credentials { username System.getenv('MAVENUSERNAME') password System.getenv('MAVENPASSWORD') + // username System.getenv('GITHUB_ACTOR') + // password System.getenv('GITHUB_TOKEN') } } } diff --git a/galasa-extensions-parent/buildSrc/src/main/groovy/galasa.java.gradle b/galasa-extensions-parent/buildSrc/src/main/groovy/galasa.java.gradle index ae46226b..13dd3d00 100644 --- a/galasa-extensions-parent/buildSrc/src/main/groovy/galasa.java.gradle +++ b/galasa-extensions-parent/buildSrc/src/main/groovy/galasa.java.gradle @@ -59,6 +59,10 @@ repositories { } signing { + // def signingKeyId = findProperty("signingKeyId") + // def signingKey = findProperty("signingKey") + // def signingPassword = findProperty("signingPassword") + // useInMemoryPgpKeys(signingKeyId, signingKey, signingPassword) sign publishing.publications } @@ -109,6 +113,8 @@ publishing { credentials { username System.getenv('MAVENUSERNAME') password System.getenv('MAVENPASSWORD') + // username System.getenv('GITHUB_ACTOR') + // password System.getenv('GITHUB_TOKEN') } } }