Skip to content

Commit 4e5d058

Browse files
authored
Merge pull request #37 from newrelic/gfuller/publish-git-action
Gfuller/publish git action
2 parents 891c339 + edd7378 commit 4e5d058

File tree

4 files changed

+35
-2
lines changed

4 files changed

+35
-2
lines changed

.github/workflows/publish_main_snapshot.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@ jobs:
2020
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.SIGNING_KEY }}
2121
ORG_GRADLE_PROJECT_signingKeyId: ${{ secrets.SIGNING_KEY_ID }}
2222
ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.SIGNING_PASSWORD }}
23-
run: ./gradlew build publish
23+
run: ./gradlew build publish

.github/workflows/publish_release.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
name: publish release version explicitly
2+
3+
on:
4+
release:
5+
types:
6+
- published
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v2
13+
- name: Set up JDK 11
14+
uses: actions/[email protected]
15+
with:
16+
java-version: 11
17+
- name: Build with Gradle
18+
env:
19+
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
20+
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
21+
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.SIGNING_KEY }}
22+
ORG_GRADLE_PROJECT_signingKeyId: ${{ secrets.SIGNING_KEY_ID }}
23+
ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.SIGNING_PASSWORD }}
24+
run: ./gradlew build publish -Prelease=true

build.gradle

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,15 @@ dependencies {
4848
testImplementation 'io.opentracing:opentracing-mock:0.33.0'
4949
}
5050

51+
// -Prelease=true will render a non-snapshot version
52+
// All other values (including unset) will render a snapshot version.
53+
def release = findProperty("release")
54+
version = project.findProperty("version")
55+
56+
if (!release) {
57+
version += "-SNAPSHOT"
58+
}
59+
5160
jar {
5261
from(projectDir) { include "README.md" }
5362

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
group = com.newrelic.opentracing
2-
version = 2.1.0-SNAPSHOT
2+
version = 2.1.0

0 commit comments

Comments
 (0)