Skip to content

Commit

Permalink
Add environment tag
Browse files Browse the repository at this point in the history
  • Loading branch information
DarylTodosichuk committed Oct 22, 2024
1 parent bce741a commit d51e952
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
15 changes: 12 additions & 3 deletions .github/workflows/docker-build-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ jobs:
# This workflow contains jobs called "GenerateTag" "PushTag" "Build"
GenerateTag:
runs-on: ubuntu-latest
environment: test
steps:
- name: Checkout repository
uses: actions/checkout@v4
Expand All @@ -66,16 +67,24 @@ jobs:
- name: Generate Next Git Tag
id: tag-selector
run: |
env | grep RELEASE
VERSION_PATCH=$(git tag --list "${{env.RELEASE_PREFIX}}${{env.RELEASE_VERSION}}" --sort=-version:refname | head -n 1 | grep -oE '[0-9]+$')
# Extract the major and minor version parts using grep
MAJOR_MINOR_VERSION=$(echo "${{env.RELEASE_VERSION}}" | grep -oE '^[0-9]+\.[0-9]+')
# Extract the latest patch version for the given major.minor version
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
echo "gittag=${{env.RELEASE_PREFIX}}${{env.RELEASE_VERSION}}.${VERSION_PATCH}" >> $GITHUB_OUTPUT
# Construct the new tag
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
Expand Up @@ -3,4 +3,5 @@ test2
test3
test4
test5
test6
test6
test7

0 comments on commit d51e952

Please sign in to comment.