generated from johnsonlee/gradle-kotlin-dsl-template
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
24f3db6
commit 67de01e
Showing
2 changed files
with
73 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
name: Run unit tests | ||
|
||
on: | ||
push: | ||
branches: [ '*' ] | ||
pull_request: | ||
branches: [ '*' ] | ||
|
||
repository_dispatch: | ||
types: [test] | ||
|
||
jobs: | ||
run-unit-test: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Setup Java | ||
uses: actions/setup-java@v2 | ||
with: | ||
distribution: 'adopt' | ||
java-version: '8' | ||
|
||
- name: build | ||
run: ./gradlew check -S --no-daemon |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
name: Publish build to Sonatype | ||
|
||
on: | ||
push: | ||
tags: | ||
- '*' | ||
repository_dispatch: | ||
types: [publish] | ||
|
||
jobs: | ||
publish: | ||
runs-on: ubuntu-latest | ||
if: github.repository == 'johnsonlee/codegen' | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
|
||
- name: Setup Java | ||
uses: actions/setup-java@v2 | ||
with: | ||
distribution: 'adopt' | ||
java-version: '11' | ||
|
||
- name: publish to sonatype | ||
run: | | ||
echo "Release version ${GITHUB_REF/refs\/tags\/v/} ..." | ||
echo "Create GPG private key" | ||
echo $GPG_KEY_ARMOR | base64 --decode > ${GITHUB_WORKSPACE}/secring.gpg | ||
./gradlew clean initializeSonatypeStagingRepository publishToSonatype closeAndReleaseRepository -S --no-daemon \ | ||
-Pversion=${GITHUB_REF/refs\/tags\/v/} \ | ||
-POSSRH_USERNAME=${OSSRH_USERNAME} \ | ||
-POSSRH_PASSWORD=${OSSRH_PASSWORD} \ | ||
-POSSRH_PACKAGE_GROUP=${OSSRH_PACKAGE_GROUP} \ | ||
-Psigning.keyId=${GPG_KEY_ID} \ | ||
-Psigning.password=${GPG_PASSPHRASE} \ | ||
-Psigning.secretKeyRingFile=${GITHUB_WORKSPACE}/secring.gpg | ||
env: | ||
JAVA_OPTS: -Xmx8g -XX:MaxPermSize=1g -XX:MetaspaceSize=1g -Dfile.encoding=UTF-8 | ||
JVM_OPTS: -Xmx8g -XX:MaxPermSize=1g -XX:MetaspaceSize=1g -Dfile.encoding=UTF-8 | ||
GPG_KEY_ARMOR: ${{ secrets.GPG_KEY_ARMOR }} | ||
GPG_KEY_ID: ${{ secrets.GPG_KEY_ID }} | ||
GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} | ||
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }} | ||
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }} | ||
OSSRH_PACKAGE_GROUP: ${{ secrets.OSSRH_PACKAGE_GROUP }} |