Skip to content

readd "Cache local Maven repository" with new path #22

readd "Cache local Maven repository" with new path

readd "Cache local Maven repository" with new path #22

name: Snapshot to Maven Central Repository
on:
push:
branches:
- main
workflow_dispatch:
inputs:
debug_enabled:
type: boolean
description: 'Run the build with tmate debugging enabled (https://github.com/marketplace/actions/debugging-with-tmate)'
required: false
default: false
jobs:
publish:
runs-on: ubuntu-latest
if: ${{ !contains(github.event.head_commit.message, '[maven-release-plugin]') }}
strategy:
matrix:
java: [17]
steps:
- uses: actions/checkout@v4
- name: Set up Maven Central Repository
uses: actions/setup-java@v4
with:
java-version: ${{ matrix.java }}
distribution: 'adopt'
server-id: ossrh
server-username: MAVEN_USERNAME
server-password: MAVEN_PASSWORD
- name: Cache local Maven repository
uses: actions/cache@v3
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}

Check failure on line 34 in .github/workflows/maven-snapshot.yml

View workflow run for this annotation

GitHub Actions / Snapshot to Maven Central Repository

Invalid workflow file

The workflow is not valid. .github/workflows/maven-snapshot.yml (Line: 34, Col: 15): Unexpected value 'key' .github/workflows/maven-snapshot.yml (Line: 35, Col: 15): Unexpected value 'restore-keys'
restore-keys: |
${{ runner.os }}-maven-
# Enable tmate debugging of manually-triggered workflows if the input option was provided
- name: Setup tmate session
uses: mxschmitt/action-tmate@v3
if: ${{ github.event_name == 'workflow_dispatch' && inputs.debug_enabled }}
- name: Build, test, verify and publish snapshot
run: mvn -B verify -Djdk.version=${{ matrix.java }}
- name: Publish snapshot
if: ${{ matrix.java == '17' }}
run: mvn -e -X deploy -DskipAnalysis -DskipUT -DskipIT -Djdk.version=${{ matrix.java }}
env:
MAVEN_USERNAME: ${{ secrets.DATAVERSEBOT_SONATYPE_USERNAME }}
MAVEN_PASSWORD: ${{ secrets.DATAVERSEBOT_SONATYPE_TOKEN }}