Fix github actions workflow

This commit is contained in:
Andrea Cavalli 2023-05-11 01:14:09 +02:00
parent 35bdc5653c
commit daae6a3cd2

View File

@ -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