-
Notifications
You must be signed in to change notification settings - Fork 214
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: adding workflow for publishing artifacts to maven central
Signed-off-by: Mikhail Laptev <[email protected]>
- Loading branch information
1 parent
5e2a82b
commit 521513b
Showing
2 changed files
with
73 additions
and
0 deletions.
There are no files selected for viewing
54 changes: 54 additions & 0 deletions
54
contrib/cdb2hibernatedialect/.gitub/workflows/publication.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
name: 'Publication' | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
release: | ||
types: [published] | ||
|
||
jobs: | ||
publish: | ||
name: 'Publish' | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 120 | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
submodules: true | ||
- uses: actions/setup-java@v3 | ||
with: | ||
distribution: temurin | ||
java-version: 11 | ||
- name: 'Gradle' | ||
run: | | ||
echo 'org.gradle.caching=false' >> gradle.properties | ||
echo 'org.gradle.configuration-cache=false' >> gradle.properties | ||
- name: 'Build cdb2hibernatedialect' | ||
run: | | ||
./gradlew build | ||
- name: 'Publish snapshot to OSSRH' | ||
if: github.event_name == 'push' | ||
env: | ||
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.GPG_KEY }} | ||
ORG_GRADLE_PROJECT_signingKeyId: ${{ secrets.GPG_KEY_ID }} | ||
ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.GPG_KEY_PASSPHRASE }} | ||
ORG_GRADLE_PROJECT_sonatypePassword: ${{ secrets.OSSRH_PASSWORD }} | ||
ORG_GRADLE_PROJECT_sonatypeUsername: ${{ secrets.OSSRH_USERNAME }} | ||
run: | | ||
./gradlew \ | ||
publishMavenPublicationToSonatypeRepository \ | ||
closeSonatypeStagingRepository | ||
- name: 'Publish release to OSSRH' | ||
if: github.event_name == 'release' && github.event.action == 'published' | ||
env: | ||
ORG_GRADLE_PROJECT_signingKey: ${{ secrets.GPG_KEY }} | ||
ORG_GRADLE_PROJECT_signingKeyId: ${{ secrets.GPG_KEY_ID }} | ||
ORG_GRADLE_PROJECT_signingPassword: ${{ secrets.GPG_KEY_PASSPHRASE }} | ||
ORG_GRADLE_PROJECT_sonatypePassword: ${{ secrets.OSSRH_PASSWORD }} | ||
ORG_GRADLE_PROJECT_sonatypeUsername: ${{ secrets.OSSRH_USERNAME }} | ||
run: | | ||
./gradlew \ | ||
-Prelease \ | ||
publishMavenPublicationToSonatypeRepository \ | ||
closeAndReleaseSonatypeStagingRepository |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters