-
Notifications
You must be signed in to change notification settings - Fork 1
51 lines (48 loc) · 1.82 KB
/
publisher.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
42
43
44
45
46
47
48
49
50
51
# A workflow service to setup and publish my plugin.
name: Plugin Publisher
on:
push:
tags:
- '*'
# Allows you to run this workflow manually from the Actions tab.
workflow_dispatch:
# Custom webhook event provided to trigger action execution by network request.
repository_dispatch:
types: [publish]
jobs:
publish:
name: Publication Job
runs-on: ubuntu-latest
if: github.repository == 'Moosphan/component-publisher'
env:
GPG_SECRET_KEY_RING_FILE: ${{ github.workspace }}/secring.gpg
steps:
# Checkout to source code repo.
- name: Checkout
uses: actions/checkout@v2
# Set up java env with specific version and distribution.
- name: Set up JDK-8
uses: actions/setup-java@v2
with:
distribution: 'zulu'
java-version: '11'
# Prepare signing for publication.
- name: Set up signing
run: |
echo "Generate GPG private key file in $GPG_SECRET_KEY_RING_FILE"
echo $GPG_SECRET_KEY_RING_FILE_CONTENT | base64 --decode > $GPG_SECRET_KEY_RING_FILE
echo "GPG private key created succeed."
# Publish plugin into Portal.
- name: Plugin publication
env:
GPG_KEY_ID: ${{ secrets.GPG_KEY_ID }}
GPG_PASSWORD: ${{ secrets.GPG_PASSWORD }}
GRADLE_PUBLISH_KEY: ${{ secrets.GRADLE_PUBLISH_KEY }}
GRADLE_PUBLISH_SECRET: ${{ secrets.GRADLE_PUBLISH_SECRET }}
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
run: |
echo "Start publish plugin on Maven Plugin Portal."
echo "Load secret gpg file: ${{ env.GPG_SECRET_KEY_RING_FILE }}"
echo "The release version is: ${GITHUB_REF_NAME}"
./gradlew clean :publish-plugin:publishPlugins -S --no-daemon