Skip to content

Commit bbcf0bd

Browse files
committed
release workflow
1 parent c4d4944 commit bbcf0bd

2 files changed

Lines changed: 40 additions & 0 deletions

File tree

.github/workflows/release.yaml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: release
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
9+
publish:
10+
name: publish release
11+
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- name: checkout
16+
uses: actions/checkout@v1
17+
18+
- name: cache
19+
uses: actions/cache@v2
20+
with:
21+
path: |
22+
~/.gradle/caches
23+
~/.gradle/wrapper
24+
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle.kts') }}
25+
restore-keys: |
26+
${{ runner.os }}-gradle-
27+
28+
- name: publish release to bintray
29+
env:
30+
BINTRAY_USER: ${{ secrets.BINTRAY_USER }}
31+
BINTRAY_KEY: ${{ secrets.BINTRAY_KEY }}
32+
run: ./gradlew -PRELEASE publish

build.gradle.kts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,3 +144,11 @@ if (project.hasProperty("SNAPSHOT")) {
144144
}
145145
}
146146
}
147+
148+
if (project.hasProperty("RELEASE")) {
149+
tasks.publish {
150+
onlyIf {
151+
! version.toString().endsWith("SNAPSHOT")
152+
}
153+
}
154+
}

0 commit comments

Comments
 (0)