release-gradle-plugins.yml 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171
  1. # Releases a new minor / major version of gradle plugins from a release branch
  2. name: Release Gradle Plugins
  3. on:
  4. workflow_dispatch:
  5. inputs:
  6. release-branch-name:
  7. description: The release branch to use, e.g. v1.9.x
  8. required: true
  9. version:
  10. # TODO (trask) this is redundant
  11. description: The version of the release, e.g. 1.9.0 (without the "v" prefix)
  12. required: true
  13. jobs:
  14. test:
  15. runs-on: ubuntu-latest
  16. strategy:
  17. matrix:
  18. test-java-version:
  19. - 8
  20. - 11
  21. - 15
  22. steps:
  23. - uses: actions/checkout@v2.3.4
  24. with:
  25. ref: ${{ github.event.inputs.release-branch-name }}
  26. - id: setup-test-java
  27. name: Set up JDK ${{ matrix.test-java-version }} for running tests
  28. uses: actions/setup-java@v2
  29. with:
  30. distribution: adopt
  31. java-version: ${{ matrix.test-java-version }}
  32. - name: Set up JDK 11 for running Gradle
  33. uses: actions/setup-java@v2
  34. with:
  35. distribution: adopt
  36. java-version: 11
  37. - name: Test
  38. uses: gradle/gradle-build-action@v2
  39. with:
  40. arguments: test -PtestJavaVersion=${{ matrix.test-java-version }} -Porg.gradle.java.installations.paths=${{ steps.setup-test-java.outputs.path }} -Porg.gradle.java.installations.auto-download=false
  41. # testLatestDeps is intentionally not included in the release workflows
  42. # because any time a new library version is released to maven central
  43. # it can fail due to test code incompatibility with the new library version,
  44. # or due to slight changes in emitted telemetry
  45. smoke-test:
  46. runs-on: ${{ matrix.os }}
  47. strategy:
  48. matrix:
  49. os:
  50. - windows-latest
  51. - ubuntu-latest
  52. smoke-test-suite:
  53. - jetty
  54. - liberty
  55. - payara
  56. - tomcat
  57. - tomee
  58. - websphere
  59. - wildfly
  60. - other
  61. exclude:
  62. - os: windows-latest
  63. smoke-test-suite: websphere
  64. steps:
  65. - name: Support longpaths
  66. run: git config --system core.longpaths true
  67. if: matrix.os == 'windows-latest'
  68. - uses: actions/checkout@v2.3.4
  69. with:
  70. ref: ${{ github.event.inputs.release-branch-name }}
  71. - name: Set up JDK 11 for running Gradle
  72. uses: actions/setup-java@v2
  73. with:
  74. distribution: adopt
  75. java-version: 11
  76. - name: Test
  77. uses: gradle/gradle-build-action@v2
  78. with:
  79. arguments: ":smoke-tests:test -PsmokeTestSuite=${{ matrix.smoke-test-suite }}"
  80. # muzzle is intentionally not included in the release workflows
  81. # because any time a new library version is released to maven central it can fail,
  82. # and this is not a reason to hold up the release
  83. examples:
  84. runs-on: ubuntu-latest
  85. steps:
  86. - uses: actions/checkout@v2.3.4
  87. with:
  88. ref: ${{ github.event.inputs.release-branch-name }}
  89. - name: Set up JDK 11 for running Gradle
  90. uses: actions/setup-java@v2
  91. with:
  92. distribution: adopt
  93. java-version: 11
  94. - name: Cache Gradle Wrapper
  95. uses: actions/cache@v2
  96. with:
  97. path: ~/.gradle/wrapper
  98. key: ${{ runner.os }}-gradle-wrapper-cache-${{ hashFiles('examples/distro/gradle/wrapper/gradle-wrapper.properties') }}
  99. - name: Local publish of artifacts
  100. uses: gradle/gradle-build-action@v2
  101. with:
  102. # javadoc task fails sporadically fetching https://docs.oracle.com/javase/8/docs/api/
  103. arguments: publishToMavenLocal -x javadoc
  104. - name: Local publish of gradle plugins
  105. uses: gradle/gradle-build-action@v2
  106. with:
  107. # javadoc task fails sporadically fetching https://docs.oracle.com/javase/8/docs/api/
  108. arguments: publishToMavenLocal -x javadoc
  109. build-root-directory: gradle-plugins
  110. - name: Build distro
  111. uses: gradle/gradle-build-action@v2
  112. with:
  113. arguments: build --init-script ../../.github/scripts/local.init.gradle.kts
  114. build-root-directory: examples/distro
  115. - name: Build extension
  116. uses: gradle/gradle-build-action@v2
  117. with:
  118. arguments: build --init-script ../../.github/scripts/local.init.gradle.kts
  119. build-root-directory: examples/extension
  120. - name: Run muzzle check against extension
  121. uses: gradle/gradle-build-action@v2
  122. with:
  123. arguments: muzzle --init-script ../../.github/scripts/local.init.gradle.kts
  124. build-root-directory: examples/extension
  125. cache-read-only: true
  126. release:
  127. needs: [ test, smoke-test, examples ]
  128. runs-on: ubuntu-latest
  129. steps:
  130. - uses: actions/checkout@v2.3.4
  131. with:
  132. ref: ${{ github.event.inputs.release-branch-name }}
  133. - name: Set up JDK 11 for running Gradle
  134. uses: actions/setup-java@v2
  135. with:
  136. distribution: adopt
  137. java-version: 11
  138. - name: Build and publish gradle plugins
  139. uses: gradle/gradle-build-action@v2
  140. env:
  141. SONATYPE_USER: ${{ secrets.SONATYPE_USER }}
  142. SONATYPE_KEY: ${{ secrets.SONATYPE_KEY }}
  143. GRADLE_PUBLISH_KEY: ${{ secrets.GRADLE_PUBLISH_KEY }}
  144. GRADLE_PUBLISH_SECRET: ${{ secrets.GRADLE_PUBLISH_SECRET }}
  145. GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
  146. GPG_PASSWORD: ${{ secrets.GPG_PASSWORD }}
  147. with:
  148. # Don't use publishToSonatype since we don't want to publish the marker artifact
  149. arguments: build publishPlugins publishPluginMavenPublicationToSonatypeRepository closeAndReleaseSonatypeStagingRepository
  150. build-root-directory: gradle-plugins