generated from y9vad9/kotlin-project-template
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: workflows for running tests on PR and publishing releases (#1)
- Loading branch information
Showing
2 changed files
with
58 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,38 @@ | ||
name: Gradle Publish Release | ||
|
||
on: | ||
release: | ||
types: | ||
- created | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up Java | ||
uses: actions/setup-java@v3 | ||
with: | ||
java-version: '17' | ||
distribution: 'corretto' | ||
|
||
- name: Cache Gradle dependencies | ||
uses: actions/cache@v3 | ||
with: | ||
path: ~/.gradle/caches | ||
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }} | ||
|
||
- name: Set Gradle executable permissions | ||
run: chmod +x ./gradlew | ||
|
||
- name: Build and Publish | ||
env: | ||
LIB_VERSION: ${{ github.ref }} | ||
SSH_DEPLOY_PATH: ${{ secrets.TIMEMATES_SSH_DEPLOY_PATH }} | ||
SSH_HOST: ${{ secrets.TIMEMATES_SSH_HOST }} | ||
SSH_PASSWORD: ${{ secrets.TIMEMATES_SSH_PASSWORD }} | ||
SSH_USER: ${{ secrets.TIMEMATES_SSH_USER }} | ||
run: ./gradlew publish publishPlugins -Pversion=${{ env.LIB_VERSION }} -Pgradle.publish.key=${{ env.GRADLE_PUBLISH_KEY }} -Pgradle.publish.secret=${{ env.GRADLE_PUBLISH_SECRET }} |
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,20 @@ | ||
name: Run tests on PR | ||
|
||
on: | ||
pull_request: | ||
branches: [ "master" ] | ||
release: | ||
types: [ published ] | ||
workflow_dispatch: | ||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-java@v3 | ||
with: | ||
distribution: 'corretto' | ||
java-version: '17' | ||
cache: 'gradle' | ||
- run: ./gradlew test --no-daemon |