Skip to content

Update tested Operaton version in README #18

Update tested Operaton version in README

Update tested Operaton version in README #18

Workflow file for this run

name: Build Maven Artefact
on:
push:
branches:
- master
paths-ignore:
- "README.md"
pull_request:
branches:
- master
jobs:
build-maven:
name: Build Maven
runs-on: ubuntu-22.04
outputs:
version: ${{ steps.version.outputs.version }}
tag: ${{ steps.tag.outputs.tag }}
permissions:
packages: write
contents: read
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-java@v4
with:
distribution: "temurin" # See 'Supported distributions' for available options
java-version: "17"
- name: Cache local Maven repository
uses: actions/cache@v4
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: New version
id: version
run: |
filter=$( awk -F '[.]' '{printf "v"$1"."$2".*"}' <<< $( yq -p xml '.project.version' pom.xml ) )
tag=$(git tag -l $filter --sort=-creatordate | head -1)
new_tag=$( cut -c2- <<< "$( awk -F '[.]' '{printf $1"."$2"."}' <<< $tag)$[$( awk -F '[.]' '{printf $3}' <<< $tag)+1]" )
echo "version=$new_tag" >> $GITHUB_OUTPUT
- name: New tag
id: tag
run: |
if [[ ${{ github.event_name }} == 'push' ]]; then
export TAG=$NEW_VERSION
export RELEASE="true"
else
export TAG=pr-${{ github.event.pull_request.number }}
export RELEASE="false"
fi
echo "tag=$TAG" >> $GITHUB_OUTPUT
echo "release=$RELEASE" >> $GITHUB_OUTPUT
env:
NEW_VERSION: ${{ steps.version.outputs.version }}
- name: MVN set version
run: |
if [[ ${{ github.event_name }} == 'push' ]]; then
mvn versions:set -DnewVersion=$NEW_VERSION
else
mvn versions:set -DnewVersion=$NEW_VERSION-PR-${{ github.event.pull_request.number }}-SNAPSHOT
fi
env:
NEW_VERSION: ${{ steps.version.outputs.version }}
- name: test and build JAR
run: |
mkdir -p ./src/main/resources/META-INF/resources/webjars/camunda/app/cockpit/scripts
cp *.js ./src/main/resources/META-INF/resources/webjars/camunda/app/cockpit/scripts
mkdir -p ./src/main/resources/META-INF/resources/webjars/operaton/app/cockpit/scripts
cp *.js ./src/main/resources/META-INF/resources/webjars/operaton/app/cockpit/scripts
mvn package -ntp
- name: Upload new versions in maven registry
run: |
if [[ ${{ github.event_name }} == 'pull_request' ]]; then
mvn deploy -ntp -Drepo.login=${{ github.actor }} -Drepo.pwd=${{ secrets.GITHUB_TOKEN }} -s .m2/settings.xml -DskipTests
fi
release:
name: Publish Release
if: github.event_name == 'push'
needs:
- build-maven
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-java@v4
with:
distribution: "temurin" # See 'Supported distributions' for available options
java-version: "17"
- name: Cache local Maven repository
uses: actions/cache@v4
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: MVN set version
run: |
mvn versions:set -DnewVersion=$NEW_VERSION
env:
NEW_VERSION: ${{ needs.build-maven.outputs.version }}
- name: Create Release Tag
uses: softcannery/.github/actions/release-tag@master
with:
git-token: ${{ secrets.GITHUB_TOKEN }}
version: v${{ needs.build-maven.outputs.version }}
- name: test and build JAR
run: mvn package -ntp -Dmaven.test.skip
- name: Upload new versions in maven registry
run: |
mvn deploy -ntp -Drepo.login=${{ github.actor }} -Drepo.pwd=${{ secrets.GITHUB_TOKEN }} -s .m2/settings.xml -DskipTests
- name: Release it
run: |
export PREV_VERSION=$(gh release list | grep Latest | awk '{print $3}')
gh release create v$NEW_VERSION --title v$NEW_VERSION --notes-start-tag $PREV_VERSION --generate-notes --latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NEW_VERSION: ${{ needs.build-maven.outputs.version }}