Browse Source

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.
pull/880/head
Hamish Coleman 3 years ago
parent
commit
71521b81d8
  1. 20
      .github/workflows/tests.yml

20
.github/workflows/tests.yml

@ -479,8 +479,12 @@ jobs:
name: binaries
path: binaries
upload_release:
name: Upload Release Assets
# Given the clearly documented use of annotated tags to signal releases,
# 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/')
needs:
- package_dpkg
@ -491,6 +495,18 @@ jobs:
- binaries_linux_crosscompile
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:
- name: Fetch all Artifacts
uses: actions/download-artifact@v2

Loading…
Cancel
Save