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

Dev #67

Merged
merged 2 commits into from
Oct 22, 2024
Merged

Dev #67

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
53 changes: 14 additions & 39 deletions .github/workflows/docker-build-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,8 @@ env:
UGM_BUILD_VERSION: ${{vars.UGM_BUILD_VERSION}}
UGM_BUILD_REVISION: ${{vars.UGM_BUILD_REVISION}}

RELEASE_PREFIX: API_v
RELEASE_MESSAGE: Test
RELEASE_VERSION: ${{vars.UGM_BUILD_VERSION}}
UGM_RELEASE_PREFIX: API_v
UGM_RELEASE_MESSAGE: Test

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
Expand Down Expand Up @@ -68,54 +67,30 @@ jobs:
id: tag-selector
run: |
# 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
MAJOR_VERSION=$(echo "${{env.UGM_BUILD_VERSION}}" | grep -oE '^[0-9]+`)
MINOR_VERSION=$(echo "${{env.UGM_BUILD_VERSION}}" | grep -oE '\.[0-9]+' | grep -oE '[0-9]+')
VERSION_PATCH=$(echo "${{env.UGM_BUILD_VERSION}}" | grep -oE '[0-9]+$')
VERSION_PATCH=$((VERSION_PATCH + 1))
# Construct the new tag
NEW_TAG="${{env.RELEASE_PREFIX}}${MAJOR_MINOR_VERSION}.${VERSION_PATCH}"
NEW_TAG="${{env.UGM_RELEASE_PREFIX}}${MAJOR_VERSION}.${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
echo "tagmsg=${{env.UGM_RELEASE_MESSAGE}} ${{steps.date-selector.outputs.date}}" >> $GITHUB_OUTPUT
echo "tagversion=${MAJOR_VERSION}.${MINOR_VERSION}.${VERSION_PATCH}" >> $GITHUB_OUTPUT
- name: Create Git Tag
run: |
git config user.name "GitHub Actions 1"
git config user.email "github-actions@users.noreply.github.com"
git tag -a "${{steps.tag-selector.outputs.gittag}}" -m "${{steps.tag-selector.outputs.tagmsg}}"
git push origin "${{steps.tag-selector.outputs.gittag}}"
- name: Set repository version variable
id: setversion
run: |
gh variable list --env test
gh variable set UGM_BUILD_VERSION --env test --body "${{steps.tag-selector.outputs.tagversion}}"
outputs:
TAGNAME: ${{steps.tag-selector.outputs.gittag}}
TAGMESSAGE: ${{steps.tag-selector.outputs.tagmsg}}
TAGPATCH: ${{steps.tag-selector.outputs.tagpatch}}
PushTag:
needs: [GenerateTag]
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: '1'
- name: Push Git Tag
id: settag
env:
TAGNAME: ${{needs.GenerateTag.outputs.TAGNAME}}
TAGMESSAGE: ${{needs.GenerateTag.outputs.TAGMESSAGE}}
run: |
git config user.name "GitHub Actions 2"
git config user.email "github-actions@users.noreply.github.com"
git tag ${{env.TAGNAME}} -m "${{env.TAGMESSAGE}}"
git push origin ${{env.TAGNAME}}
- name: Set repository patch variable
id: setpatch
env:
TAGPATCH: ${{needs.GenerateTag.outputs.TAGPATCH}}
run: |
gh variable set VERSION_PATCH --body "${{env.TAGPATCH}}"
gh variable list
build:
runs-on: ubuntu-latest
environment: test
Expand Down
1 change: 1 addition & 0 deletions applications/scripts/datafix-ab#001.sql
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ test5
test6
test7
test8
test9