Skip to content

Commit 9be9beb

Browse files
committed
Remove axios plugin in favor of github tag publishing
1 parent d3886e3 commit 9be9beb

File tree

3 files changed

+51
-96
lines changed

3 files changed

+51
-96
lines changed

.github/workflows/on-release-tag.yml

+42
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
2+
name: Tag & Release Workflow
3+
on:
4+
push:
5+
tags:
6+
- 'v[0-9]+\.[0-9]+\.[0-9]+'
7+
8+
jobs:
9+
release:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v3
13+
14+
- uses: actions/setup-java@v3
15+
with:
16+
java-version: '17'
17+
distribution: 'temurin'
18+
cache: 'gradle'
19+
20+
- name: Get version from tag
21+
id: get-version
22+
shell: bash
23+
run: |
24+
version="${GITHUB_REF_NAME#v}"
25+
regex="^([0-9]+).([0-9]+).([0-9]+)$"
26+
if [[ $version =~ $regex ]]; then
27+
echo "version=${GITHUB_REF_NAME#v}" >> $GITHUB_OUTPUT
28+
else
29+
echo "Version $version is not a valid SemVer"
30+
exit 1
31+
fi
32+
33+
- name: Build
34+
run: ./gradlew -Pversion=${{ steps.get-version.outputs.version }} publishToMavenLocal
35+
36+
- name: Upload release artifacts to Sonatype
37+
env:
38+
SONATYPE_USER: ${{ secrets.SONATYPE_USER }}
39+
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
40+
GPG_KEY: ${{ secrets.GPG_KEY }}
41+
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
42+
run: ./gradlew -Pversion=${{ steps.get-version.outputs.version }} publishToSonatype closeAndReleaseSonatypeStagingRepository

.github/workflows/release.yml

-56
This file was deleted.

build.gradle.kts

+9-40
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,11 @@ plugins {
22
java
33
`maven-publish`
44
signing
5-
id("io.github.gradle-nexus.publish-plugin").version("1.1.0")
6-
id("pl.allegro.tech.build.axion-release").version("1.14.3")
7-
}
8-
9-
scmVersion {
10-
with(tag) {
11-
prefix.set("")
12-
versionSeparator.set("")
13-
}
5+
id("io.github.gradle-nexus.publish-plugin").version("1.3.0")
146
}
157

168
group = "com.github.gavlyukovskiy"
17-
version = scmVersion.version
9+
version = "0.1.0-SNAPSHOT"
1810

1911
val sonatypeUser: String? = project.properties["sonatype_user"]?.toString()
2012
?: System.getenv("SONATYPE_USER")
@@ -52,7 +44,6 @@ subprojects {
5244
java.sourceCompatibility = JavaVersion.VERSION_17
5345

5446
group = rootProject.group
55-
version = rootProject.version
5647

5748
repositories {
5849
mavenCentral()
@@ -86,6 +77,10 @@ subprojects {
8677
artifact(sourceJar.get())
8778
artifact(javadocJar.get())
8879

80+
if (version.toString() == "0.1.0-SNAPSHOT") {
81+
throw IllegalStateException("'-Pversion' must be set")
82+
}
83+
8984
pom {
9085
name.set(project.name)
9186
description.set("Spring Boot integration with p6spy, datasource-proxy and flexy-pool")
@@ -106,6 +101,9 @@ subprojects {
106101
scm {
107102
url.set("https://github.com/gavlyukovskiy/spring-boot-data-source-decorator")
108103
}
104+
issueManagement {
105+
url.set("https://github.com/gavlyukovskiy/spring-boot-data-source-decorator/issues")
106+
}
109107
}
110108
}
111109
}
@@ -127,32 +125,3 @@ subprojects {
127125
}
128126
}
129127
}
130-
131-
tasks {
132-
val releaseCheck by registering {
133-
doLast {
134-
val errors = ArrayList<String>()
135-
if (!project.hasProperty("release.version")) {
136-
errors.add("'-Prelease.version' must be set")
137-
}
138-
if (System.getenv("GITHUB_ACTIONS") != "true") {
139-
if (!project.hasProperty("release.customUsername")) {
140-
errors.add("'-Prelease.customUsername' must be set")
141-
}
142-
if (!project.hasProperty("release.customPassword")) {
143-
errors.add("'-Prelease.customPassword' must be set")
144-
}
145-
}
146-
if (errors.isNotEmpty()) {
147-
throw IllegalStateException(errors.joinToString("\n"))
148-
}
149-
}
150-
}
151-
152-
verifyRelease {
153-
dependsOn(releaseCheck)
154-
subprojects.forEach {
155-
dependsOn(it.tasks.build)
156-
}
157-
}
158-
}

0 commit comments

Comments
 (0)