Skip to content

Commit

Permalink
Merge pull request #10 from mbeddr/arimer-patch-1
Browse files Browse the repository at this point in the history
gradle.yaml: added packaging test step and branch constraints for publication
  • Loading branch information
arimer authored Jul 27, 2023
2 parents 0fe6f74 + 8d42c4c commit ad09cf9
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 8 deletions.
25 changes: 17 additions & 8 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
9 changes: 9 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit ad09cf9

Please sign in to comment.