diff --git a/.github/workflows/tag.yaml b/.github/workflows/tag.yaml index b8c0161e6..bdb002e8b 100644 --- a/.github/workflows/tag.yaml +++ b/.github/workflows/tag.yaml @@ -24,18 +24,20 @@ jobs: - name: Get Version id: get-version run: | - CURRENT_VERSION=$(awk -F'"' '/ID string =/ {print $2}' ${{ env.VERSION_FILE }}) - echo "VERSION=$CURRENT_VERSION" >> "$GITHUB_OUTPUT" + VERSION=$(awk -F'"' '/ID string =/ {print $2}' ${{ env.VERSION_FILE }}) + echo "VERSION=$VERSION" >> "$GITHUB_OUTPUT" - name: Create Tag if: ${{ steps.get-version.outputs.VERSION != '' }} run: | - if [ $(git tag -l "${{ steps.get-version.outputs.VERSION }}") ]; then - echo "Tag already exists for version $CURRENT_VERSION" + VERSION=${{ steps.get-version.outputs.VERSION }} + if [ $(git tag -l "$VERSION") ]; then + echo "Tag already exists for version $VERSION" exit 0 else + git config --global tag.gpgsign true git config user.name "github-actions[bot]" git config user.email "41898282+github-actions[bot]@users.noreply.github.com" - git tag $CURRENT_VERSION - git push --tags + git tag $VERSION + git push origin tag $VERSION gitsign verify $(git rev-list --tags --max-count=1) --certificate-identity-regexp="https://github.com/${{ github.repository }}" --certificate-oidc-issuer="https://token.actions.githubusercontent.com" fi diff --git a/.github/workflows/version.yaml b/.github/workflows/version.yaml index c28101d3c..c2597f7f9 100644 --- a/.github/workflows/version.yaml +++ b/.github/workflows/version.yaml @@ -47,16 +47,20 @@ jobs: exit 1 ;; esac + + echo "Current bincapz version: $CURRENT_VERSION" + echo "New bincapz version: $VERSION" - sed -i'' -e "s/ID string = \"v[0-9]*\.[0-9]*\.[0-9]*\"/ID string = \"v$VERSION\"/" ${{ env.VERSION_FILE }} + sed -i -e "s/ID string = \"v[0-9]*\.[0-9]*\.[0-9]*\"/ID string = \"v$VERSION\"/" ${{ env.VERSION_FILE }} - name: Commit Version Update run: | git config user.name "github-actions[bot]" git config user.email "41898282+github-actions[bot]@users.noreply.github.com" - git checkout -b bincapz-version-bump-$VERSION + BRANCH="bincapz-version-bump-$VERSION" + git checkout -b $BRANCH git add ${{ env.VERSION_FILE }} git commit -m "Bump bincapz version to v$VERSION" - git push origin bincapz-bump-version-$VERSION + git push origin $BRANCH gitsign verify $(git rev-parse HEAD) --certificate-identity-regexp="https://github.com/${{ github.repository }}" --certificate-oidc-issuer="https://token.actions.githubusercontent.com" - name: Create Pull Request run: |