Skip to content

Commit e532819

Browse files
committed
add github action for publish
1 parent 29fd791 commit e532819

File tree

2 files changed

+30
-1
lines changed

2 files changed

+30
-1
lines changed
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: publish
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
jobs:
9+
publish:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v1
13+
- name: Set up JDK 8
14+
uses: actions/setup-java@v1
15+
with:
16+
java-version: 8
17+
18+
- name: Prepare to publish
19+
run: |
20+
echo '${{secrets.GPG_KEY_CONTENTS}}' | base64 -d > publish_key.gpg
21+
gpg --quiet --batch --yes --decrypt --passphrase="${{secrets.SECRET_PASSPHRASE}}" \
22+
--output secret.gpg publish_key.gpg
23+
echo "::set-env name=RELEASE_VERSION::${GITHUB_REF:11}"
24+
- name: Publish with Gradle
25+
uses: eskatos/gradle-command-action@v1
26+
with:
27+
gradle-version: current
28+
arguments: test publish -Psigning.secretKeyRingFile=secret.gpg -Psigning.keyId=${{secrets.SIGNING_KEYID}} -Psigning.password=${{secrets.SIGNING_PASSWORD}} -PsonatypeUsername=${{secrets.SONATYPE_USERNAME}} -PsonatypePassword=${{secrets.SONATYPE_PASSWORD}}

build.gradle

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
plugins {
2+
id 'maven'
23
id 'java-library'
34
id 'maven-publish'
45
id 'signing'
@@ -12,7 +13,7 @@ java {
1213
}
1314

1415
group 'io.github.eaxdev'
15-
archivesBaseName = 'JsonSQL4J'
16+
archivesBaseName = 'jsonsql4j'
1617
version = System.getenv('RELEASE_VERSION') ?: "0.0.1"
1718

1819
repositories {

0 commit comments

Comments
 (0)