Skip to content

Commit 5b6ade5

Browse files
committed
Move snapshot publishing to daily build
1 parent f693cc4 commit 5b6ade5

File tree

2 files changed

+42
-42
lines changed

2 files changed

+42
-42
lines changed

.github/workflows/build-daily.yml

Lines changed: 42 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,45 @@ 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+
if: github.ref_name == 'main' && github.repository == 'open-telemetry/opentelemetry-java-instrumentation'
39+
steps:
40+
- uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
41+
42+
- name: Free disk space
43+
run: .github/scripts/gha-free-disk-space.sh
44+
45+
- name: Set up JDK for running Gradle
46+
uses: actions/setup-java@dded0888837ed1f317902acf8a20df0ad188d165 # v5.0.0
47+
with:
48+
distribution: temurin
49+
java-version-file: .java-version
50+
51+
- name: Setup Gradle
52+
uses: gradle/actions/setup-gradle@4d9f0ba0025fe599b4ebab900eb7f3a1d93ef4c2 # v5.0.0
53+
54+
- name: Build and publish artifact snapshots
55+
env:
56+
DEVELOCITY_ACCESS_KEY: ${{ secrets.DEVELOCITY_ACCESS_KEY }}
57+
SONATYPE_USER: ${{ secrets.SONATYPE_USER }}
58+
SONATYPE_KEY: ${{ secrets.SONATYPE_KEY }}
59+
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
60+
GPG_PASSWORD: ${{ secrets.GPG_PASSWORD }}
61+
run: ./gradlew assemble spdxSbom publishToSonatype
62+
63+
- name: Build and publish gradle plugin snapshots
64+
env:
65+
DEVELOCITY_ACCESS_KEY: ${{ secrets.DEVELOCITY_ACCESS_KEY }}
66+
SONATYPE_USER: ${{ secrets.SONATYPE_USER }}
67+
SONATYPE_KEY: ${{ secrets.SONATYPE_KEY }}
68+
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
69+
GPG_PASSWORD: ${{ secrets.GPG_PASSWORD }}
70+
run: ./gradlew build publishToSonatype
71+
working-directory: gradle-plugins
72+
3473
workflow-notification:
3574
permissions:
3675
contents: read
@@ -40,6 +79,7 @@ jobs:
4079
- test-latest-deps
4180
- muzzle
4281
- link-check
82+
- publish-snapshots
4383
if: always()
4484
uses: ./.github/workflows/reusable-workflow-notification.yml
4585
with:
@@ -48,5 +88,6 @@ jobs:
4888
needs.common.result == 'success' &&
4989
needs.test-latest-deps.result == 'success' &&
5090
needs.muzzle.result == 'success' &&
51-
needs.link-check.result == 'success'
91+
needs.link-check.result == 'success' &&
92+
needs.publish-snapshots.result == 'success'
5293
}}

.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)