Create baseline cache key #18
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build and create release | |
on: | |
push: | |
branches: | |
- "master" | |
jobs: | |
build_oh3: | |
strategy: | |
fail-fast: false | |
matrix: | |
java: [ '11' ] | |
maven: [ '3.9.4' ] | |
os: [ 'ubuntu-latest' ] | |
name: Build OH3 (Java ${{ matrix.java }}, ${{ matrix.os }}) | |
runs-on: ${{ matrix.os }} | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up JDK 11 | |
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: ${{ runner.java }}-maven-${{ hashFiles('**/pom.xml') }} | |
restore-keys: | | |
${{ runner.java }}-maven- | |
${{ runner.java }}-maven-${{ hashFiles('**/pom.xml') }} | |
- name: Downgrade version | |
run: mvn versions:set -DnewVersion=3.4.5-SNAPSHOT | |
- name: Downgrade parent version | |
run: mvn versions:update-parent -DskipResolution=true -DparentVersion=3.4.4 | |
- name: Build | |
run: mvn -P 'oh3' -P 'standalone' --batch-mode -DskipChecks -Doh.java.version=11 clean verify | |
- uses: "marvinpinto/action-automatic-releases@latest" | |
with: | |
repo_token: "${{ secrets.GITHUB_TOKEN }}" | |
automatic_release_tag: "latest_oh3" | |
prerelease: true | |
title: "Latest Build" | |
files: | | |
target/*.jar | |
build_oh4: | |
strategy: | |
fail-fast: false | |
matrix: | |
java: [ '17' ] | |
maven: [ '3.9.4' ] | |
os: [ 'ubuntu-latest' ] | |
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: ${{ runner.java }}-maven-${{ hashFiles('**/pom.xml') }} | |
restore-keys: | | |
${{ runner.java }}-maven- | |
${{ runner.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 |