-
Notifications
You must be signed in to change notification settings - Fork 0
39 lines (32 loc) · 1.22 KB
/
publish.yml
File metadata and controls
39 lines (32 loc) · 1.22 KB
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
on:
push:
tags:
- 'v*'
jobs:
publish:
name: Publish to Maven Central
runs-on: ubuntu-latest
environment: production
steps:
- name: Checkout code
run: |
git init
git remote add origin https://github.com/${{ github.repository }}.git
git fetch --depth=1 origin ${{ github.sha }}
git checkout ${{ github.sha }}
- name: Set up JDK 17
uses: ./.github/actions/setup-jdk
- name: Extract version from tag
run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_ENV
- name: Run tests before publishing
run: |
./gradlew :nav-entry-scope-lib:testDebugUnitTest
./gradlew :nav-entry-scope-processor:test
- name: Publish to Maven Central
run: ./gradlew publishAndReleaseToMavenCentral -PPUBLISH_VERSION=${{ env.VERSION }}
env:
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.SONATYPE_USERNAME }}
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.SONATYPE_PASSWORD }}
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.GPG_PRIVATE_KEY }}
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.GPG_PASSPHRASE }}