From d91cd431dbe08caf0fb99043a5be2191f7c13b72 Mon Sep 17 00:00:00 2001 From: Jan Galek Date: Tue, 10 Dec 2024 04:58:09 +0100 Subject: [PATCH] [Updated] Release logic for github action --- .github/workflows/release.yml | 163 ++++++++++++++++++---------------- 1 file changed, 87 insertions(+), 76 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index e6594ed..f302aaa 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -53,92 +53,103 @@ jobs: - name: Get commits since last tag id: commits run: | - PREV_TAG=$(git describe --tags --abbrev=0 HEAD^ 2>/dev/null || echo "") - if [ -z "$PREV_TAG" ]; then - echo "No previous tag found, using initial commit." - COMMITS="" + # Získání aktuálního tagu + CURRENT_TAG=$(git describe --tags --abbrev=0 HEAD) + + # Kontrola, zda je aktuální tag stabilní (neobsahuje -beta, -rc apod.) + if [[ "$CURRENT_TAG" =~ -(beta|rc) ]]; then + # Pro beta/rc verze najdi předchozí libovolný tag + PREV_TAG=$(git describe --tags --abbrev=0 HEAD^) else - COMMITS="" - echo "Result: $COMMITS" # Odstranění nechtěných znaků COMMITS=$(echo "$COMMITS" | sed 's/[[:cntrl:]]//g') - echo "Result clear: $COMMITS" echo "commits=$COMMITS" >> $GITHUB_ENV env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}