Skip to content

Commit

Permalink
Cache with base key
Browse files Browse the repository at this point in the history
  • Loading branch information
seime committed Aug 24, 2024
1 parent 6a18c12 commit 0079a26
Showing 1 changed file with 25 additions and 26 deletions.
51 changes: 25 additions & 26 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@ name: Build and create release
on:
push:
branches:
- "master"
- "master"

jobs:

build_oh4:
strategy:
fail-fast: false
Expand All @@ -17,28 +16,28 @@ jobs:
name: Build OH4 (Java ${{ matrix.java }}, ${{ matrix.os }})
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: ${{matrix.java}}
distribution: 'temurin'
- name: Cache local Maven repository
uses: actions/cache@v3
with:
path: ~/.m2/repository
key: ${{ matrix.java }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ matrix.java }}-maven-
${{ matrix.java }}-maven-${{ hashFiles('**/pom.xml') }}
- name: Build
run: mvn -P 'standalone' --batch-mode -DskipChecks -Doh.java.version=17 clean verify
- uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: ${{matrix.java}}
distribution: 'temurin'
- name: Cache local Maven repository
uses: actions/cache@v3
with:
path: ~/.m2/repository
key: ${{ matrix.java }}-maven-
restore-keys: |
${{ matrix.java }}-maven-
${{ matrix.java }}-maven-${{ hashFiles('**/pom.xml') }}
- name: Build
run: mvn -P 'standalone' --batch-mode -DskipChecks -Doh.java.version=17 clean verify

- uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: "latest_oh4"
prerelease: true
title: "Latest Build"
files: |
target/*.jar
- uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: "latest_oh4"
prerelease: true
title: "Latest Build"
files: |
target/*.jar

0 comments on commit 0079a26

Please sign in to comment.