Skip to content

Commit 43054f2

Browse files
authored
publish artifact with github actions
1 parent 0060c65 commit 43054f2

File tree

3 files changed

+34
-5
lines changed

3 files changed

+34
-5
lines changed

.github/workflows/gradle-ci-build.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,23 @@ name: build
33
on:
44
push:
55
branches:
6-
tags:
6+
- master
7+
- dev
8+
- testing
79
pull_request:
810

911
jobs:
1012
build:
1113
runs-on: ubuntu-latest
1214
steps:
1315
- uses: actions/checkout@v1
14-
- name: Set up JDK 13
16+
- name: Set up JDK 8
1517
uses: actions/setup-java@v1
1618
with:
17-
java-version: 13
19+
java-version: 8
1820

1921
- name: Build with Gradle
2022
uses: eskatos/gradle-command-action@v1
2123
with:
2224
gradle-version: current
23-
arguments: build
25+
arguments: build -PsonatypeUsername=${{secrets.SONATYPE_USERNAME}} -PsonatypePassword=${{secrets.SONATYPE_PASSWORD}}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: publish
2+
3+
on:
4+
release:
5+
types:
6+
- published
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 > secret.gpg
21+
echo "::set-env name=RELEASE_VERSION::${GITHUB_REF:11}"
22+
23+
- name: Publish with Gradle
24+
uses: eskatos/gradle-command-action@v1
25+
with:
26+
gradle-version: current
27+
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: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ java {
1313

1414
group 'io.github.eaxdev'
1515
archivesBaseName = 'jsonresume-validator'
16-
version '0.0.1'
16+
version = System.getenv('RELEASE_VERSION') ?: "0.0.1"
1717

1818
repositories {
1919
mavenCentral()

0 commit comments

Comments
 (0)