Skip to content

Commit a747e65

Browse files
OpenTelemetry Java Bottrask
andauthored
Fix release workflow (#365) (#366)
Co-authored-by: Trask Stalnaker <[email protected]>
1 parent c2707aa commit a747e65

File tree

1 file changed

+42
-75
lines changed

1 file changed

+42
-75
lines changed

.github/workflows/release.yml

Lines changed: 42 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -3,38 +3,57 @@ on:
33
workflow_dispatch:
44

55
jobs:
6-
assemble:
7-
uses: ./.github/workflows/reusable-assemble.yml
6+
build:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v3
810

9-
test:
10-
uses: ./.github/workflows/reusable-test.yml
11+
- name: Set up JDK for running Gradle
12+
uses: actions/setup-java@v3
13+
with:
14+
distribution: temurin
15+
java-version: 17
16+
17+
- uses: gradle/gradle-build-action@v2
18+
name: Build
19+
with:
20+
arguments: build
1121

12-
# test-latest-deps is intentionally not included in the release workflows
13-
# because any time a new library version is released to maven central
14-
# it can fail due to test code incompatibility with the new library version,
15-
# or due to slight changes in emitted telemetry
22+
- uses: actions/upload-artifact@v3
23+
name: Save unit test results
24+
if: always()
25+
with:
26+
name: test-results
27+
path: jmx-metrics/build/reports/tests/test
1628

17-
smoke-test:
18-
uses: ./.github/workflows/reusable-smoke-test.yml
29+
integration-test:
30+
runs-on: ubuntu-latest
31+
steps:
32+
- uses: actions/checkout@v3
1933

20-
# muzzle is intentionally not included in the release workflows
21-
# because any time a new library version is released to maven central it can fail,
22-
# and this is not a reason to hold up the release
34+
- name: Set up JDK for running Gradle
35+
uses: actions/setup-java@v3
36+
with:
37+
distribution: temurin
38+
java-version: 17
2339

24-
gradle-plugins:
25-
uses: ./.github/workflows/reusable-gradle-plugins.yml
40+
- uses: gradle/gradle-build-action@v2
41+
name: Integration test
42+
with:
43+
arguments: integrationTest
2644

27-
examples:
28-
uses: ./.github/workflows/reusable-examples.yml
45+
- uses: actions/upload-artifact@v3
46+
name: Save integration test results
47+
if: always()
48+
with:
49+
name: integration-test-results
50+
path: jmx-metrics/build/reports/tests/integrationTest
2951

3052
release:
31-
needs:
32-
- assemble
33-
- test
34-
- smoke-test
35-
- gradle-plugins
36-
- examples
3753
runs-on: ubuntu-latest
54+
needs:
55+
- build
56+
- integration-test
3857
steps:
3958
- run: |
4059
if [[ $GITHUB_REF_NAME != release/* ]]; then
@@ -106,20 +125,6 @@ jobs:
106125
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
107126
GPG_PASSWORD: ${{ secrets.GPG_PASSWORD }}
108127

109-
- name: Build and publish gradle plugins
110-
uses: gradle/gradle-build-action@v2
111-
env:
112-
SONATYPE_USER: ${{ secrets.SONATYPE_USER }}
113-
SONATYPE_KEY: ${{ secrets.SONATYPE_KEY }}
114-
GRADLE_PUBLISH_KEY: ${{ secrets.GRADLE_PUBLISH_KEY }}
115-
GRADLE_PUBLISH_SECRET: ${{ secrets.GRADLE_PUBLISH_SECRET }}
116-
GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
117-
GPG_PASSWORD: ${{ secrets.GPG_PASSWORD }}
118-
with:
119-
# Don't use publishToSonatype since we don't want to publish the marker artifact
120-
arguments: build publishPlugins publishPluginMavenPublicationToSonatypeRepository closeAndReleaseSonatypeStagingRepository
121-
build-root-directory: gradle-plugins
122-
123128
- name: Generate release notes
124129
env:
125130
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -247,41 +252,3 @@ jobs:
247252
--body "$body" \
248253
--head $branch \
249254
--base main
250-
251-
- uses: actions/checkout@v3
252-
with:
253-
repository: opentelemetry-java-bot/opentelemetry-operator
254-
# this is the personal access token used for "git push" below
255-
token: ${{ secrets.BOT_TOKEN }}
256-
257-
- name: Initialize pull request branch
258-
run: |
259-
git remote add upstream https://github.com/open-telemetry/opentelemetry-operator.git
260-
git fetch upstream
261-
git checkout -b update-opentelemetry-javaagent-to-${VERSION} upstream/main
262-
263-
- name: Update version
264-
run: |
265-
echo $VERSION > autoinstrumentation/java/version.txt
266-
267-
- name: Set git user
268-
run: .github/scripts/set-git-user.sh
269-
270-
- name: Create pull request against opentelemetry-operator
271-
env:
272-
# this is the personal access token used for "gh pr create" below
273-
GITHUB_TOKEN: ${{ secrets.BOT_TOKEN }}
274-
run: |
275-
message="Update the javaagent version to $VERSION"
276-
body="Update the javaagent version to \`$VERSION\`."
277-
278-
# gh pr create doesn't have a way to explicitly specify different head and base
279-
# repositories currently, but it will implicitly pick up the head from a different
280-
# repository if you set up a tracking branch
281-
282-
git commit -a -m "$message"
283-
git push --set-upstream origin update-opentelemetry-javaagent-to-${VERSION}
284-
gh pr create --title "$message" \
285-
--body "$body" \
286-
--repo open-telemetry/opentelemetry-operator \
287-
--base main

0 commit comments

Comments
 (0)