diff --git a/.github/workflows/build-daily.yml b/.github/workflows/build-daily.yml index 40ad73fdeeb3..8b3fd21018d5 100644 --- a/.github/workflows/build-daily.yml +++ b/.github/workflows/build-daily.yml @@ -31,6 +31,44 @@ jobs: markdown-lint-check: uses: ./.github/workflows/reusable-markdown-lint-check.yml + publish-snapshots: + needs: + - common + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0 + + - name: Free disk space + run: .github/scripts/gha-free-disk-space.sh + + - name: Set up JDK for running Gradle + uses: actions/setup-java@dded0888837ed1f317902acf8a20df0ad188d165 # v5.0.0 + with: + distribution: temurin + java-version-file: .java-version + + - name: Setup Gradle + uses: gradle/actions/setup-gradle@4d9f0ba0025fe599b4ebab900eb7f3a1d93ef4c2 # v5.0.0 + + - name: Build and publish artifact snapshots + env: + DEVELOCITY_ACCESS_KEY: ${{ secrets.DEVELOCITY_ACCESS_KEY }} + SONATYPE_USER: ${{ secrets.SONATYPE_USER }} + SONATYPE_KEY: ${{ secrets.SONATYPE_KEY }} + GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }} + GPG_PASSWORD: ${{ secrets.GPG_PASSWORD }} + run: ./gradlew assemble spdxSbom publishToSonatype + + - name: Build and publish gradle plugin snapshots + env: + DEVELOCITY_ACCESS_KEY: ${{ secrets.DEVELOCITY_ACCESS_KEY }} + SONATYPE_USER: ${{ secrets.SONATYPE_USER }} + SONATYPE_KEY: ${{ secrets.SONATYPE_KEY }} + GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }} + GPG_PASSWORD: ${{ secrets.GPG_PASSWORD }} + run: ./gradlew build publishToSonatype + working-directory: gradle-plugins + workflow-notification: permissions: contents: read @@ -40,6 +78,7 @@ jobs: - test-latest-deps - muzzle - link-check + - publish-snapshots if: always() uses: ./.github/workflows/reusable-workflow-notification.yml with: @@ -48,5 +87,6 @@ jobs: needs.common.result == 'success' && needs.test-latest-deps.result == 'success' && needs.muzzle.result == 'success' && - needs.link-check.result == 'success' + needs.link-check.result == 'success' && + needs.publish-snapshots.result == 'success' }} diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a701e9b85a89..47261f932dc4 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -45,44 +45,3 @@ jobs: # release branches are excluded if: "!startsWith(github.ref_name, 'release/')" uses: ./.github/workflows/reusable-markdown-lint-check.yml - - publish-snapshots: - needs: - # intentionally not blocking snapshot publishing on test-latest-deps, muzzle, or link-check - - common - runs-on: ubuntu-latest - # skipping release branches because the versions in those branches are not snapshots - if: github.ref_name == 'main' && github.repository == 'open-telemetry/opentelemetry-java-instrumentation' - steps: - - uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0 - - - name: Free disk space - run: .github/scripts/gha-free-disk-space.sh - - - name: Set up JDK for running Gradle - uses: actions/setup-java@dded0888837ed1f317902acf8a20df0ad188d165 # v5.0.0 - with: - distribution: temurin - java-version-file: .java-version - - - name: Setup Gradle - uses: gradle/actions/setup-gradle@4d9f0ba0025fe599b4ebab900eb7f3a1d93ef4c2 # v5.0.0 - - - name: Build and publish artifact snapshots - env: - DEVELOCITY_ACCESS_KEY: ${{ secrets.DEVELOCITY_ACCESS_KEY }} - SONATYPE_USER: ${{ secrets.SONATYPE_USER }} - SONATYPE_KEY: ${{ secrets.SONATYPE_KEY }} - GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }} - GPG_PASSWORD: ${{ secrets.GPG_PASSWORD }} - run: ./gradlew assemble spdxSbom publishToSonatype - - - name: Build and publish gradle plugin snapshots - env: - DEVELOCITY_ACCESS_KEY: ${{ secrets.DEVELOCITY_ACCESS_KEY }} - SONATYPE_USER: ${{ secrets.SONATYPE_USER }} - SONATYPE_KEY: ${{ secrets.SONATYPE_KEY }} - GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }} - GPG_PASSWORD: ${{ secrets.GPG_PASSWORD }} - run: ./gradlew build publishToSonatype - working-directory: gradle-plugins