diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 2dbe7a1..fc4bc22 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -56,37 +56,13 @@ jobs: with: bump: calver version-source: tag + token: ${{ steps.setup-git-user.outputs.token }} targets: | - file: CITATION.cff pattern: '^version: {version}$' - file: CITATION.cff pattern: '^date-released: "{date}"$' - # The release step refuses an existing tag or release too, but only after - # the push, which would leave the bump on the default branch. - - name: Refuse an existing tag or release - env: - GH_TOKEN: ${{ steps.setup-git-user.outputs.token }} - VERSION: ${{ steps.bump.outputs.version }} - shell: bash - run: | - set -euo pipefail - STATUS=0 - git ls-remote --exit-code --tags origin "refs/tags/${VERSION}" > /dev/null || STATUS=$? - case "${STATUS}" in - 0) echo "::error::Tag ${VERSION} already exists. Delete it, or create its release by hand, then dispatch this workflow again."; exit 1 ;; - 2) ;; - *) echo "::error::Could not list the tags of origin (git exit ${STATUS})."; exit 1 ;; - esac - if OUTPUT=$(gh release view "${VERSION}" 2>&1); then - echo "::error::A release ${VERSION} already exists, perhaps as a draft. Delete it, then dispatch this workflow again." - exit 1 - fi - if ! grep -qi 'release not found' <<< "${OUTPUT}"; then - echo "::error::Could not check for release ${VERSION}: ${OUTPUT}" - exit 1 - fi - # The App is exempt from the pull request rule of the default branch, and # [skip ci] keeps CI from running again on a tree it has checked. - name: Push the version