-
Notifications
You must be signed in to change notification settings - Fork 68
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update release tagging using publish action.
- Loading branch information
Showing
1 changed file
with
17 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1053,20 +1053,33 @@ jobs: | |
|
||
- name: Tag with CMake version if not already. | ||
run: | | ||
git config --local user.name "Development bot" | ||
git config --local user.email "[email protected]" | ||
# We want to tag whenever the cmake version changes. So extract the | ||
# hash of when the current version was entered. | ||
read TAG_HASH TAG_VERSION <<<$(git annotate -l CMakeLists.txt | sed 's/\(^[0-9A-Fa-f]\+\).*project(SURELOG VERSION \([0-9]\+\.[0-9]\+\).*/\1 \2/p;d') | ||
echo "Surelog Version v${TAG_VERSION} at hash ${TAG_HASH}" | ||
TAG="v${TAG_VERSION}" | ||
echo "Surelog Version ${TAG} at hash ${TAG_HASH}" | ||
# If this is the first time we see this tag: apply. | ||
if [ -z "$(git tag -l "v${TAG_VERSION}")" ]; then | ||
git tag -a "v${TAG_VERSION}" ${TAG_HASH} -m "Update to v${TAG_VERSION}" | ||
git push origin "v${TAG_VERSION}" | ||
if [ -z "$(git tag -l "${TAG}")" ]; then | ||
git tag -a "${TAG}" ${TAG_HASH} -m "Update to ${TAG}" | ||
echo "TAG=$TAG" >> $GITHUB_ENV | ||
else | ||
echo "Tag already applied" | ||
fi | ||
- name: Publish tag | ||
if: ${{ env.TAG != '' }} | ||
# For now, just publish tag, but we can also use this to | ||
# publish the binaries we built before. | ||
uses: svenstaro/upload-release-action@v2 | ||
with: | ||
repo_token: ${{ secrets.GITHUB_TOKEN }} | ||
tag: ${{ env.TAG }} | ||
|
||
# Code formatting | ||
CodeFormatting: | ||
runs-on: ubuntu-20.04 | ||
|