123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215 |
- # Releases a new patch version from a release branch
- name: Patch Release Build
- 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.1 (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 }}
- fetch-depth: 0
- - 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: Restore cache
- uses: burrunan/gradle-cache-action@v1.10
- with:
- job-id: jdk${{ matrix.test-java-version }}
- read-only: true
- - name: Cache Gradle Wrapper
- uses: actions/cache@v2
- with:
- path: ~/.gradle/wrapper
- key: ${{ runner.os }}-gradle-wrapper-cache-${{ hashFiles('gradle/wrapper/gradle-wrapper.properties') }}
- - name: Test
- run: ./gradlew 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 }}
- fetch-depth: 0
- - name: Set up JDK 11 for running Gradle
- uses: actions/setup-java@v2
- with:
- distribution: adopt
- java-version: 11
- - name: Restore cache
- uses: burrunan/gradle-cache-action@v1.10
- with:
- job-id: smokeTests
- read-only: true
- - name: Cache Gradle Wrapper
- uses: actions/cache@v2
- with:
- path: ~/.gradle/wrapper
- key: ${{ runner.os }}-gradle-wrapper-cache-${{ hashFiles('gradle/wrapper/gradle-wrapper.properties') }}
- - name: Test
- run: ./gradlew :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 }}
- fetch-depth: 0
- - 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
- # javadoc task fails sporadically fetching https://docs.oracle.com/javase/8/docs/api/
- run: ./gradlew publishToMavenLocal -x javadoc
- - name: Local publish of gradle plugins
- # javadoc task fails sporadically fetching https://docs.oracle.com/javase/8/docs/api/
- run: ../gradlew publishToMavenLocal -x javadoc
- working-directory: gradle-plugins
- - name: Build distro
- run: ./gradlew build --init-script ../../.github/scripts/local.init.gradle.kts
- working-directory: examples/distro
- - name: Build extension
- run: ./gradlew build --init-script ../../.github/scripts/local.init.gradle.kts
- working-directory: examples/extension
- - name: Run muzzle check against extension
- run: ./gradlew muzzle --init-script ../../.github/scripts/local.init.gradle.kts
- working-directory: examples/extension
- release:
- runs-on: ubuntu-latest
- needs: [ test, smoke-test, examples ]
- steps:
- - uses: actions/checkout@v2.3.4
- with:
- ref: ${{ github.event.inputs.release-branch-name }}
- fetch-depth: 0
- - name: Set up JDK 11 for running Gradle
- uses: actions/setup-java@v2
- with:
- distribution: adopt
- java-version: 11
- - name: Build and publish artifacts
- uses: burrunan/gradle-cache-action@v1.10
- with:
- job-id: jdk11
- remote-build-cache-proxy-enabled: false
- arguments: assemble publishToSonatype closeAndReleaseSonatypeStagingRepository
- env:
- SONATYPE_USER: ${{ secrets.SONATYPE_USER }}
- SONATYPE_KEY: ${{ secrets.SONATYPE_KEY }}
- GRGIT_USER: ${{ github.actor }}
- GRGIT_PASS: ${{ secrets.GITHUB_TOKEN }}
- GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
- GPG_PASSWORD: ${{ secrets.GPG_PASSWORD }}
- # TODO (trask) cache gradle wrapper?
- - name: Build and publish gradle plugins
- env:
- GRADLE_PUBLISH_KEY: ${{ secrets.GRADLE_PUBLISH_KEY }}
- GRADLE_PUBLISH_SECRET: ${{ secrets.GRADLE_PUBLISH_SECRET }}
- run: ../gradlew build publishPlugins
- working-directory: gradle-plugins
- - name: Create Release
- id: create_release
- uses: actions/create-release@v1.1.4
- env:
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- with:
- tag_name: v${{ github.event.inputs.version }}
- commitish: ${{ github.event.inputs.release-branch-name }}
- release_name: Release v${{ github.event.inputs.version }}
- draft: true
- prerelease: false
- - name: Upload Release Asset
- id: upload-release-asset
- uses: actions/upload-release-asset@v1.0.2
- env:
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- with:
- upload_url: ${{ steps.create_release.outputs.upload_url }}
- asset_path: javaagent/build/libs/opentelemetry-javaagent-${{ github.event.inputs.version }}.jar
- asset_name: opentelemetry-javaagent.jar
- asset_content_type: application/java-archive
|