-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added action to create new tag from project version.
- Loading branch information
Showing
1 changed file
with
33 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,33 @@ | ||
on: | ||
workflow_run: | ||
workflows: [Run unit tests] | ||
types: [completed] | ||
branches: [master] | ||
|
||
name: Tag project version | ||
|
||
jobs: | ||
tag: | ||
runs-on: ubuntu-latest | ||
if: ${{ github.event.workflow_run.conclusion == 'success' }} | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Get current version | ||
id: current | ||
run: | | ||
current=$(cat CMakeLists.txt | grep ' *VERSION' | sed 's/.*VERSION //g') | ||
echo "Current version is ${current}" | ||
echo "version=v${current}" >> $GITHUB_OUTPUT | ||
- name: Get latest version | ||
id: latest | ||
uses: actions-ecosystem/action-get-latest-tag@v1 | ||
with: | ||
semver_only: true | ||
|
||
- name: Tag version if new | ||
if: ${{ steps.current.outputs.version != steps.latest.outputs.tag }} | ||
uses: actions-ecosystem/action-push-tag@v1 | ||
with: | ||
tag: ${{ steps.current.outputs.version }} |