Skip to content

Commit d81241f

Browse files
jack-bergMateusz Rzeszutek
andauthored
Prepare for first release (#15)
* Prepare for first release * Update RELEASING.md Co-authored-by: Mateusz Rzeszutek <[email protected]> --------- Co-authored-by: Mateusz Rzeszutek <[email protected]>
1 parent 6fe70cb commit d81241f

File tree

5 files changed

+120
-20
lines changed

5 files changed

+120
-20
lines changed

.github/workflows/release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ jobs:
2424
- name: Build and publish artifacts
2525
uses: gradle/gradle-build-action@v2
2626
with:
27-
# TODO(jack-berg): add following arguments when confident in release process: closeAndReleaseSonatypeStagingRepository
28-
arguments: assemble publishToSonatype
27+
# TODO(jack-berg): remove closeSonatypeStagingRepository and add closeAndReleaseSonatypeStagingRepository when confident in release process
28+
arguments: assemble publishToSonatype closeSonatypeStagingRepository
2929
env:
3030
SONATYPE_USER: ${{ secrets.SONATYPE_USER }}
3131
SONATYPE_KEY: ${{ secrets.SONATYPE_KEY }}

README.md

Lines changed: 61 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,74 @@
1-
# 🚧 WARNING: Repository currently under construction 🚧
2-
31
# OpenTelemetry Semantic Conventions for Java
2+
[![Continuous Build][ci-image]][ci-url]
43

54
Java code-generation for the [OpenTelemetry Semantic Conventions](https://github.com/open-telemetry/semantic-conventions).
65

6+
## Published released
7+
8+
Published releases are available on maven central.
9+
10+
TODO(jack-berg): insert maven badge indicating latest available release
11+
12+
### Maven
13+
14+
```xml
15+
<project>
16+
<dependencies>
17+
<dependency>
18+
<groupId>io.opentelemetry.semconv</groupId>
19+
<artifactId>opentelemetry-semconv</artifactId>
20+
<version>{{version}}</version>
21+
</dependency>
22+
</dependencies>
23+
</project>
24+
```
25+
26+
### Gradle
27+
28+
```groovy
29+
dependencies {
30+
implementation platform("io.opentelemetry.semconv:opentelemetry-semconv:{{version}}")
31+
}
32+
```
33+
34+
## Requirements
35+
36+
Java 17 or higher is required to build the projects in this repository. The built artifacts can be
37+
used on Java 8 or higher.
38+
739
## Generating semantic conventions
840

9-
Prerequisites:
10-
- Docker
11-
- JDK 17+
41+
Requires docker.
1242

1343
In a shell, execute the following gradle tasks:
1444

1545
```shell
1646
./gradlew generateSemanticConventions --console=plain
1747
./gradlew spotlessApply
1848
```
49+
50+
This will download the version
51+
of [open-telemetry/semantic-conventions](https://github.com/open-telemetry/semantic-conventions)
52+
defined in the `semanticConventionsVersion` variable of [build.gradle.kts](./build.gradle.kts) and
53+
generate semantic conventions classes from the release contents.
54+
55+
## Contributing
56+
57+
Before you start - see OpenTelemetry
58+
general [contributing](https://github.com/open-telemetry/community/blob/main/CONTRIBUTING.md)
59+
requirements and recommendations.
60+
61+
Make sure to review the projects [license](LICENSE) and sign
62+
the [CNCF CLA](https://identity.linuxfoundation.org/projects/cncf). A signed CLA will be enforced by
63+
an automatic check once you submit a PR, but you can also sign it after opening your PR.
64+
65+
This repository is an extension
66+
of [open-telemetry/opentelemetry-java](https://github.com/open-telemetry/opentelemetry-java).
67+
See [opentelemetry-java contributors](https://github.com/open-telemetry/opentelemetry-java#contributing)
68+
for code owners.
69+
70+
[ci-image]: https://github.com/open-telemetry/semantic-conventions-java/workflows/Build/badge.svg
71+
[ci-url]: https://github.com/open-telemetry/semantic-conventions-java/actions?query=workflow%3Abuild+branch%3Amain
72+
73+
TODO(jack-berg): add code coverage badge?
74+
TODO(jack-berg): add maven badge after first release

RELEASING.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# Release Process
2+
3+
Releases are performed in lockstep
4+
with [open-telemetry/semantic-conventions](https://github.com/open-telemetry/semantic-conventions) [releases](https://github.com/open-telemetry/semantic-conventions/releases).
5+
6+
## Preparing a new release
7+
8+
Applies to major, minor and patch releases of `open-telemetry/semantic-conventions`.
9+
10+
* Merge a PR to `main` with the following changes:
11+
* Update the `CHANGELOG.md`
12+
* The heading for the unreleased entries should be `## Unreleased`
13+
* Bump the `semanticConventionsVersion` variable in `build.gradle.kts` to version
14+
of `semantic-conventions` to be released
15+
* Follow the instructions
16+
to [generate the semantic conventions](README.md#generating-semantic-conventions)
17+
* Run
18+
the [Prepare release branch workflow](https://github.com/open-telemetry/semantic-conventions-java/actions/workflows/prepare-release-branch.yml)
19+
* Press the "Run workflow" button, and leave the default branch `main` selected
20+
* Review and merge the two pull requests it creates (one is targeted to the release branch and one
21+
is targeted to `main`)
22+
23+
## Preparing a patch release
24+
25+
TODO(jack-berg): Define process for releasing a patch, which should add a 4th component to
26+
the `semantic-convention` release version, e.g. `v1.21.0.1`
27+
28+
## Making the release
29+
30+
* Run
31+
the [Release workflow](https://github.com/open-telemetry/semantic-conventions-java/actions/workflows/release.yml)
32+
* Press the "Run workflow" button, then select the release branch from the dropdown list,
33+
e.g. `release/v1.21.0`, and click the "Run workflow" button below that.
34+
* This workflow will publish artifacts to maven central and will publish a GitHub release with
35+
release notes based on the change log.
36+
37+
## Credentials
38+
39+
See [opentelemetry-java credentials](https://github.com/open-telemetry/opentelemetry-java/blob/main/RELEASING.md#credentials).

build.gradle.kts

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -25,18 +25,11 @@ var releaseVersion = semanticConventionsVersion + "-alpha"
2525
if (snapshot) {
2626
releaseVersion += "-SNAPSHOT"
2727
}
28-
version = releaseVersion
2928

30-
dependencies {
31-
implementation(platform("io.opentelemetry:opentelemetry-bom:1.29.0"))
32-
implementation("io.opentelemetry:opentelemetry-api")
33-
34-
testImplementation(platform("org.junit:junit-bom:5.10.0"))
35-
testImplementation("org.junit.jupiter:junit-jupiter-api")
36-
testImplementation("org.junit.jupiter:junit-jupiter-engine")
37-
38-
testImplementation(platform("org.assertj:assertj-bom:3.24.2"))
39-
testImplementation("org.assertj:assertj-core")
29+
base {
30+
version = releaseVersion
31+
description = "OpenTelemetry Semantic Conventions generated classes for Java"
32+
archivesName.set("opentelemetry-semconv")
4033
}
4134

4235
nexusPublishing {
@@ -60,6 +53,18 @@ nexusPublishing {
6053
}
6154
}
6255

56+
dependencies {
57+
implementation(platform("io.opentelemetry:opentelemetry-bom:1.29.0"))
58+
implementation("io.opentelemetry:opentelemetry-api")
59+
60+
testImplementation(platform("org.junit:junit-bom:5.10.0"))
61+
testImplementation("org.junit.jupiter:junit-jupiter-api")
62+
testImplementation("org.junit.jupiter:junit-jupiter-engine")
63+
64+
testImplementation(platform("org.assertj:assertj-bom:3.24.2"))
65+
testImplementation("org.assertj:assertj-core")
66+
}
67+
6368
// start - define tasks to download, unzip, and generate from opentelemetry/semantic-conventions
6469
var generatorVersion = "0.18.0"
6570
val semanticConventionsRepoZip = "https://github.com/open-telemetry/semantic-conventions/archive/v$semanticConventionsVersion.zip"

buildSrc/src/main/kotlin/otel.java-conventions.gradle.kts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ tasks {
6565
}
6666

6767
withType<Javadoc>().configureEach {
68-
exclude("io/opentelemetry/**/internal/**")
68+
exclude("io/opentelemetry/semconv/**/internal/**")
6969

7070
with(options as StandardJavadocDocletOptions) {
7171
source = "8"
@@ -86,7 +86,7 @@ tasks {
8686
"Automatic-Module-Name" to "io.opentelemetry.semconv",
8787
"Built-By" to System.getProperty("user.name"),
8888
"Built-JDK" to System.getProperty("java.version"),
89-
"Implementation-Title" to project.name,
89+
"Implementation-Title" to project.base.archivesName,
9090
"Implementation-Version" to project.version)
9191
}
9292
}

0 commit comments

Comments
 (0)