diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index d40c245..ab7ec0b 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -3,18 +3,27 @@ name: Java CI with Gradle -on: - push: - +on: [push] jobs: - build: - + test-packaging: runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 + - name: Set up JDK 11 + uses: actions/setup-java@v3 + with: + java-version: '11' + distribution: 'adopt' + - name: Test packaging + run: ./gradlew testPackaging + publish: + runs-on: ubuntu-latest + needs: test-packaging + if: github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/mps/') + steps: + - uses: actions/checkout@v3 - name: Set up JDK 11 - uses: actions/setup-java@v2 + uses: actions/setup-java@v3 with: java-version: '11' distribution: 'adopt' diff --git a/build.gradle b/build.gradle index 2aa91cb..43a6e06 100644 --- a/build.gradle +++ b/build.gradle @@ -14,6 +14,15 @@ def mpsDownloadFile = new File(mpsDownloadDir, "MPS-${mpsBuild}.zip") def eapSuffix = (mpsBuild.contains("EAP")) ? " EAP" : "" def mpsUnpackedDir = new File(mpsDownloadDir, "MPS ${mpsMajor}${eapSuffix}") +task testPackaging{ + description "Task triggering all packaging tasks" +} + +testPackaging.dependsOn { + tasks.withType(Jar).findAll {jarTask -> jarTask.name.startsWith('package')} +} + + // Downloads MPS from jetbrains.com into ${mpsDownloadFile} task downloadMPS(type: Download) { doFirst {