From daae6a3cd2c1d1ada612baaeec00928ef74236b1 Mon Sep 17 00:00:00 2001 From: Andrea Cavalli Date: Thu, 11 May 2023 01:14:09 +0200 Subject: [PATCH] Fix github actions workflow --- .github/workflows/maven-publish.yml | 30 +++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/.github/workflows/maven-publish.yml b/.github/workflows/maven-publish.yml index 13e18d4..9caa155 100644 --- a/.github/workflows/maven-publish.yml +++ b/.github/workflows/maven-publish.yml @@ -5,6 +5,11 @@ name: Maven Package on: push: + branches: + - master + - develop + tags: + - 'v*' jobs: build: @@ -14,27 +19,24 @@ jobs: - { os: ubuntu-20.04, arch: "linux/amd64" } runs-on: ${{ matrix.os }} steps: - - name: Branch name + - name: Branch name and revision id: branch_name run: | set -xeo pipefail - echo "SOURCE_NAME=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV - echo "SOURCE_BRANCH=${GITHUB_REF#refs/heads/}" >> $GITHUB_ENV - echo "SOURCE_TAG=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV - echo "SOURCE_TAG_VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_ENV + + export SOURCE_NAME="${GITHUB_REF#refs/*/}" + export SOURCE_BRANCH="${GITHUB_REF#refs/heads/}" + export SOURCE_TAG="${GITHUB_REF#refs/tags/}" + export SOURCE_TAG_VERSION="${GITHUB_REF#refs/tags/v}" + export REVISION="$SOURCE_TAG_VERSION" + + echo "SOURCE_TAG_VERSION=$SOURCE_TAG_VERSION" >> $GITHUB_ENV + echo "REVISION=$REVISION" >> $GITHUB_ENV + cat $GITHUB_ENV > github.env - uses: actions/checkout@v3 with: submodules: "recursive" - - name: Setup variables - shell: bash - run: | - set -xeo pipefail - # ====== Variables - export REVISION=${{ steps.branch_name.outputs.SOURCE_TAG_VERSION }} - - echo "REVISION=$REVISION" >> $GITHUB_ENV - cat $GITHUB_ENV >> github.env - name: Set up JDK 17 (Snapshot) if: ${{ !startsWith(github.ref, 'refs/tags/v') }} uses: actions/setup-java@v3