Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 52 additions & 0 deletions .github/workflows/publish-snapshot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Publish Snapshot

on:
push:
branches:
- main

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: false

jobs:
publish-snapshot:
name: Publish snapshot to Maven Central
runs-on: ubuntu-latest
Comment thread
runningcode marked this conversation as resolved.
environment: production
steps:
- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6

- name: Setup Gradle
uses: gradle/actions/setup-gradle@0723195856401067f7a2779048b490ace7a47d7c # pin@v4

- name: Set up Java
uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5
Comment thread
BYK marked this conversation as resolved.
with:
distribution: 'temurin'
java-version: '17'

- name: Determine snapshot version
id: version
run: |
VERSION=$(grep "^version = " plugin-build/gradle.properties | cut -d' ' -f3)
echo "snapshot_version=${VERSION}-SNAPSHOT" >> "$GITHUB_OUTPUT"

- name: Publish Gradle Plugin snapshot
working-directory: plugin-build
run: >
../gradlew publishAllPublicationsToMavenCentralSnapshotsRepository
-Pversion=${{ steps.version.outputs.snapshot_version }}
env:
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.OSSRH_USERNAME }}
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.OSSRH_PASSWORD }}

- name: Publish Kotlin Compiler Plugin snapshot
working-directory: sentry-kotlin-compiler-plugin
run: >
../gradlew publishAllPublicationsToMavenCentralSnapshotsRepository
-PVERSION_NAME=${{ steps.version.outputs.snapshot_version }}
env:
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.OSSRH_USERNAME }}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TIL you can do that with env variables 👀

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes to answer your question from a gradle side.

from the gihtub secrets perspective, these are just placeholders. i think unfortunately these variables aren't set. i will ask around tomorrow.

ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.OSSRH_PASSWORD }}
15 changes: 15 additions & 0 deletions plugin-build/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -323,3 +323,18 @@ tasks.withType<ValidatePlugins>().configureEach {
failOnWarning.set(true)
enableStricterValidation.set(true)
}

plugins.withId("com.vanniktech.maven.publish.base") {
configure<PublishingExtension> {
repositories {
maven {
name = "mavenCentralSnapshots"
url = uri("https://central.sonatype.com/repository/maven-snapshots/")
credentials {
username = findProperty("mavenCentralUsername")?.toString()
password = findProperty("mavenCentralPassword")?.toString()
}
}
}
}
}
8 changes: 8 additions & 0 deletions sentry-kotlin-compiler-plugin/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,14 @@ plugins.withId("com.vanniktech.maven.publish.base") {
name = "mavenTestRepo"
url = file("${rootProject.projectDir}/../build/mavenTestRepo").toURI()
}
maven {
name = "mavenCentralSnapshots"
url = uri("https://central.sonatype.com/repository/maven-snapshots/")
credentials {
username = findProperty("mavenCentralUsername")?.toString()
password = findProperty("mavenCentralPassword")?.toString()
}
}
}
}
}
Expand Down
Loading