From: Mathias Preiner Date: Wed, 23 Mar 2022 18:26:15 +0000 (-0700) Subject: Only update latest tag if commit changed. (#8379) X-Git-Tag: cvc5-1.0.0~196 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=06a3895a02ea24602276181664c3db1a7d1827ae;p=cvc5.git Only update latest tag if commit changed. (#8379) Previously the latest tag was always updated when a new binary was added to a release (i.e. 3 updates per commit). This commit ensures that we only update the tag if the commit sha changed. --- diff --git a/.github/actions/store-binary/action.yml b/.github/actions/store-binary/action.yml index bd18093c4..00986aec3 100644 --- a/.github/actions/store-binary/action.yml +++ b/.github/actions/store-binary/action.yml @@ -35,10 +35,12 @@ runs: gh = Github(os.getenv('GITHUB_TOKEN')) repo = gh.get_repo(os.getenv('GITHUB_REPOSITORY')) - + try: - # update "latest" to current commit - repo.get_git_ref('tags/latest').edit(sha) + ref = repo.get_git_ref('tags/latest') + # update "latest" to current commit if sha changed + if ref.object.sha != sha: + ref.edit(sha) except: print('tag `latest` does not exist.') exit @@ -74,7 +76,7 @@ runs: # upload as asset with proper name rel.upload_asset(binary, name=filename) - + - name: store to release if: startsWith(github.ref, 'refs/tags/') shell: 'python3 {0}'