Skip to content

Commit

Permalink
Merge pull request #2 from bennyhuo/1.8.0
Browse files Browse the repository at this point in the history
release 1.8.0 with workflow.
  • Loading branch information
bennyhuo committed Feb 9, 2023
2 parents 880478b + 8dbdefd commit 72d6262
Show file tree
Hide file tree
Showing 5 changed files with 63 additions and 4 deletions.
12 changes: 12 additions & 0 deletions .github/scripts/publish.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
getProp(){
grep "${1}" gradle.properties | cut -d'=' -f2 | sed 's/\r//'
}
publishVersion=$(getProp VERSION_NAME)
snapshotSuffix='SNAPSHOT'

chmod +x ./gradlew
./gradlew publishAllPublicationsToMavenCentral
if [[ "$publishVersion" != *"$snapshotSuffix"* ]]; then
echo "auto release artifacts of ${publishVersion}"
./gradlew closeAndReleaseRepository
fi
31 changes: 31 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Publish

on:
push:
tags:
- '*'

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Check out
uses: actions/checkout@v2

- name: Set up JDK 8
uses: actions/setup-java@v2
with:
distribution: 'zulu'
java-version: '8'

- name: Build & Publish to Maven Central
run: chmod +x .github/scripts/publish.sh && .github/scripts/publish.sh
env:
ORG_GRADLE_PROJECT_mavenCentralUsername: ${{ secrets.MAVEN_CENTRAL_USERNAME }}
ORG_GRADLE_PROJECT_mavenCentralPassword: ${{ secrets.MAVEN_CENTRAL_PASSWORD }}
ORG_GRADLE_PROJECT_signingInMemoryKey: ${{ secrets.SIGNING_IN_MEMORY_KEY }}
ORG_GRADLE_PROJECT_signingInMemoryKeyId: ${{ secrets.SIGNING_IN_MEMORY_KEY_ID }}
ORG_GRADLE_PROJECT_signingInMemoryKeyPassword: ${{ secrets.SIGNING_IN_MEMORY_KEY_PASSWORD }}
16 changes: 16 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Release

on:
push:
branches:
- master

jobs:
release-on-push:
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: rymndhng/release-on-push-action@master
with:
bump_version_scheme: norelease
6 changes: 3 additions & 3 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ It is really useful when you use Kotlin String template as a template to render
```
plugins {
...
id("com.bennyhuo.kotlin.trimindent") version "1.8.0.0"
id("com.bennyhuo.kotlin.trimindent") version "1.8.0"
}
```

Expand All @@ -118,13 +118,13 @@ buildscript {
plugins {
...
id("com.bennyhuo.kotlin.trimindent") version "1.8.0.1-SNAPSHOT"
id("com.bennyhuo.kotlin.trimindent") version "1.8.1-SNAPSHOT"
}
```

## Change Log

### 1.8.0.0
### 1.8.0

* Upgrade Kotlin to 1.8.0.

Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
kotlin.code.style=official

VERSION_NAME=1.8.0.0
VERSION_NAME=1.8.0

GROUP=com.bennyhuo.kotlin

Expand Down

0 comments on commit 72d6262

Please sign in to comment.