fix(deps): update all dependencies #831
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
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
release: | |
types: [ published ] | |
jobs: | |
build: | |
runs-on: ubuntu-24.04 | |
strategy: | |
matrix: | |
java: [17] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up JDK | |
uses: actions/setup-java@v4 | |
with: | |
check-latest: true | |
distribution: temurin | |
java-version: ${{ matrix.java }} | |
- uses: actions/cache@v4 | |
env: | |
cache-name: cache-maven-artifacts | |
with: | |
path: ~/.m2/repository | |
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} | |
- name: Build with Maven | |
run: mvn -B -Pintegration verify | |
services: | |
redis: | |
image: redis | |
ports: | |
- 6379:6379 | |
publish: | |
if: (github.event_name == 'push' && contains(github.ref, 'main')) || github.event_name == 'release' | |
runs-on: ubuntu-24.04 | |
needs: build | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/cache@v4 | |
env: | |
cache-name: cache-maven-artifacts | |
with: | |
path: ~/.m2/repository | |
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }} | |
- name: Install XML utils | |
run: sudo apt update && sudo apt install libxml2-utils | |
- name: Set project version | |
run: echo "PROJECT_VERSION=$(xmllint --xpath '/*[local-name()="project"]/*[local-name()="version"]/text()' pom.xml)" >> $GITHUB_ENV | |
# Publish snapshot | |
- name: Set up JDK 17 for publishing a snapshot | |
if: github.event_name == 'push' && endswith(env.PROJECT_VERSION, 'SNAPSHOT') | |
uses: actions/setup-java@v4 | |
with: | |
check-latest: true | |
distribution: temurin | |
java-version: 17 | |
server-id: ossrh-snapshots | |
server-password: MAVEN_PASSWORD | |
server-username: MAVEN_USERNAME | |
- name: Publish snapshot to the Maven Central Repository | |
if: github.event_name == 'push' && endswith(env.PROJECT_VERSION, 'SNAPSHOT') | |
run: mvn -B deploy -P maven-central | |
env: | |
MAVEN_PASSWORD: ${{ secrets.OSSRH_PASSWORD }} | |
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }} | |
# Publish release | |
- name: Set up JDK 17 for publishing a release | |
if: github.event_name == 'release' && !endswith(env.PROJECT_VERSION, 'SNAPSHOT') | |
uses: actions/setup-java@v4 | |
with: | |
gpg-passphrase: MAVEN_GPG_PASSPHRASE | |
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }} | |
check-latest: true | |
distribution: temurin | |
java-version: 17 | |
server-id: ossrh | |
server-password: MAVEN_PASSWORD | |
server-username: MAVEN_USERNAME | |
- name: Publish release to the Maven Central Repository | |
if: github.event_name == 'release' && !endswith(env.PROJECT_VERSION, 'SNAPSHOT') | |
run: mvn -B deploy -Psign,maven-central | |
env: | |
MAVEN_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }} | |
MAVEN_PASSWORD: ${{ secrets.OSSRH_PASSWORD }} | |
MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }} |