-
Notifications
You must be signed in to change notification settings - Fork 333
41 lines (34 loc) · 1.58 KB
/
publish-maven-central.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
40
41
# This is a basic workflow to help you get started with Actions
name: Publish to Maven Central
# Triggers the workflow on manually
on:
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
# Runs a single command using the runners shell
- name: Install gpg secret key
env:
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
run: |
cat <(echo -e "${{ secrets.GPG_SECRET_KEY }}") | gpg --batch --import
gpg --pinentry-mode=loopback --passphrase "$GPG_PASSPHRASE" --export-secret-keys >$HOME/.gnupg/secring.gpg
gpg --list-secret-keys --keyid-format LONG
ls -l $HOME/.gnupg
- name: Publish release
env:
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
SONATYPE_USER: ${{ secrets.SONATYPE_USER }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
run: |
./gradlew --info --stacktrace -Psigning.secretKeyRingFile=$HOME/.gnupg/secring.gpg -Psigning.password="$GPG_PASSPHRASE" -P signing.keyId=${{ secrets.GPG_KEY_ID }} publish
- name: Display next step
run: |
echo "Now go to https://s01.oss.sonatype.org/index.html#stagingRepositories, select the repo, Close it and then Release it"