Skip to content

Commit 5cb0583

Browse files
authored
Revert PR#18 (#21)
1 parent 7f3d19c commit 5cb0583

File tree

2 files changed

+13
-28
lines changed

2 files changed

+13
-28
lines changed

.github/workflows/release-build.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on:
44
workflow_dispatch:
55
inputs:
66
version:
7-
description: The version to tag the release with, e.g., 1.2.0, 1.2.1-alpha, or 1.2.0.1 for a patch release of the 1.2.0 proto release
7+
description: The version to tag the release with, e.g., 1.2.0, 1.2.1-alpha.1
88
required: true
99

1010
jobs:
@@ -26,14 +26,14 @@ jobs:
2626
remote-build-cache-proxy-enabled: false
2727
arguments: build --stacktrace
2828
properties: |
29-
release.version.prop=${{ github.event.inputs.version }}
29+
release.version=${{ github.event.inputs.version }}
3030
org.gradle.java.installations.paths=${{ steps.setup-java-17.outputs.path }}
3131
- uses: burrunan/[email protected]
3232
with:
3333
remote-build-cache-proxy-enabled: false
3434
arguments: final closeAndReleaseSonatypeStagingRepository --stacktrace
3535
properties: |
36-
release.version.prop=${{ github.event.inputs.version }}
36+
release.version=${{ github.event.inputs.version }}
3737
org.gradle.java.installations.paths=${{ steps.setup-java-17.outputs.path }}
3838
env:
3939
SONATYPE_USER: ${{ secrets.SONATYPE_USER }}

build.gradle.kts

Lines changed: 10 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -14,32 +14,7 @@ plugins {
1414
id("otel.publish-conventions")
1515
}
1616

17-
// Resolve protoVersion and releaseVersion
18-
// If user provides property release.version.prop match against releaseVersionRegex. protoVersion is the semconv matching group (i.e. for release.version.prop=1.3.2.1, protoVersion is 1.3.2). releaseVersion is the value of the release.version.prop.
19-
// Else, set protoVersion and releaseVersion to the most recent git tag.
20-
// The releaseVersion is used to set the nebular release plugin release version. Note, the release.version.prop is used because the nebula release plugin verifies release.version matches semconv.
21-
// The protoVersion is used to download sources from opentelemetry-proto..
22-
var protoVersion = "unknown"
23-
var releaseVersion = "unknown"
24-
if (properties.contains("release.version.prop")) {
25-
val releaseVersionProperty = properties.get("release.version.prop") as String
26-
val matchResult = "^(?<protoversion>([0-9]*)\\.([0-9]*)\\.([0-9]*)).*\$".toRegex().matchEntire(releaseVersionProperty)
27-
if (matchResult == null) {
28-
throw GradleException("Invalid value for release.version.prop")
29-
}
30-
protoVersion = matchResult.groups["protoversion"]?.value as String
31-
releaseVersion = releaseVersionProperty
32-
} else {
33-
protoVersion = NearestVersionLocator(TagStrategy()).locate(release.grgit).any.toString()
34-
releaseVersion = protoVersion
35-
}
36-
logger.lifecycle("proto version: " + protoVersion)
37-
logger.lifecycle("release version: " + releaseVersion)
38-
39-
val protoArchive = file("$buildDir/archives/opentelemetry-proto-$protoVersion.zip")
40-
4117
release {
42-
version = releaseVersion
4318
defaultVersionStrategy = nebula.plugin.release.git.opinion.Strategies.getSNAPSHOT()
4419
}
4520

@@ -90,6 +65,16 @@ protobuf {
9065
}
9166
}
9267

68+
// Proto version is set from -Prelease.version or inferred from the latest tag
69+
var protoVersion = if (properties.contains(
70+
"release.version"
71+
)) {
72+
properties.get("release.version") as String
73+
} else {
74+
NearestVersionLocator(TagStrategy()).locate(release.grgit).any.toString()
75+
}
76+
val protoArchive = file("$buildDir/archives/opentelemetry-proto-$protoVersion.zip")
77+
9378
tasks {
9479
val downloadProtoArchive by registering(Download::class) {
9580
onlyIf { !protoArchive.exists() }

0 commit comments

Comments
 (0)