Only trigger release process on annotated tags

Annotated tags are meant for releases while lightweight tags are meant
for private or temporary object labels.

For this reason, we should not trigger the automatic release actions
unless we have an annotated tag.
This commit is contained in:
Hamish Coleman 2021-10-31 11:36:29 +00:00
parent b9eac35c00
commit 71521b81d8

View File

@ -479,8 +479,12 @@ jobs:
name: binaries name: binaries
path: binaries path: binaries
upload_release: # Given the clearly documented use of annotated tags to signal releases,
name: Upload Release Assets # it seems strange that there is no simple way to trigger actions if the
# tag is annotated. So we need to jump through some hoops.
#
get_tagtype:
name: Get the type of Tag
if: startsWith(github.ref, 'refs/tags/') if: startsWith(github.ref, 'refs/tags/')
needs: needs:
- package_dpkg - package_dpkg
@ -491,6 +495,18 @@ jobs:
- binaries_linux_crosscompile - binaries_linux_crosscompile
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps:
- name: Set variable
run: |
echo '::set-output name=TAGTYPE::$(git cat-file -t $GITHUB_REF)'
upload_release:
name: Upload Release Assets
if: steps.get_tagtype.outputs.TAGTYPE == 'tag'
needs:
- get_tagtype
runs-on: ubuntu-latest
steps: steps:
- name: Fetch all Artifacts - name: Fetch all Artifacts
uses: actions/download-artifact@v2 uses: actions/download-artifact@v2