From 94e7a682bd8656e1a9f014c13c52eacb08194847 Mon Sep 17 00:00:00 2001 From: Andrea Cavalli Date: Fri, 22 Oct 2021 13:24:19 +0200 Subject: [PATCH] Fix github actions workflow --- .github/workflows/maven-publish.yml | 8 +++++++- .../github-workflows/only-compile-release.sh | 10 ++++++++++ scripts/core/only_compile_release.sh | 16 ++++++++++++++++ 3 files changed, 33 insertions(+), 1 deletion(-) create mode 100755 scripts/continuous-integration/github-workflows/only-compile-release.sh create mode 100755 scripts/core/only_compile_release.sh diff --git a/.github/workflows/maven-publish.yml b/.github/workflows/maven-publish.yml index 93a0f1a..dd24af4 100644 --- a/.github/workflows/maven-publish.yml +++ b/.github/workflows/maven-publish.yml @@ -35,13 +35,19 @@ jobs: echo "REVISION=$REVISION" >> $GITHUB_ENV echo "IMPLEMENTATION_NAME=$IMPLEMENTATION_NAME" >> $GITHUB_ENV - name: Set up JDK 17 - if: ${{ startsWith(github.ref, 'refs/tags/v') }} uses: actions/setup-java@v1 with: java-version: 17 server-id: mchv-release-distribution server-username: MAVEN_USERNAME server-password: MAVEN_PASSWORD + - name: Build + if: ${{ !startsWith(github.ref, 'refs/tags/v') }} + shell: bash + run: | + echo "IMPLEMENTATION_NAME: $IMPLEMENTATION_NAME" + + source ./scripts/continuous-integration/github-workflows/only-compile-release.sh - name: Deploy to Maven (Release) if: ${{ startsWith(github.ref, 'refs/tags/v') }} shell: bash diff --git a/scripts/continuous-integration/github-workflows/only-compile-release.sh b/scripts/continuous-integration/github-workflows/only-compile-release.sh new file mode 100755 index 0000000..08b0d46 --- /dev/null +++ b/scripts/continuous-integration/github-workflows/only-compile-release.sh @@ -0,0 +1,10 @@ +#!/bin/bash -e +set -e +# OTHER REQUIRED ENVIRONMENT VARIABLES: +# IMPLEMENTATION_NAME = + +cd ./scripts/core/ +./only_compile_release.sh + +echo "Done." +exit 0 diff --git a/scripts/core/only_compile_release.sh b/scripts/core/only_compile_release.sh new file mode 100755 index 0000000..20e24c3 --- /dev/null +++ b/scripts/core/only_compile_release.sh @@ -0,0 +1,16 @@ +#!/bin/bash -e +# OTHER REQUIRED ENVIRONMENT VARIABLES: +# IMPLEMENTATION_NAME = + +# Check variables correctness +if [ -z "${IMPLEMENTATION_NAME}" ]; then + echo "Missing parameter: IMPLEMENTATION_NAME" + exit 1 +fi + +cd ../../${IMPLEMENTATION_NAME} + +mvn -B clean package --file pom.xml + +echo "Done." +exit 0