Skip to content

Commit 76c622c

Browse files
authored
Move snapshot publishing to daily build (#7886)
1 parent cb83d7c commit 76c622c

File tree

2 files changed

+53
-41
lines changed

2 files changed

+53
-41
lines changed

.github/workflows/build-daily.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: Build (daily)
2+
3+
on:
4+
schedule:
5+
# daily at 3:24 UTC
6+
- cron: "24 3 * * *"
7+
workflow_dispatch:
8+
9+
permissions:
10+
contents: read
11+
12+
jobs:
13+
link-check:
14+
uses: ./.github/workflows/reusable-link-check.yml
15+
16+
publish-snapshots:
17+
runs-on: ubuntu-24.04
18+
steps:
19+
- uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
20+
21+
- name: Set up Java
22+
uses: actions/setup-java@dded0888837ed1f317902acf8a20df0ad188d165 # v5.0.0
23+
with:
24+
distribution: temurin
25+
java-version: 21
26+
27+
- name: Set up gradle
28+
uses: gradle/actions/setup-gradle@4d9f0ba0025fe599b4ebab900eb7f3a1d93ef4c2 # v5.0.0
29+
30+
- name: Publish to Sonatype
31+
run: ./gradlew assemble publishToSonatype
32+
env:
33+
SONATYPE_USER: ${{ secrets.SONATYPE_USER }}
34+
SONATYPE_KEY: ${{ secrets.SONATYPE_KEY }}
35+
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
36+
GPG_PASSWORD: ${{ secrets.GPG_PASSWORD }}
37+
DEVELOCITY_ACCESS_KEY: ${{ secrets.DEVELOCITY_ACCESS_KEY }}
38+
39+
workflow-notification:
40+
permissions:
41+
contents: read
42+
issues: write
43+
needs:
44+
- link-check
45+
- publish-snapshots
46+
if: always()
47+
uses: ./.github/workflows/reusable-workflow-notification.yml
48+
with:
49+
success: >-
50+
${{
51+
needs.link-check.result == 'success' &&
52+
needs.publish-snapshots.result == 'success'
53+
}}

.github/workflows/build.yml

Lines changed: 0 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -104,47 +104,6 @@ jobs:
104104
if: ${{ !startsWith(github.ref_name, 'release/') }}
105105
uses: ./.github/workflows/reusable-link-check.yml
106106

107-
publish-snapshots:
108-
# the condition is on the steps below instead of here on the job, because skipping the job
109-
# causes the job to show up as canceled in the GitHub UI which prevents the build section from
110-
# collapsing when everything (else) is green
111-
#
112-
# and the name is updated when the steps below are skipped which makes what's happening clearer
113-
# in the GitHub UI
114-
#
115-
# note: the condition below has to be written so that '' is last since it resolves to false
116-
# and so would not short-circuit if used in the second-last position
117-
name: publish-snapshots${{ (github.ref_name != 'main' || github.repository != 'open-telemetry/opentelemetry-java') && ' (skipped)' || '' }}
118-
# intentionally not blocking snapshot publishing on markdown-link-check
119-
needs: build
120-
runs-on: ubuntu-24.04
121-
steps:
122-
- uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0
123-
124-
- id: setup-java
125-
name: Set up Java
126-
uses: actions/setup-java@dded0888837ed1f317902acf8a20df0ad188d165 # v5.0.0
127-
with:
128-
distribution: temurin
129-
java-version: 21
130-
131-
- name: Set up gradle
132-
uses: gradle/actions/setup-gradle@4d9f0ba0025fe599b4ebab900eb7f3a1d93ef4c2 # v5.0.0
133-
# skipping release branches because the versions in those branches are not snapshots
134-
# (also this skips pull requests)
135-
if: ${{ github.ref_name == 'main' && github.repository == 'open-telemetry/opentelemetry-java' }}
136-
- name: Publish to Sonatype
137-
run: ./gradlew assemble publishToSonatype
138-
# skipping release branches because the versions in those branches are not snapshots
139-
# (also this skips pull requests)
140-
if: ${{ github.ref_name == 'main' && github.repository == 'open-telemetry/opentelemetry-java' }}
141-
env:
142-
SONATYPE_USER: ${{ secrets.SONATYPE_USER }}
143-
SONATYPE_KEY: ${{ secrets.SONATYPE_KEY }}
144-
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
145-
GPG_PASSWORD: ${{ secrets.GPG_PASSWORD }}
146-
DEVELOCITY_ACCESS_KEY: ${{ secrets.DEVELOCITY_ACCESS_KEY }}
147-
148107
build-graal:
149108
name: Build GraalVM
150109
runs-on: ubuntu-latest

0 commit comments

Comments
 (0)