|  | 
| 1 | 1 | name: Release | 
| 2 | 2 | on: | 
| 3 | 3 |   workflow_dispatch: | 
|  | 4 | +    inputs: | 
|  | 5 | +      already-published: | 
|  | 6 | +        description: 'Skip publishing, download artifacts from Maven Central instead' | 
|  | 7 | +        default: false | 
|  | 8 | +        type: boolean | 
| 4 | 9 | 
 | 
| 5 | 10 | permissions: | 
| 6 | 11 |   contents: read | 
| @@ -125,14 +130,31 @@ jobs: | 
| 125 | 130 | 
 | 
| 126 | 131 |       - name: Set up gradle | 
| 127 | 132 |         uses: gradle/actions/setup-gradle@017a9effdb900e5b5b2fddfb590a105619dca3c3 # v4.4.2 | 
|  | 133 | + | 
| 128 | 134 |       - name: Build and publish artifacts | 
|  | 135 | +        if: ${{ !inputs.already-published }} | 
| 129 | 136 |         run: ./gradlew assemble publishToSonatype closeAndReleaseSonatypeStagingRepository | 
| 130 | 137 |         env: | 
| 131 | 138 |           SONATYPE_USER: ${{ secrets.SONATYPE_USER }} | 
| 132 | 139 |           SONATYPE_KEY: ${{ secrets.SONATYPE_KEY }} | 
| 133 | 140 |           GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }} | 
| 134 | 141 |           GPG_PASSWORD: ${{ secrets.GPG_PASSWORD }} | 
| 135 | 142 | 
 | 
|  | 143 | +      - name: Download artifacts from Maven Central (when already published) | 
|  | 144 | +        if: ${{ inputs.already-published }} | 
|  | 145 | +        run: | | 
|  | 146 | +          mkdir -p jmx-metrics/build/libs | 
|  | 147 | +          mkdir -p jmx-scraper/build/libs | 
|  | 148 | +           | 
|  | 149 | +          curl -L -o jmx-metrics/build/libs/opentelemetry-jmx-metrics-$VERSION-alpha.jar \ | 
|  | 150 | +            "https://repo1.maven.org/maven2/io/opentelemetry/contrib/opentelemetry-jmx-metrics/$VERSION-alpha/opentelemetry-jmx-metrics-$VERSION-alpha.jar" | 
|  | 151 | +          curl -L -o jmx-metrics/build/libs/opentelemetry-jmx-metrics-$VERSION-alpha.jar.asc \ | 
|  | 152 | +            "https://repo1.maven.org/maven2/io/opentelemetry/contrib/opentelemetry-jmx-metrics/$VERSION-alpha/opentelemetry-jmx-metrics-$VERSION-alpha.jar.asc" | 
|  | 153 | +          curl -L -o jmx-scraper/build/libs/opentelemetry-jmx-scraper-$VERSION-alpha.jar \ | 
|  | 154 | +            "https://repo1.maven.org/maven2/io/opentelemetry/contrib/opentelemetry-jmx-scraper/$VERSION-alpha/opentelemetry-jmx-scraper-$VERSION-alpha.jar" | 
|  | 155 | +          curl -L -o jmx-scraper/build/libs/opentelemetry-jmx-scraper-$VERSION-alpha.jar.asc \ | 
|  | 156 | +            "https://repo1.maven.org/maven2/io/opentelemetry/contrib/opentelemetry-jmx-scraper/$VERSION-alpha/opentelemetry-jmx-scraper-$VERSION-alpha.jar.asc" | 
|  | 157 | +
 | 
| 136 | 158 |       - name: Generate release notes | 
| 137 | 159 |         env: | 
| 138 | 160 |           GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | 
|  | 
0 commit comments