123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171 |
- # Releases a new minor / major version of gradle plugins from a release branch
- name: Release Gradle Plugins
- on:
- workflow_dispatch:
- inputs:
- release-branch-name:
- description: The release branch to use, e.g. v1.9.x
- required: true
- version:
- # TODO (trask) this is redundant
- description: The version of the release, e.g. 1.9.0 (without the "v" prefix)
- required: true
- jobs:
- test:
- runs-on: ubuntu-latest
- strategy:
- matrix:
- test-java-version:
- - 8
- - 11
- - 15
- steps:
- - uses: actions/checkout@v2.3.4
- with:
- ref: ${{ github.event.inputs.release-branch-name }}
- - id: setup-test-java
- name: Set up JDK ${{ matrix.test-java-version }} for running tests
- uses: actions/setup-java@v2
- with:
- distribution: adopt
- java-version: ${{ matrix.test-java-version }}
- - name: Set up JDK 11 for running Gradle
- uses: actions/setup-java@v2
- with:
- distribution: adopt
- java-version: 11
- - name: Test
- uses: gradle/gradle-build-action@v2
- with:
- 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
- # testLatestDeps is intentionally not included in the release workflows
- # because any time a new library version is released to maven central
- # it can fail due to test code incompatibility with the new library version,
- # or due to slight changes in emitted telemetry
- smoke-test:
- runs-on: ${{ matrix.os }}
- strategy:
- matrix:
- os:
- - windows-latest
- - ubuntu-latest
- smoke-test-suite:
- - jetty
- - liberty
- - payara
- - tomcat
- - tomee
- - websphere
- - wildfly
- - other
- exclude:
- - os: windows-latest
- smoke-test-suite: websphere
- steps:
- - name: Support longpaths
- run: git config --system core.longpaths true
- if: matrix.os == 'windows-latest'
- - uses: actions/checkout@v2.3.4
- with:
- ref: ${{ github.event.inputs.release-branch-name }}
- - name: Set up JDK 11 for running Gradle
- uses: actions/setup-java@v2
- with:
- distribution: adopt
- java-version: 11
- - name: Test
- uses: gradle/gradle-build-action@v2
- with:
- arguments: ":smoke-tests:test -PsmokeTestSuite=${{ matrix.smoke-test-suite }}"
- # muzzle is intentionally not included in the release workflows
- # because any time a new library version is released to maven central it can fail,
- # and this is not a reason to hold up the release
- examples:
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@v2.3.4
- with:
- ref: ${{ github.event.inputs.release-branch-name }}
- - name: Set up JDK 11 for running Gradle
- uses: actions/setup-java@v2
- with:
- distribution: adopt
- java-version: 11
- - name: Cache Gradle Wrapper
- uses: actions/cache@v2
- with:
- path: ~/.gradle/wrapper
- key: ${{ runner.os }}-gradle-wrapper-cache-${{ hashFiles('examples/distro/gradle/wrapper/gradle-wrapper.properties') }}
- - name: Local publish of artifacts
- uses: gradle/gradle-build-action@v2
- with:
- # javadoc task fails sporadically fetching https://docs.oracle.com/javase/8/docs/api/
- arguments: publishToMavenLocal -x javadoc
- - name: Local publish of gradle plugins
- uses: gradle/gradle-build-action@v2
- with:
- # javadoc task fails sporadically fetching https://docs.oracle.com/javase/8/docs/api/
- arguments: publishToMavenLocal -x javadoc
- build-root-directory: gradle-plugins
- - name: Build distro
- uses: gradle/gradle-build-action@v2
- with:
- arguments: build --init-script ../../.github/scripts/local.init.gradle.kts
- build-root-directory: examples/distro
- - name: Build extension
- uses: gradle/gradle-build-action@v2
- with:
- arguments: build --init-script ../../.github/scripts/local.init.gradle.kts
- build-root-directory: examples/extension
- - name: Run muzzle check against extension
- uses: gradle/gradle-build-action@v2
- with:
- arguments: muzzle --init-script ../../.github/scripts/local.init.gradle.kts
- build-root-directory: examples/extension
- cache-read-only: true
- release:
- needs: [ test, smoke-test, examples ]
- runs-on: ubuntu-latest
- steps:
- - uses: actions/checkout@v2.3.4
- with:
- ref: ${{ github.event.inputs.release-branch-name }}
- - name: Set up JDK 11 for running Gradle
- uses: actions/setup-java@v2
- with:
- distribution: adopt
- java-version: 11
- - name: Build and publish gradle plugins
- uses: gradle/gradle-build-action@v2
- env:
- SONATYPE_USER: ${{ secrets.SONATYPE_USER }}
- SONATYPE_KEY: ${{ secrets.SONATYPE_KEY }}
- GRADLE_PUBLISH_KEY: ${{ secrets.GRADLE_PUBLISH_KEY }}
- GRADLE_PUBLISH_SECRET: ${{ secrets.GRADLE_PUBLISH_SECRET }}
- GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
- GPG_PASSWORD: ${{ secrets.GPG_PASSWORD }}
- with:
- # Don't use publishToSonatype since we don't want to publish the marker artifact
- arguments: build publishPlugins publishPluginMavenPublicationToSonatypeRepository closeAndReleaseSonatypeStagingRepository
- build-root-directory: gradle-plugins
|