Skip to content

Commit

Permalink
Add cache and schedule for ghaction
Browse files Browse the repository at this point in the history
Signed-off-by: Lan Liang <[email protected]>
  • Loading branch information
liangyuanpeng authored and lburgazzoli committed Jun 30, 2023
1 parent 156df8a commit 5c150ac
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
13 changes: 13 additions & 0 deletions .github/workflows/build-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ on:
branches:
- main
workflow_dispatch:
schedule:
- cron: "0 0 * * *"


jobs:
build:
Expand All @@ -39,6 +42,7 @@ jobs:
with:
java-version: 11
distribution: 'temurin'
cache: 'gradle'
- name: Build Project
env:
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
Expand All @@ -50,4 +54,13 @@ jobs:
./gradlew spotlessCheck
./gradlew test
./gradlew currentVersion
- name: Snapshot Project
if: github.event_name != 'schedule'
env:
OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }}
OSSRH_PASSWORD: ${{ secrets.OSSRH_PASSWORD }}
run: |
export TC_USER="$(id -u):$(id -g)"
echo "tc user -> $TC_USER"
./gradlew publishToSonatype -Prelease.forceSnapshot
2 changes: 2 additions & 0 deletions .github/workflows/build-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ on:
- main
workflow_dispatch:


permissions:
contents: read

Expand All @@ -47,6 +48,7 @@ jobs:
with:
java-version: 11
distribution: 'temurin'
cache: 'gradle'
- name: Build Project
run: |
export TC_USER="$(id -u):$(id -g)"
Expand Down

0 comments on commit 5c150ac

Please sign in to comment.