Skip to content

Workflow file for this run

name: OptaRouter Master CI
on:
push:
# Sequence of patterns matched against refs/heads
branches:
- 'master'
env:
JAVA_VERSION: '21'
JAVA_DISTRO: 'temurin'
jobs:
gradle_master_build:
name: Gradle Master Build
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v3
- uses: n1hility/cancel-previous-runs@v2
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Setting up Git
run: git config user.email "${{ github.actor }}@users.noreply.github.com" && git config user.name "Github Actions"
- name: Setup Java
uses: actions/setup-java@v3
with:
java-version: ${{ env.JAVA_VERSION }}
distribution: ${{ env.JAVA_DISTRO }}
- name: Running gradle task
uses: gradle/gradle-build-action@v2.4.2
env:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
DOCKER_USER: ${{ secrets.DOCKER_USER }}
DOCKER_PASS: ${{ secrets.DOCKER_PASS }}
with:
gradle-version: wrapper
arguments: clean spotlessCheck release -PenvironmentName=single -Prelease.useAutomaticVersion=true
release:
name: Create Release Tag
runs-on: ubuntu-latest
needs: gradle_master_build
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Get latest tag
id: get_latest_tag
run: |
LATEST_TAG=$(git describe --tags $(git rev-list --tags --max-count=1))
echo "latest_tag=$LATEST_TAG" >> $GITHUB_OUTPUT
- name: Last Release
id: last_release
uses: pozetroninc/github-action-get-latest-release@master
with:
repository: ${{ github.repository }}
excludes: prerelease,draft
- name: Release
uses: softprops/action-gh-release@v1
if: steps.get_latest_tag.outputs.latest_tag != steps.last_release.outputs.release
with:
repository: ${{ github.repository }}
tag_name: ${{ steps.get_latest_tag.outputs.latest_tag }}
draft: false
prerelease: false
token: ${{ secrets.GITHUB_TOKEN }}