Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: workflows for running tests on PR and publishing releases #1

Merged
merged 1 commit into from
Nov 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions .github/workflows/publish-release.yml
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 }}
20 changes: 20 additions & 0 deletions .github/workflows/run-test-pr.yml
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