Skip to content

Commit

Permalink
Fix snapshot release (#364)
Browse files Browse the repository at this point in the history
* Append secrets to existing gradle.properites file to avoid having to print them on cli (which would be redacted but still)
Update snapshot publish

* Ensure that we only deploy snapshot version in automated task.

* Fix action

* Fix action

---------

Co-authored-by: Andreas Rossbacher <[email protected]>
  • Loading branch information
rossbacher and Andreas Rossbacher authored Apr 6, 2023
1 parent 5b39777 commit e23411a
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
14 changes: 10 additions & 4 deletions .github/workflows/deploy_snapshot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,15 @@ jobs:
steps:
- name: Checkout DeepLinkDispatch
uses: actions/checkout@v2
- name: Update gradle.properties
uses: DamianReeves/write-file-action@master
with:
path: gradle.properties
write-mode: append
contents: |
mavenCentralUsername=${{ secrets.NEXUS_USER }}
mavenCentralPassword=${{ secrets.NEXUS_PASSWORD }}
- name: Deploy new snapshot of DeepLinkDispatch
shell: bash
env:
SONATYPE_NEXUS_USERNAME: ${{ secrets.NEXUS_USER }}
SONATYPE_NEXUS_PASSWORD: ${{ secrets.NEXUS_PASSWORD }}
run: ./gradlew uploadArchives
run: ./gradlew -PenforceSnapshotVersion=true publishAllPublicationsToMavenCentral
5 changes: 5 additions & 0 deletions publishing.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ publishing {
}

mavenPublishing {
if (findProperty("enforceSnapshotVersion").toString().toBoolean() && !findProperty("VERSION_NAME").toString().endsWith("-SNAPSHOT")) {
throw new org.gradle.api.tasks.TaskInstantiationException(
"Cannot publish non snapshot version(${findProperty("VERSION_NAME")}) if 'enforceSnapshotVersion' property is set!"
)
}
if (findProperty("doNotSignRelease").toString().toBoolean()) {
println("Skipping release signing")
} else {
Expand Down

0 comments on commit e23411a

Please sign in to comment.