Skip to content

Commit 72d6262

Browse files
authored
Merge pull request #2 from bennyhuo/1.8.0
release 1.8.0 with workflow.
2 parents 880478b + 8dbdefd commit 72d6262

File tree

5 files changed

+63
-4
lines changed

5 files changed

+63
-4
lines changed

.github/scripts/publish.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
getProp(){
2+
grep "${1}" gradle.properties | cut -d'=' -f2 | sed 's/\r//'
3+
}
4+
publishVersion=$(getProp VERSION_NAME)
5+
snapshotSuffix='SNAPSHOT'
6+
7+
chmod +x ./gradlew
8+
./gradlew publishAllPublicationsToMavenCentral
9+
if [[ "$publishVersion" != *"$snapshotSuffix"* ]]; then
10+
echo "auto release artifacts of ${publishVersion}"
11+
./gradlew closeAndReleaseRepository
12+
fi

.github/workflows/publish.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
name: Publish
2+
3+
on:
4+
push:
5+
tags:
6+
- '*'
7+
8+
# Allows you to run this workflow manually from the Actions tab
9+
workflow_dispatch:
10+
11+
jobs:
12+
publish:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- name: Check out
16+
uses: actions/checkout@v2
17+
18+
- name: Set up JDK 8
19+
uses: actions/setup-java@v2
20+
with:
21+
distribution: 'zulu'
22+
java-version: '8'
23+
24+
- name: Build & Publish to Maven Central
25+
run: chmod +x .github/scripts/publish.sh && .github/scripts/publish.sh
26+
env:
27+
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.MAVEN_CENTRAL_USERNAME }}
28+
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.MAVEN_CENTRAL_PASSWORD }}
29+
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.SIGNING_IN_MEMORY_KEY }}
30+
ORG_GRADLE_PROJECT_signingInMemoryKeyId: ${{ secrets.SIGNING_IN_MEMORY_KEY_ID }}
31+
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.SIGNING_IN_MEMORY_KEY_PASSWORD }}

.github/workflows/release.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
8+
jobs:
9+
release-on-push:
10+
runs-on: ubuntu-latest
11+
env:
12+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
13+
steps:
14+
- uses: rymndhng/release-on-push-action@master
15+
with:
16+
bump_version_scheme: norelease

Readme.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ It is really useful when you use Kotlin String template as a template to render
102102
```
103103
plugins {
104104
...
105-
id("com.bennyhuo.kotlin.trimindent") version "1.8.0.0"
105+
id("com.bennyhuo.kotlin.trimindent") version "1.8.0"
106106
}
107107
```
108108

@@ -118,13 +118,13 @@ buildscript {
118118
119119
plugins {
120120
...
121-
id("com.bennyhuo.kotlin.trimindent") version "1.8.0.1-SNAPSHOT"
121+
id("com.bennyhuo.kotlin.trimindent") version "1.8.1-SNAPSHOT"
122122
}
123123
```
124124

125125
## Change Log
126126

127-
### 1.8.0.0
127+
### 1.8.0
128128

129129
* Upgrade Kotlin to 1.8.0.
130130

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
kotlin.code.style=official
22

3-
VERSION_NAME=1.8.0.0
3+
VERSION_NAME=1.8.0
44

55
GROUP=com.bennyhuo.kotlin
66

0 commit comments

Comments
 (0)