From d0697dd3af97aa443ccb23b545de91e41b4f6d71 Mon Sep 17 00:00:00 2001 From: SeaswimmerTheFsh Date: Fri, 29 Mar 2024 08:09:15 -0400 Subject: [PATCH] misc: changed some things around in the autotagger --- .forgejo/workflows/autotagger.yaml | 25 +++++++++---------------- 1 file changed, 9 insertions(+), 16 deletions(-) diff --git a/.forgejo/workflows/autotagger.yaml b/.forgejo/workflows/autotagger.yaml index 0a4c72b..b00dda8 100644 --- a/.forgejo/workflows/autotagger.yaml +++ b/.forgejo/workflows/autotagger.yaml @@ -25,26 +25,19 @@ jobs: gpg_private_key : ${{ secrets.GPG_PRIVATE_KEY }} passphrase : ${{ secrets.GPG_PASSPHRASE }} - - name: Extract commit message - id: extract_commit_message - run: echo "::set-output name=message::$(git log --format=%B -n 1 $GITHUB_SHA)" - - - name: Get new version - id: get_version - run: echo "::set-output name=version::$(awk -F '=' '/^ *version/ {gsub(/[[:space:]]/, "", $2); print $2}' pyproject.toml)" - - - name: Get latest tag - id: get_latest_tag + - name: Set output variables + id: vars run: | git fetch --tags - LATEST_TAG=$(git describe --tags `git rev-list --tags --max-count=1`) - echo "::set-output name=latest_tag::$LATEST_TAG" + echo "::set-output name=latest_tag::$(git describe --tags `git rev-list --tags --max-count=1`)" + echo "::set-output name=version::$(awk -F '=' '/^ *version/ {gsub(/[[:space:]]/, "", $2); print $2}' pyproject.toml)" + echo "::set-output name=message::$(git log --format=%B -n 1 $GITHUB_SHA)" - name: Compare version and latest tag id: compare run: | - VERSION=${{ steps.get_version.outputs.version }} - LATEST_TAG=${{ steps.get_latest_tag.outputs.latest_tag }} + VERSION=${{ steps.vars.outputs.version }} + LATEST_TAG=${{ steps.vars.outputs.latest_tag }} if [ "$VERSION" = "$LATEST_TAG" ]; then echo "::set-output name=latest_tag::$LATEST_TAG" else @@ -54,14 +47,14 @@ jobs: - name: Create tag if: steps.compare.outputs.version run: | - VERSION=${{ steps.get_version.outputs.version }} + VERSION=${{ steps.vars.outputs.version }} git tag -s $VERSION -m "version bumped to $VERSION" git push origin $VERSION - name: Update latest tag if: steps.compare.outputs.latest_tag run: | - MESSAGE=${{ steps.extract_commit_message.outputs.message }} + MESSAGE=${{ steps.vars.outputs.message }} LATEST_TAG=${{ steps.compare.outputs.latest_tag }} git tag -fs $LATEST_TAG -m "$MESSAGE" git push origin $LATEST_TAG --force