Skip to content

Commit a037ad6

Browse files
authored
Move snapshot publishing to daily build (#15509)
1 parent d0bdd89 commit a037ad6

File tree

2 files changed

+41
-42
lines changed

2 files changed

+41
-42
lines changed

.github/workflows/build-daily.yml

Lines changed: 41 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,44 @@ jobs:
3131
markdown-lint-check:
3232
uses: ./.github/workflows/reusable-markdown-lint-check.yml
3333

34+
publish-snapshots:
35+
needs:
36+
- common
37+
runs-on: ubuntu-latest
38+
steps:
39+
- uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
40+
41+
- name: Free disk space
42+
run: .github/scripts/gha-free-disk-space.sh
43+
44+
- name: Set up JDK for running Gradle
45+
uses: actions/setup-java@dded0888837ed1f317902acf8a20df0ad188d165 # v5.0.0
46+
with:
47+
distribution: temurin
48+
java-version-file: .java-version
49+
50+
- name: Setup Gradle
51+
uses: gradle/actions/setup-gradle@4d9f0ba0025fe599b4ebab900eb7f3a1d93ef4c2 # v5.0.0
52+
53+
- name: Build and publish artifact snapshots
54+
env:
55+
DEVELOCITY_ACCESS_KEY: ${{ secrets.DEVELOCITY_ACCESS_KEY }}
56+
SONATYPE_USER: ${{ secrets.SONATYPE_USER }}
57+
SONATYPE_KEY: ${{ secrets.SONATYPE_KEY }}
58+
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
59+
GPG_PASSWORD: ${{ secrets.GPG_PASSWORD }}
60+
run: ./gradlew assemble spdxSbom publishToSonatype
61+
62+
- name: Build and publish gradle plugin snapshots
63+
env:
64+
DEVELOCITY_ACCESS_KEY: ${{ secrets.DEVELOCITY_ACCESS_KEY }}
65+
SONATYPE_USER: ${{ secrets.SONATYPE_USER }}
66+
SONATYPE_KEY: ${{ secrets.SONATYPE_KEY }}
67+
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
68+
GPG_PASSWORD: ${{ secrets.GPG_PASSWORD }}
69+
run: ./gradlew build publishToSonatype
70+
working-directory: gradle-plugins
71+
3472
workflow-notification:
3573
permissions:
3674
contents: read
@@ -40,6 +78,7 @@ jobs:
4078
- test-latest-deps
4179
- muzzle
4280
- link-check
81+
- publish-snapshots
4382
if: always()
4483
uses: ./.github/workflows/reusable-workflow-notification.yml
4584
with:
@@ -48,5 +87,6 @@ jobs:
4887
needs.common.result == 'success' &&
4988
needs.test-latest-deps.result == 'success' &&
5089
needs.muzzle.result == 'success' &&
51-
needs.link-check.result == 'success'
90+
needs.link-check.result == 'success' &&
91+
needs.publish-snapshots.result == 'success'
5292
}}

.github/workflows/build.yml

Lines changed: 0 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -45,44 +45,3 @@ jobs:
4545
# release branches are excluded
4646
if: "!startsWith(github.ref_name, 'release/')"
4747
uses: ./.github/workflows/reusable-markdown-lint-check.yml
48-
49-
publish-snapshots:
50-
needs:
51-
# intentionally not blocking snapshot publishing on test-latest-deps, muzzle, or link-check
52-
- common
53-
runs-on: ubuntu-latest
54-
# skipping release branches because the versions in those branches are not snapshots
55-
if: github.ref_name == 'main' && github.repository == 'open-telemetry/opentelemetry-java-instrumentation'
56-
steps:
57-
- uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
58-
59-
- name: Free disk space
60-
run: .github/scripts/gha-free-disk-space.sh
61-
62-
- name: Set up JDK for running Gradle
63-
uses: actions/setup-java@dded0888837ed1f317902acf8a20df0ad188d165 # v5.0.0
64-
with:
65-
distribution: temurin
66-
java-version-file: .java-version
67-
68-
- name: Setup Gradle
69-
uses: gradle/actions/setup-gradle@4d9f0ba0025fe599b4ebab900eb7f3a1d93ef4c2 # v5.0.0
70-
71-
- name: Build and publish artifact snapshots
72-
env:
73-
DEVELOCITY_ACCESS_KEY: ${{ secrets.DEVELOCITY_ACCESS_KEY }}
74-
SONATYPE_USER: ${{ secrets.SONATYPE_USER }}
75-
SONATYPE_KEY: ${{ secrets.SONATYPE_KEY }}
76-
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
77-
GPG_PASSWORD: ${{ secrets.GPG_PASSWORD }}
78-
run: ./gradlew assemble spdxSbom publishToSonatype
79-
80-
- name: Build and publish gradle plugin snapshots
81-
env:
82-
DEVELOCITY_ACCESS_KEY: ${{ secrets.DEVELOCITY_ACCESS_KEY }}
83-
SONATYPE_USER: ${{ secrets.SONATYPE_USER }}
84-
SONATYPE_KEY: ${{ secrets.SONATYPE_KEY }}
85-
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
86-
GPG_PASSWORD: ${{ secrets.GPG_PASSWORD }}
87-
run: ./gradlew build publishToSonatype
88-
working-directory: gradle-plugins

0 commit comments

Comments
 (0)