Skip to content

Commit

Permalink
[Actions] Select only v* tags in release snapshot action
Browse files Browse the repository at this point in the history
  • Loading branch information
avano committed Oct 26, 2022
1 parent b8474cc commit 7bc057e
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions .github/workflows/release-snapshot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,9 @@ jobs:
- name: Create snapshot version
run: |
# Get the latest released tag and increase its version (as we always stay on 1.0-SNAPSHOT in main branch for tnb-tests usage, but it would be better to have also the snapshot version incrementing)
previous_tag="$(git describe --tags $(git rev-list --tags --max-count=1) | cut -c2-)"
echo ${previous_tag}
curl -o semver https://raw.githubusercontent.com/fsaintjacques/semver-tool/master/src/semver
chmod +x semver
# Only select tags matching 'v*'
previous_tag="$(git for-each-ref --sort=creatordate --format '%(refname)' "refs/tags/v*" | awk -F"/" 'END{print substr($3,2)}')"
curl -o semver https://raw.githubusercontent.com/fsaintjacques/semver-tool/master/src/semver && chmod +x semver
snapshot_version=$(./semver bump patch ${previous_tag})-SNAPSHOT
mvn --no-transfer-progress versions:set -DnewVersion=${snapshot_version} -DoldVersion=* -DgroupId=* -DartifactId=* -DgenerateBackupPoms=false
- name: Deploy
Expand Down

0 comments on commit 7bc057e

Please sign in to comment.