diff --git a/.github/workflows/build-main.yml b/.github/workflows/build-main.yml index 0bfaf36a..bb400e8e 100644 --- a/.github/workflows/build-main.yml +++ b/.github/workflows/build-main.yml @@ -25,6 +25,9 @@ on: branches: - main workflow_dispatch: + schedule: + - cron: "0 0 * * *" + jobs: build: @@ -39,6 +42,7 @@ jobs: with: java-version: 11 distribution: 'temurin' + cache: 'gradle' - name: Build Project env: OSSRH_USERNAME: ${{ secrets.OSSRH_USERNAME }} @@ -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 diff --git a/.github/workflows/build-pr.yml b/.github/workflows/build-pr.yml index 9f7012c7..c70f32c4 100644 --- a/.github/workflows/build-pr.yml +++ b/.github/workflows/build-pr.yml @@ -26,6 +26,7 @@ on: - main workflow_dispatch: + permissions: contents: read @@ -47,6 +48,7 @@ jobs: with: java-version: 11 distribution: 'temurin' + cache: 'gradle' - name: Build Project run: | export TC_USER="$(id -u):$(id -g)"