Skip to content

Rename

Rename #881

Workflow file for this run

# 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.
# 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
name: Java CI with Gradle
on:
push:
branches: [ "**/*" ]
pull_request:
branches: [ "**/*" ]
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true
- name: Setup Environment (PR)
if: ${{ github.event_name == 'pull_request' }}
shell: bash
run: |
calculatedSha=$(git rev-parse --short ${{ github.event.pull_request.head.sha }})
version=$(cat gradle.properties | grep mod_version= | sed s/mod_version=//g)
echo "LAST_COMMIT_SHA=$calculatedSha" >> ${GITHUB_ENV}
echo "VERSION=$version" >> ${GITHUB_ENV}
- name: Setup Environment (Push)
if: ${{ github.event_name == 'push' }}
shell: bash
run: |
calculatedSha=$(git rev-parse --short ${{ github.sha }})
version=$(cat gradle.properties | grep mod_version= | sed s/mod_version=//g)
echo "LAST_COMMIT_SHA=$calculatedSha" >> ${GITHUB_ENV}
echo "VERSION=$version" >> ${GITHUB_ENV}
- name: Set up JDK 21
uses: actions/setup-java@v3
with:
java-version: '21'
distribution: 'temurin'
- name: Setup Gradle
uses: gradle/gradle-build-action@bd5760595778326ba7f1441bcf7e88b49de61a25 # v2.6.0
with:
arguments: build --scan
- name: Upload JAR file
uses: actions/upload-artifact@v3
with:
name: AdvancedFramework-v${{ env.VERSION }}-${{ env.LAST_COMMIT_SHA }}
path: |
build/libs/*.jar
!build/libs/*-sources.jar