try new model

This commit is contained in:
Michael Duong 2023-09-15 19:40:24 +01:00
parent 398b9d5115
commit ed47abcfc7

View file

@ -16,7 +16,7 @@ permissions: write-all
jobs:
Register-Major-Model-Dev:
if: ${{ (github.event.pull_request.merged == true) && (contains(github.event.pull_request.labels.*.name, 'major')) }}
# if: ${{ (github.event.pull_request.merged == true) && (contains(github.event.pull_request.labels.*.name, 'major')) }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
@ -30,14 +30,19 @@ jobs:
- name: Register Model
run: |
REGISTER_MODEL_NAME=$(echo ${{ github.event.pull_request.head.ref }} | awk -F"-" '{print $1}')
# REGISTER_MODEL_NAME=$(echo ${{ github.event.pull_request.head.ref }} | awk -F"-" '{print $1}')
# REGISTER_MODEL_NAME=$(echo ${{github.ref_name}} | awk -F"-" '{print $1}')
REGISTER_MODEL_NAME=bob
git config user.name "Github-Bot"
git config user.email "Github-Bot@no-reply.com"
latest_version=$(gto show ${REGISTER_MODEL_NAME}@latest --ref | awk -F"@v" '{print $2}')
increment_version=$(echo ${latest_version} | awk -F'.' '{OFS="."; $1+=1; print}')
latest_version=$(gto show ${REGISTER_MODEL_NAME}@latest --ref | awk -F"@v" '{print $2}') || false
if [ -z "${latest_version}" ]; then
increment_version="1.0.0"
else
increment_version=$(echo ${latest_version} | awk -F'.' '{OFS="."; $1+=1; print}')
fi
new_tag=${REGISTER_MODEL_NAME}@v${increment_version}
@ -84,7 +89,7 @@ jobs:
git push
Register-Patch-Model-Dev:
# if: ${{ (github.event.pull_request.merged == true) && (contains(github.event.pull_request.labels.*.name, 'patch')) }}
if: ${{ (github.event.pull_request.merged == true) && (contains(github.event.pull_request.labels.*.name, 'patch')) }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
@ -98,8 +103,8 @@ jobs:
- name: Register Model
run: |
# REGISTER_MODEL_NAME=$(echo ${{ github.event.pull_request.head.ref }} | awk -F"-" '{print $1}')
REGISTER_MODEL_NAME=$(echo ${{github.ref_name}} | awk -F"-" '{print $1}')
REGISTER_MODEL_NAME=$(echo ${{ github.event.pull_request.head.ref }} | awk -F"-" '{print $1}')
# REGISTER_MODEL_NAME=$(echo ${{github.ref_name}} | awk -F"-" '{print $1}')
git config user.name "Github-Bot"
git config user.email "Github-Bot@no-reply.com"
@ -109,7 +114,7 @@ jobs:
new_tag=${REGISTER_MODEL_NAME}@v${increment_version}
git tag -a ${new_tag} -m "Registering new Minor Version"
git tag -a ${new_tag} -m "Registering new Patch Version"
git push origin ${new_tag}
gto show >> MODEL_REGISTRY.md