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

Extracted maven-periodic-cache-action #480

Merged
merged 1 commit into from Aug 1, 2022
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
14 changes: 2 additions & 12 deletions .github/workflows/maven-build.yml
Expand Up @@ -27,20 +27,10 @@ jobs:
with:
java-version: 8
distribution: 'temurin'
# Since code changes to this project are infrequent, and most commits
# change the pom.xml, we cache by date interval rather than file hash.
- name: Calculate cache interval
run: |
leveler="$(wc -c <<< "$GITHUB_REPOSITORY")"
echo "::set-output name=CACHE_INTERVAL::$(date +%Y)-$(($(($leveler + $(date +%-j))) / 30))"
id: cache-interval
- name: Cache local Maven repository
uses: actions/cache@v3
uses: gantsign/maven-periodic-cache-action@v1
with:
path: |
~/.m2/repository
!~/.m2/repository/com/github/gantsign/maven
key: ${{ runner.os }}-maven-${{ steps.cache-interval.outputs.CACHE_INTERVAL }}
additional-path: '!~/.m2/repository/com/github/gantsign/maven'
- name: Build with Maven
run: .github/scripts/build.sh
env:
Expand Down
16 changes: 2 additions & 14 deletions .github/workflows/maven-deploy.yml
Expand Up @@ -22,22 +22,10 @@ jobs:
java-version: 8
distribution: 'temurin'
gpg-private-key: ${{ secrets.GPG_KEY }}
# Since code changes to this project are infrequent, and most commits
# change the pom.xml, we cache by date interval rather than file hash.
- name: Calculate cache interval
run: |
leveler="$(wc -c <<< "$GITHUB_REPOSITORY")"
echo "::set-output name=CACHE_INTERVAL::$(date +%Y)-$(($(($leveler + $(date +%-j))) / 30))"
id: cache-interval
- name: Cache local Maven repository
uses: actions/cache@v3
uses: gantsign/maven-periodic-cache-action@v1
with:
path: |
~/.m2/repository
!~/.m2/repository/com/github/gantsign/maven
key: ${{ runner.os }}-maven-${{ steps.cache-interval.outputs.CACHE_INTERVAL }}-deploy
restore-keys: |
${{ runner.os }}-maven-${{ steps.cache-interval.outputs.CACHE_INTERVAL }}
additional-path: '!~/.m2/repository/com/github/gantsign/maven'
- name: Deploy with Maven
run: .github/scripts/deploy.sh
env:
Expand Down
16 changes: 2 additions & 14 deletions .github/workflows/release.yml
Expand Up @@ -34,22 +34,10 @@ jobs:
with:
java-version: 8
distribution: 'temurin'
# Since code changes to this project are infrequent, and most commits
# change the pom.xml, we cache by date interval rather than file hash.
- name: Calculate cache interval
run: |
leveler="$(wc -c <<< "$GITHUB_REPOSITORY")"
echo "::set-output name=CACHE_INTERVAL::$(date +%Y)-$(($(($leveler + $(date +%-j))) / 30))"
id: cache-interval
- name: Cache local Maven repository
uses: actions/cache@v3
uses: gantsign/maven-periodic-cache-action@v1
with:
path: |
~/.m2/repository
!~/.m2/repository/com/github/gantsign/maven
key: ${{ runner.os }}-maven-${{ steps.cache-interval.outputs.CACHE_INTERVAL }}-deploy-site
restore-keys: |
${{ runner.os }}-maven-${{ steps.cache-interval.outputs.CACHE_INTERVAL }}
additional-path: '!~/.m2/repository/com/github/gantsign/maven'
- name: Configure Git user
run: >-
git config --global user.name 'John Freeman' &&
Expand Down