Skip to content

java: bump com.nimbusds:nimbus-jose-jwt from 9.37.3 to 9.40 in /java #500

java: bump com.nimbusds:nimbus-jose-jwt from 9.37.3 to 9.40 in /java

java: bump com.nimbusds:nimbus-jose-jwt from 9.37.3 to 9.40 in /java #500

Workflow file for this run

name: Java
on:
push:
branches: [ main ]
paths:
- '.github/workflows/java.yml'
- 'java/**'
- 'test-resources/**'
tags-ignore:
- '**'
pull_request:
branches: [ main ]
paths:
- '.github/workflows/java.yml'
- 'java/**'
- 'test-resources/**'
jobs:
build-and-test:
name: Build and Test
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest ]
java-version: [ 8, 11, 17, 20, 21 ]
java-distribution: [ temurin ]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout current branch
uses: actions/checkout@v6
- name: Setup JDK
uses: actions/setup-java@v5
with:
java-version: ${{ matrix.java-version }}
distribution: ${{ matrix.java-distribution }}
cache: 'gradle'
- name: Validate gradle wrapper
uses: gradle/[email protected]
- name: Test
run: cd java && ./gradlew test
set-release-version:
name: Prepare version to tag and release
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main'
steps:
- name: Checkout current branch
uses: actions/checkout@v6
with:
fetch-depth: 2 #we need to make a git diff of the last 2 commits
- name: Get project version
id: get_project_version
run: |
cd java && PROJECT_VERSION=$(./gradlew properties | grep "version:" | awk '{print $2}')
echo "::set-output name=project_version::$PROJECT_VERSION"
- name: Get changed version from last two commits
id: get_changed_version
run: |
CHANGED_VERSION=$(git diff HEAD^ -- ./java/gradle.properties | grep +version= | awk -F "=" '{print $2}')
echo "::set-output name=changed_version::$CHANGED_VERSION"
- name: Print changed version from last two commits
run: echo ${{ steps.get_changed_version.outputs.changed_version }}
outputs:
project_version: ${{ steps.get_project_version.outputs.project_version }}
changed_version: ${{ steps.get_changed_version.outputs.changed_version }}
publish:
name: Publish to Sonatype and Maven Central
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main' && needs.set-release-version.outputs.changed_version != ''
needs: [build-and-test, set-release-version]
steps:
- uses: actions/checkout@v6
- name: Setup JDK
uses: actions/setup-java@v5
with:
java-version: '21'
distribution: 'temurin'
cache: 'gradle'
- name: Validate gradle wrapper
uses: gradle/[email protected]
- name: Publish to Sonatype and Maven Central
run: cd java && ./gradlew publishToSonatype closeAndReleaseSonatypeStagingRepository
env:
SONATYPE_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
SONATYPE_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
SONATYPE_GPG_KEY: ${{ secrets.SONATYPE_GPG_KEY }}
SONATYPE_GPG_PASSPHRASE: ${{ secrets.SONATYPE_GPG_PASSPHRASE }}
create_github_release:
name: Create Github Release
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main' && !contains(needs.set-release-version.outputs.project_version, 'SNAPSHOT')
needs: [publish]
steps:
- name: Create tag
id: create_tag
uses: mathieudutour/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
custom_tag: ${{ needs.set-release-version.outputs.project_version }}
tag_prefix: 'java-v'
- name: Create release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ steps.create_tag.outputs.new_tag }}
generate_release_notes: false