Skip to content

Commit

Permalink
feat: create an annotated tag instead of a ligthweight tag to ensure …
Browse files Browse the repository at this point in the history
…the correct timestamp (#26)

* feat: create an annotated tag instead of a ligthweight tag

* Update run.sh

* Update run.sh
  • Loading branch information
dduportal committed Sep 13, 2022
1 parent 8c5d1f5 commit 8a7dfc0
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ fi
export MAVEN_OPTS=-Djansi.force=true
mvn -B -V -s $GITHUB_ACTION_PATH/settings.xml -ntp -Dstyle.color=always -Dset.changelist -DaltDeploymentRepository=maven.jenkins-ci.org::default::https://repo.jenkins-ci.org/releases/ -Pquick-build -P\!consume-incrementals clean deploy
version=$(mvn -B -ntp -Dset.changelist -Dexpression=project.version -q -DforceStdout help:evaluate)
# Create the annotated git tag - https://docs.github.com/en/rest/git/tags#create-a-tag-object
gh api -F tag=$version -F message=$version -F object=$GITHUB_SHA -F type=commit /repos/$GITHUB_REPOSITORY/git/tags
# Create the git reference associated to the annotated git tag - https://docs.github.com/en/rest/git/refs#create-a-reference
gh api -F ref=refs/tags/$version -F sha=$GITHUB_SHA /repos/$GITHUB_REPOSITORY/git/refs
# Publish the GitHub draft release and associate it with the git tag - https://docs.github.com/en/rest/releases/releases#update-a-release
release=$(gh api /repos/$GITHUB_REPOSITORY/releases | jq -e -r '[ .[] | select(.draft == true and .name == "next").id] | max')
gh api -X PATCH -F draft=false -F name=$version -F tag_name=$version /repos/$GITHUB_REPOSITORY/releases/$release

0 comments on commit 8a7dfc0

Please sign in to comment.