Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extract Major.Minor #54

Merged
merged 1 commit into from
Oct 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions .github/workflows/docker-build-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ jobs:
echo "Environment: $TARGET_ENV JFROG_REPO_PATH=$JFROG_REPO_PATH"
echo "..."
env | sort

GenerateTag:
runs-on: ubuntu-latest
steps:
Expand All @@ -66,18 +67,25 @@ jobs:
- name: Generate Next Git Tag
id: tag-selector
run: |
# Extract the major and minor version parts
MAJOR_MINOR_VERSION=$(echo "${{env.RELEASE_VERSION}}" | sed 's/\.[0-9]*$//')
# Extract the latest patch version for the given major.minor version
VERSION_PATCH=$(git tag --list "${{env.RELEASE_PREFIX}}${{env.RELEASE_VERSION%.*}}.*" --sort=-version:refname | head -n 1 | grep -oE '[0-9]+$')
VERSION_PATCH=$(git tag --list "${{env.RELEASE_PREFIX}}${MAJOR_MINOR_VERSION}.*" --sort=-version:refname | head -n 1 | grep -oE '[0-9]+$')
if [ -z "$VERSION_PATCH" ]; then
VERSION_PATCH=0
else
VERSION_PATCH=$((VERSION_PATCH + 1))
fi
# Construct the new tag
NEW_TAG="${{env.RELEASE_PREFIX}}${{env.RELEASE_VERSION%.*}}.${VERSION_PATCH}"
NEW_TAG="${{env.RELEASE_PREFIX}}${MAJOR_MINOR_VERSION}.${VERSION_PATCH}"
echo "gittag=${NEW_TAG}" >> $GITHUB_OUTPUT
echo "tagmsg=${{env.RELEASE_MESSAGE}} ${{steps.date-selector.outputs.date}}" >> $GITHUB_OUTPUT
echo "tagpatch=${VERSION_PATCH}" >> $GITHUB_OUTPUT

- name: Create Git Tag
run: |
git tag -a "${{steps.tag-selector.outputs.gittag}}" -m "${{steps.tag-selector.outputs.tagmsg}}"
git push origin "${{steps.tag-selector.outputs.gittag}}"
outputs:
TAGNAME: ${{steps.tag-selector.outputs.gittag}}
TAGMESSAGE: ${{steps.tag-selector.outputs.tagmsg}}
Expand Down
3 changes: 2 additions & 1 deletion applications/scripts/datafix-ab#001.sql
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
test
test1
test2