Skip to content

Commit cb523bc

Browse files
committed
refactor build configuration and deployment script
1 parent aaa0451 commit cb523bc

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

.github/workflows/deploy-release.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,13 @@ jobs:
1818
distribution: 'temurin'
1919
- name: Grant execute permission
2020
run: chmod +x gradlew
21+
- name: Extract version (strip leading v)
22+
run: echo "VERSION=${GITHUB_REF_NAME#v}" >> $GITHUB_ENV
2123
- name: Deploy to Maven Central
2224
run: ./gradlew deployCentralPortal -Pversion=$VERSION
2325
env:
2426
MVN_GPG_KEY: ${{ secrets.MVN_GPG_KEY }}
2527
MVN_GPG_PASSWORD: ${{ secrets.MVN_GPG_PASSWORD }}
2628
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
2729
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
28-
VERSION: ${{ github.event.release.tag_name }}
30+
VERSION: ${{ env.VERSION }}

build.gradle.kts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,9 @@ deployer {
5858
}
5959
}
6060

61-
localSpec {
62-
release.version = "$version-LOCAL"
63-
}
61+
localSpec()
6462

6563
nexusSpec("snapshot") {
66-
release.version = "$version-SNAPSHOT"
6764
repositoryUrl = "https://central.sonatype.com/repository/maven-snapshots/"
6865
auth {
6966
user = secret("SONATYPE_USERNAME")

0 commit comments

Comments
 (0)