-
Notifications
You must be signed in to change notification settings - Fork 260
39 lines (35 loc) · 1.5 KB
/
publish-to-maven.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
name: Publish to Maven Central Repository
on:
push:
# This pipeline will get triggered everytime there is a new tag created.
# It is required
tags: ["*"]
jobs:
publish-to-maven:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
# Setting up JDK 8, this is required to build Feathr
- name: Set up JDK 8
uses: actions/setup-java@v2
with:
java-version: "8"
distribution: "temurin"
server-id: ossrh
server-username: ORG_GRADLE_PROJECT_mavenCentralUsername
server-password: ORG_GRADLE_PROJECT_mavenCentralPassword
gpg-private-key: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
gpg-passphrase: ORG_GRADLE_PROJECT_signingInMemoryKeyPassword
# CI release command defaults to publishSigned
# Sonatype release command defaults to sonaTypeBundleRelease
# Changing env names as documented here - https://vanniktech.github.io/gradle-maven-publish-plugin/central/#secrets
- name: Gradle Build and Publish to Maven central
run: |
./gradlew publish
./gradlew closeAndReleaseRepository
env:
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.MAVEN_GPG_PASSPHRASE }}
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.MAVEN_GPG_PRIVATE_KEY }}
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.SONATYPE_PASSWORD }}
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.SONATYPE_USERNAME }}