Skip to content

Commit 2828016

Browse files
authored
Switch from unmaintained actions (#267)
* Switch from unmaintained actions * More related changes around patch releases * Another doc update * Fix branch name
1 parent c52dff0 commit 2828016

File tree

3 files changed

+47
-105
lines changed

3 files changed

+47
-105
lines changed

.github/workflows/patch-release-build.yml

Lines changed: 10 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,13 @@
1-
# Releases a patch by cherrypicking commits into a release branch based on the previous
2-
# release tag.
31
name: Patch Release Build
42
on:
53
workflow_dispatch:
64
inputs:
75
version:
86
description: The version to tag the release with, e.g., 1.2.1, 1.2.2
97
required: true
10-
commits:
11-
description: Comma separated list of commit shas to cherrypick
12-
required: false
138

149
jobs:
10+
# TODO (trask) remove this after 1.13.0 since release branch is now created proactively
1511
prepare-release-branch:
1612
runs-on: ubuntu-latest
1713
outputs:
@@ -153,25 +149,14 @@ jobs:
153149
154150
EOF
155151
156-
- name: Create Release
157-
id: create_release
158-
uses: actions/[email protected]
152+
- name: Create GitHub release
159153
env:
160154
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
161-
with:
162-
tag_name: v${{ github.event.inputs.version }}
163-
release_name: Version ${{ github.event.inputs.version }}
164-
draft: true
165-
prerelease: false
166-
body_path: release-notes.txt
167-
168-
- name: Upload jmx-metrics release asset
169-
id: upload-release-asset-jmx-metrics
170-
uses: actions/[email protected]
171-
env:
172-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
173-
with:
174-
upload_url: ${{ steps.create_release.outputs.upload_url }}
175-
asset_path: jmx-metrics/build/libs/opentelemetry-jmx-metrics-${{ github.event.inputs.version }}.jar
176-
asset_name: opentelemetry-jmx-metrics.jar
177-
asset_content_type: application/java-archive
155+
run: |
156+
cp jmx-metrics/build/libs/opentelemetry-jmx-metrics-${{ github.event.inputs.version }}.jar opentelemetry-jmx-metrics.jar
157+
gh release create --target ${{ github.ref_name }} \
158+
--title "Version ${{ github.event.inputs.version }}" \
159+
--notes-file release-notes.txt \
160+
--discussion-category announcements \
161+
v${{ github.event.inputs.version }} \
162+
opentelemetry-javaagent.jar

.github/workflows/release-build.yml

Lines changed: 16 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -113,25 +113,21 @@ jobs:
113113
114114
EOF
115115
116-
- name: Create Release
117-
id: create_release
118-
uses: actions/[email protected]
116+
- name: Create GitHub release
119117
env:
120118
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
121-
with:
122-
tag_name: v${{ github.event.inputs.version }}
123-
release_name: Version ${{ github.event.inputs.version }}
124-
draft: true
125-
prerelease: false
126-
body_path: release-notes.txt
127-
128-
- name: Upload jmx-metrics release asset
129-
id: upload-release-asset-jmx-metrics
130-
uses: actions/[email protected]
131-
env:
132-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
133-
with:
134-
upload_url: ${{ steps.create_release.outputs.upload_url }}
135-
asset_path: jmx-metrics/build/libs/opentelemetry-jmx-metrics-${{ github.event.inputs.version }}.jar
136-
asset_name: opentelemetry-jmx-metrics.jar
137-
asset_content_type: application/java-archive
119+
run: |
120+
cp jmx-metrics/build/libs/opentelemetry-jmx-metrics-${{ github.event.inputs.version }}.jar opentelemetry-jmx-metrics.jar
121+
gh release create --target ${{ github.ref_name }} \
122+
--title "Version ${{ github.event.inputs.version }}" \
123+
--notes-file release-notes.txt \
124+
--discussion-category announcements \
125+
v${{ github.event.inputs.version }} \
126+
opentelemetry-javaagent.jar
127+
128+
# proactively create release branch so that contributors can suggest patches more easily
129+
- name: Create release branch
130+
run: |
131+
branch_name=$(echo ${{ github.event.inputs.version }} | sed -E 's/([0-9]+)\.([0-9]+)\.0/v\1.\2.x/')
132+
git checkout -b $branch_name
133+
git push origin $branch_name

RELEASING.md

Lines changed: 21 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -15,23 +15,17 @@ next _minor_ release version. This means version `vX.(Y+1).0-SNAPSHOT`.
1515

1616
## Starting the Release
1717

18-
Before making the release, merge a PR to `main` updating the `CHANGELOG.md`. You can use the script
19-
at `buildscripts/draft-change-log-entries.sh` to help create an initial draft. We typically only
20-
include end-user facing changes in the change log.
18+
Before making the release, merge a PR to `main` updating the `CHANGELOG.md`.
19+
You can use the script at `buildscripts/draft-change-log-entries.sh` to help create an initial draft.
20+
Typically only end-user facing changes are included in the change log.
2121

22-
Open the release build workflow in your browser [here](https://github.com/open-telemetry/opentelemetry-java-contrib/actions/workflows/release-build.yml).
22+
Open the [Release workflow](https://github.com/open-telemetry/opentelemetry-java-contrib/actions/workflows/release-build.yml).
2323

24-
You will see a button that says "Run workflow". Press the button, enter the version number you want
25-
to release in the input field that pops up, and then press "Run workflow".
24+
Press the "Run workflow" button, then select the release branch from the dropdown list,
25+
e.g. `v1.9.x`, and click the "Run workflow" button below that.
2626

27-
This triggers the release process, which builds the artifacts, publishes the artifacts, and creates
28-
and pushes a git tag with the version number.
29-
30-
Once the GitHub workflow completes, go to Github
31-
[release page](https://github.com/open-telemetry/opentelemetry-java-instrumentation/releases),
32-
find the draft release created by the release workflow, and
33-
* Select the checkbox for "Create a discussion for this release"
34-
* Press the "Publish release" button
27+
This workflow will publish the artifacts to maven central and will publish a github release with the
28+
javaagent jar attached and release notes based on the change log.
3529

3630
### Notifying other OpenTelemetry projects
3731

@@ -41,55 +35,22 @@ When cutting a new release, the relevant integration tests for components in oth
4135

4236
## Patch Release
4337

44-
All patch releases should include only bug-fixes, and must avoid
45-
adding/modifying the public APIs.
46-
47-
Open the patch release build workflow in your browser [here](https://github.com/open-telemetry/opentelemetry-java-contrib/actions/workflows/patch-release-build.yml).
48-
49-
You will see a button that says "Run workflow". Press the button, enter the version number you want
50-
to release in the input field for version that pops up and the commits you want to cherrypick for the
51-
patch as a comma-separated list. Then, press "Run workflow".
52-
53-
If the commits cannot be cleanly applied to the release branch, for example because it has diverged
54-
too much from main, then the workflow will fail before building. In this case, you will need to
55-
prepare the release branch manually.
56-
57-
This example will assume patching into release branch `v1.2.x` from a git repository with remotes
58-
named `origin` and `upstream`.
59-
60-
```
61-
$ git remote -v
62-
origin [email protected]:username/opentelemetry-java-contrib.git (fetch)
63-
origin [email protected]:username/opentelemetry-java-contrib.git (push)
64-
upstream [email protected]:open-telemetry/opentelemetry-java-contrib.git (fetch)
65-
upstream [email protected]:open-telemetry/opentelemetry-java-contrib.git (push)
66-
```
67-
68-
First, checkout the release branch
69-
70-
```
71-
git fetch upstream v1.2.x
72-
git checkout upstream/v1.2.x
73-
```
38+
All patch releases should include only bug-fixes, and must avoid adding/modifying the public APIs.
7439

75-
Apply cherrypicks manually and commit. It is ok to apply multiple cherrypicks in a single commit.
76-
Use a commit message such as "Manual cherrypick for commits commithash1, commithash2".
40+
In general, patch releases are only made for bug-fixes for the following types of issues:
41+
* Regressions
42+
* Memory leaks
43+
* Deadlocks
7744

78-
After committing the change, push to your fork's branch.
45+
Before making the release:
7946

80-
```
81-
git push origin v1.2.x
82-
```
47+
* Merge PR(s) containing the desired patches to the release branch
48+
* Merge a PR to the release branch updating the `CHANGELOG.md`
8349

84-
Create a PR to have code review and merge this into upstream's release branch. As this was not
85-
applied automatically, we need to do code review to make sure the manual cherrypick is correct.
50+
Open the [Patch release workflow](https://github.com/open-telemetry/opentelemetry-java-contrib/actions/workflows/patch-release-build.yml).
8651

87-
After it is merged, Run the patch release workflow again, but leave the commits input field blank.
88-
The release will be made with the current state of the release branch, which is what you prepared
89-
above.
52+
Press the "Run workflow" button, then select the release branch from the dropdown list,
53+
e.g. `v1.9.x`, and click the "Run workflow" button below that.
9054

91-
Once the GitHub workflow completes, go to Github
92-
[release page](https://github.com/open-telemetry/opentelemetry-java-instrumentation/releases),
93-
find the draft release created by the release workflow, and
94-
* Select the checkbox for "Create a discussion for this release"
95-
* Press the "Publish release" button
55+
This workflow will publish the artifacts to maven central and will publish a github release with
56+
release notes based on the change log.

0 commit comments

Comments
 (0)