Skip to content

[java] Bump org.json:json from 20231013 to 20240303 #30

[java] Bump org.json:json from 20231013 to 20240303

[java] Bump org.json:json from 20231013 to 20240303 #30

Workflow file for this run

# This workflow will build a Java project with Gradle, and cache/restore any dependencies to improve the workflow execution time
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-gradle
# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
name: Java CI with Gradle
on:
push:
branches: [ "main", "next" ]
pull_request:
branches: [ "main", "next" ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
name: Checkout
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin'
cache: gradle
- name: Setup Gradle
uses: gradle/gradle-build-action@v3
- name: Build with Gradle
run: gradle clean build
container-image:
if: github.repository_owner == 'transittrack' && github.event_name == 'push'
runs-on: ubuntu-latest
needs:
- build
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up JDK 21
uses: actions/setup-java@v4
with:
java-version: 21
distribution: temurin
cache: gradle
- name: Docker setup-buildx
uses: docker/setup-buildx-action@v3
with:
install: true
- name: Docker Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Setup Gradle
uses: gradle/gradle-build-action@v3
- name: Build container image with Jib, push to Dockerhub
env:
CONTAINER_REPO: "ghcr.io/transittrack/transittrack"
CONTAINER_REGISTRY_USER: ${{ github.repository_owner }}
CONTAINER_REGISTRY_PASSWORD: ${{ secrets.GITHUB_TOKEN }}
run: |
# we give the container two tags
# - "latest"
# - a string like "3.0_2022-12-12T21-38"
version_with_snapshot=`gradle properties -q | awk '/^version:/ {print $2}'`
version=${version_with_snapshot/-SNAPSHOT/}
image_version=${version}
## if the Gradle version contains SNAPSHOT, then add date to tag
if [[ $version_with_snapshot == *"SNAPSHOT"* ]]; then
image_date=`date +%Y-%m-%dT%H-%M`
image_version="${version}_${image_date}"
echo "Gradle version ${version_with_snapshot} contains SNAPSHOT, adding date to container image tag"
fi
gradle build jib -Djib.to.tags=latest,$image_version