From 8318e3c967ab0cc08351e34c94fc0b224fa468af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Beck=20K=C3=B6nig?= Date: Thu, 17 Oct 2024 22:19:24 +0200 Subject: [PATCH] fix --- .github/workflows/CI.yml | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index abc6022..dcab5fa 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -90,25 +90,26 @@ jobs: with: fetch-depth: 0 token: ${{ secrets.PAT_WITH_REPO_SCOPE }} - - name: Get version - id: get_version + + - name: Get version from Cargo.toml run: | - VERSION=$(grep '^version = ' Cargo.toml | cut -d'"' -f2) - echo "VERSION=$VERSION" >> $GITHUB_OUTPUT + VERSION=$(grep '^version = ' Cargo.toml | cut -d '"' -f 2) + echo "VERSION=$VERSION" >> $GITHUB_ENV + - name: Check if tag exists - id: check_tag run: | if git rev-parse "v${{ env.VERSION }}" >/dev/null 2>&1; then echo "TAG_EXISTS=true" >> $GITHUB_ENV else echo "TAG_EXISTS=false" >> $GITHUB_ENV fi + - name: Create and push tag if: env.TAG_EXISTS == 'false' run: | git config user.name "${{ github.actor }}" git config user.email "${{ github.actor }}@users.noreply.github.com" - git tag -a "v${{ env.VERSION }}" -m "Release ${{ env.VERSION }}" + git tag -a "v${{ env.VERSION }}" -m "Release v${{ env.VERSION }}" git push origin "v${{ env.VERSION }}" release-crates-io: