Skip to content

Commit 27c64d0

Browse files
committed
Publish snapshot tagged artifacts
1 parent 90271c8 commit 27c64d0

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

.github/workflows/build.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,14 @@ jobs:
4444
file: gradle.properties
4545
all: true
4646

47-
- name: Publish to Maven
47+
- name: Publish commit to maven
4848
id: upload
4949
run: ./gradlew publish -PmavenType=snapshots -PcommitHash=${{ env.COMMIT_HASH }} -PmavenUsername=${{ secrets.MAVEN_USER }} -PmavenPassword=${{ secrets.MAVEN_TOKEN }}
5050

51+
- name: Publish snapshot to maven
52+
id: upload
53+
run: ./gradlew publish -PmavenType=snapshots -PcommitHash=SNAPSHOT -PmavenUsername=${{ secrets.MAVEN_USER }} -PmavenPassword=${{ secrets.MAVEN_TOKEN }}
54+
5155
- name: Generate Summary
5256
if: steps.upload.conclusion == 'success'
5357
run: |

build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ publishing {
238238
val mavenUrl = if (project.findProperty("mavenType") == "releases") "https://maven.lambda-client.org/releases" else "https://maven.lambda-client.org/snapshots"
239239

240240
val isSnapshots = publishType == "snapshots"
241-
val isValidCommit = commitHash.matches(Regex("[A-Fa-f0-9]+"))
241+
val isValidCommit = commitHash.matches(Regex("[A-Fa-f0-9]+")) || commitHash == "SNAPSHOT"
242242

243243
if (!isSnapshots && isValidCommit)
244244
println("WARNING: Commit hash for snapshot releases was supplied but the publish type is 'releases'. The commit will be omitted.")

0 commit comments

Comments
 (0)